Bug 255508 - LLInt should update stackTraceLimit in GlobalObject
Summary: LLInt should update stackTraceLimit in GlobalObject
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Local Build
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-04-17 02:32 PDT by EntryHi
Modified: 2023-04-24 02:32 PDT (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description EntryHi 2023-04-17 02:32:03 PDT
function f0(a1) {
  try{
    Error.stackTraceLimit = a1; // put_by_id
    throw Error()
  }
  catch(e)
  {
    return e.stack;
  }
}
for (let v14 = 0; v14 < 2; v14++) {
  print(f0(v14));
}

With the above script as input to JSC, run JSC with the following parameters:
./jsc test.js --useConcurrentJIT=0 

JSC print two "undefined". The corrent result should be an "undefined" and a stackTrace. The problem may be in LLInt. 

The number of loops is 2. Therefore, LLInt will execute `put_by_id` twice, the first execution is slow_path, and `stackTraceLimit` in `globalObject` will be updated, but the slow_path is not used for the second time, and `stackTraceLimit` in `globalObject` is not updated. `getStackTrace` in Error.cpp will use `stackTraceLimit`, but stackTraceLimit is always 0, so two "undefined" are printed. 

Safari console also prints wrong result, V8 prints correct result.
Comment 1 Radar WebKit Bug Importer 2023-04-24 02:32:19 PDT
<rdar://problem/108444270>