Bug 276163

Summary: valueOf is not executed for Atomics.isLockFree in JIT compiler
Product: WebKit Reporter: YuHao Hu <q602706150>
Component: JavaScriptCoreAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: keith_miller, mark.lam, webkit-bug-importer, ysuzuki
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: Unspecified   
OS: All   

Description YuHao Hu 2024-07-02 20:20:58 PDT
the test case
```
let count = 0
function opt() {
    Atomics.isLockFree({
        valueOf: function () {
            count++
        }
    });
}
for (let i = 0; i < 140; i++) {
    opt();
}
print(count)
```

run args:
cmake-build-debug/bin/jsc --useConcurrentJIT=0 ./test.js

expected output:
140

actual output:
99

tested in webkit commit id:
31e77e6ca86aa67419cbcf393a5bedcc925d8cf5
Comment 1 Radar WebKit Bug Importer 2024-07-09 20:21:15 PDT
<rdar://problem/131432975>