mirror of
https://github.com/tc39/test262.git
synced 2025-05-03 14:30:27 +02:00
* [javascriptcore-test262-automation] changes from git@github.com:WebKit/webkit.git at sha 949e26452cfa153a7f4afe593da97e2fe9e1b706 on Tue Jul 03 2018 14:35:15 GMT-0400 (Eastern Daylight Time)
45 lines
884 B
JavaScript
45 lines
884 B
JavaScript
if (platformSupportsSamplingProfiler()) {
|
|
load("./sampling-profiler/samplingProfiler.js");
|
|
|
|
function bar(y) {
|
|
let x;
|
|
for (let i = 0; i < 20; i++)
|
|
x = new Error();
|
|
return x;
|
|
}
|
|
noInline(bar);
|
|
|
|
function foo() {
|
|
bar(1000);
|
|
}
|
|
noInline(foo);
|
|
|
|
function nothing(x) { return x; }
|
|
noInline(nothing);
|
|
|
|
runTest(foo, ["Error", "bar", "foo"]);
|
|
|
|
function top() {
|
|
let x = 0;
|
|
for (let i = 0; i < 25; i++) {
|
|
x++;
|
|
x--;
|
|
}
|
|
}
|
|
|
|
function jaz(x) { return x + top(); }
|
|
function kaz(y) {
|
|
return jaz(y) + 5;
|
|
}
|
|
function checkInlining() {
|
|
for (let i = 0; i < 100; i++)
|
|
kaz(104);
|
|
}
|
|
|
|
// Tier it up.
|
|
for (let i = 0; i < 1000; i++)
|
|
checkInlining();
|
|
|
|
runTest(checkInlining, ["jaz", "kaz", "checkInlining"]);
|
|
}
|