blob: 254050ae54d2b3cfb6d7336913dde34279701083 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
// Print the optimized function's machine code, then let the native debugger
// install a breakpoint before the next invocation. No V8 inspector required.
function jitWork(n) {
let sum = 0;
for (let i = 0; i < n; i++) sum = (sum + (i ^ n)) | 0;
return sum;
}
%PrepareFunctionForOptimization(jitWork);
jitWork(10);
jitWork(20);
%OptimizeFunctionOnNextCall(jitWork);
jitWork(30);
%SystemBreak();
print(jitWork(10000));
|