haikuwebkit/LayoutTests/js/script-tests/dfg-cfg-simplify-eliminate-...

33 lines
652 B
JavaScript
Raw Permalink Normal View History

description(
"Tests what happens when CFG simplification leads to the elimination of a set local that had a type check, and then we branch on the variable not being null."
);
function foo(o) {
var x;
if (o.f)
x = o.g;
else
x = o.h;
if (x != null)
return x - 1;
else
return x;
}
fast/js/dfg-* tests should wait for the concurrent JIT https://bugs.webkit.org/show_bug.cgi?id=120723 Rubber stamped by Oliver Hunt. Convert more tests. * fast/js/dfg-branch-logical-not-peephole-around-osr-exit-expected.txt: * fast/js/dfg-branch-not-fail-expected.txt: * fast/js/dfg-byte-array-put-expected.txt: * fast/js/dfg-call-function-hit-watchpoint-expected.txt: * fast/js/dfg-call-method-hit-watchpoint-expected.txt: * fast/js/dfg-captured-var-get-local-expected.txt: * fast/js/dfg-cfa-merge-with-dead-use-at-tail-expected.txt: * fast/js/dfg-cfg-simplify-eliminate-set-local-type-check-then-branch-not-null-and-decrement-expected.txt: * fast/js/dfg-cfg-simplify-eliminate-set-local-type-check-then-branch-not-null-expected.txt: * fast/js/dfg-cfg-simplify-eliminate-set-local-type-check-then-typeof-expected.txt: * fast/js/dfg-cfg-simplify-phantom-get-local-on-same-block-set-local-expected.txt: * fast/js/dfg-cfg-simplify-redundant-dead-get-local-expected.txt: * fast/js/dfg-check-function-change-structure-expected.txt: * fast/js/jsc-test-list: * fast/js/script-tests/dfg-branch-logical-not-peephole-around-osr-exit.js: * fast/js/script-tests/dfg-branch-not-fail.js: * fast/js/script-tests/dfg-byte-array-put.js: * fast/js/script-tests/dfg-call-function-hit-watchpoint.js: * fast/js/script-tests/dfg-call-method-hit-watchpoint.js: * fast/js/script-tests/dfg-captured-var-get-local.js: * fast/js/script-tests/dfg-cfa-merge-with-dead-use-at-tail.js: * fast/js/script-tests/dfg-cfg-simplify-eliminate-set-local-type-check-then-branch-not-null-and-decrement.js: * fast/js/script-tests/dfg-cfg-simplify-eliminate-set-local-type-check-then-branch-not-null.js: * fast/js/script-tests/dfg-cfg-simplify-eliminate-set-local-type-check-then-typeof.js: * fast/js/script-tests/dfg-cfg-simplify-phantom-get-local-on-same-block-set-local.js: * fast/js/script-tests/dfg-cfg-simplify-redundant-dead-get-local.js: * fast/js/script-tests/dfg-check-function-change-structure.js: Canonical link: https://commits.webkit.org/138734@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@155122 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2013-09-05 15:54:07 +00:00
silentTestPass = true;
noInline(foo);
for (var i = 0; i < 500; i = dfgIncrement({f:foo, i:i + 1, n:100})) {
var o = {f:foo};
var expected;
if (i < 450) {
o.g = i;
expected = "" + (i - 1);
} else {
o.g = null;
expected = "null";
}
shouldBe("foo(o)", expected);
}