test262/implementation-contributed/javascriptcore/stress/need-bytecode-liveness-for-unreachable-blocks-at-dfg-time.js
test262-automation e9a5a7f918 [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) (#1620)
* [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)
2018-07-03 15:59:58 -04:00

32 lines
928 B
JavaScript

//@ run("--useConcurrentJIT=false")
// This test is set up delicately to:
// 1. cause the test() function to DFG compile with just the right amount of profiling
// so that ...
// 2. the DFG identifies the "return Function()" path as dead, and ...
// 3. the DFG compiled function doesn't OSR exit too many times before ...
// 4. we change the implementation of the inlined foo() and execute test() again.
//
// This test should not crash.
eval("\"use strict\"; var w;");
foo = function() { throw 0; }
var x;
(function() {
eval("test = function() { ~foo(~(0 ? ~x : x) ? 0 : 0); return Function(); }");
})();
// This loop count of 2000 was empirically determined to be the right amount to get this
// this issue to manifest. Dropping or raising it may mask the issue and prevent it from
// manifesting.
for (var i = 0; i < 2000; ++i) {
try {
test();
} catch(e) {
}
}
foo = function() { };
test();