[JSC] Implement $vm.ftlTrue function for FTL testing
authorutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Feb 2018 17:54:06 +0000 (17:54 +0000)
committerutatane.tea@gmail.com <utatane.tea@gmail.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 23 Feb 2018 17:54:06 +0000 (17:54 +0000)
https://bugs.webkit.org/show_bug.cgi?id=183071

Reviewed by Mark Lam.

JSTests:

* stress/dead-fiat-value-to-int52-then-exit-not-double.js:
(foo):
* stress/dead-fiat-value-to-int52-then-exit-not-int52.js:
(foo):
* stress/dead-fiat-value-to-int52.js:
(foo):
* stress/dead-osr-entry-value.js:
(foo):
* stress/fiat-value-to-int52-then-exit-not-double.js:
(foo):
* stress/fiat-value-to-int52-then-exit-not-int52.js:
(foo):
* stress/fiat-value-to-int52-then-fail-to-fold.js:
(foo):
* stress/fiat-value-to-int52-then-fold.js:
(foo):
* stress/fiat-value-to-int52.js:
(foo):
* stress/fold-based-on-int32-proof-mul-branch.js:
(foo):
* stress/fold-profiled-call-to-call.js:
(foo):
* stress/fold-to-double-constant-then-exit.js:
(foo):
* stress/fold-to-int52-constant-then-exit.js:
(foo):
* stress/fold-to-primitive-in-cfa.js:
(foo):
* stress/fold-to-primitive-to-identity-in-cfa.js:
(foo):
* stress/has-indexed-property-array-storage-ftl.js: Added.
(shouldBe):
(test1):
(test2):
* stress/has-indexed-property-slow-put-array-storage-ftl.js: Added.
(shouldBe):
(test1):
(test2):
* stress/int52-ai-add-then-filter-int32.js:
(foo):
* stress/int52-ai-mul-and-clean-neg-zero-then-filter-int32.js:
(foo):
* stress/int52-ai-mul-then-filter-int32.js:
(foo):
* stress/int52-ai-neg-then-filter-int32.js:
(foo):
* stress/int52-ai-sub-then-filter-int32.js:
(foo):
* stress/licm-pre-header-cannot-exit-nested.js:
(foo):
* stress/licm-pre-header-cannot-exit.js:
(foo):
* stress/sparse-array-entry-update-144067.js:
(useMemoryToTriggerGCs):
* stress/test-spec-misc.js:
(foo):
* stress/tricky-array-bounds-checks.js:
(foo):

Source/JavaScriptCore:

Add $vm.ftlTrue, which becomes true if the caller is compiled in FTL.
This is useful for testing whether the caller function is compiled in FTL.

We also remove duplicate DFGTrue function in jsc.cpp. We have $vm.dfgTrue.

* dfg/DFGByteCodeParser.cpp:
(JSC::DFG::ByteCodeParser::handleIntrinsicCall):
* jsc.cpp:
(GlobalObject::finishCreation):
(functionFalse1):
(functionFalse2): Deleted.
* runtime/Intrinsic.cpp:
(JSC::intrinsicName):
* runtime/Intrinsic.h:
* tools/JSDollarVM.cpp:
(JSC::functionFTLTrue):
(JSC::JSDollarVM::finishCreation):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@228950 268f45cc-cd09-0410-ab3c-d52691b4dbfc

34 files changed:
JSTests/ChangeLog
JSTests/stress/dead-fiat-value-to-int52-then-exit-not-double.js
JSTests/stress/dead-fiat-value-to-int52-then-exit-not-int52.js
JSTests/stress/dead-fiat-value-to-int52.js
JSTests/stress/dead-osr-entry-value.js
JSTests/stress/fiat-value-to-int52-then-exit-not-double.js
JSTests/stress/fiat-value-to-int52-then-exit-not-int52.js
JSTests/stress/fiat-value-to-int52-then-fail-to-fold.js
JSTests/stress/fiat-value-to-int52-then-fold.js
JSTests/stress/fiat-value-to-int52.js
JSTests/stress/fold-based-on-int32-proof-mul-branch.js
JSTests/stress/fold-profiled-call-to-call.js
JSTests/stress/fold-to-double-constant-then-exit.js
JSTests/stress/fold-to-int52-constant-then-exit.js
JSTests/stress/fold-to-primitive-in-cfa.js
JSTests/stress/fold-to-primitive-to-identity-in-cfa.js
JSTests/stress/has-indexed-property-array-storage-ftl.js [new file with mode: 0644]
JSTests/stress/has-indexed-property-slow-put-array-storage-ftl.js [new file with mode: 0644]
JSTests/stress/int52-ai-add-then-filter-int32.js
JSTests/stress/int52-ai-mul-and-clean-neg-zero-then-filter-int32.js
JSTests/stress/int52-ai-mul-then-filter-int32.js
JSTests/stress/int52-ai-neg-then-filter-int32.js
JSTests/stress/int52-ai-sub-then-filter-int32.js
JSTests/stress/licm-pre-header-cannot-exit-nested.js
JSTests/stress/licm-pre-header-cannot-exit.js
JSTests/stress/sparse-array-entry-update-144067.js
JSTests/stress/test-spec-misc.js
JSTests/stress/tricky-array-bounds-checks.js
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
Source/JavaScriptCore/jsc.cpp
Source/JavaScriptCore/runtime/Intrinsic.cpp
Source/JavaScriptCore/runtime/Intrinsic.h
Source/JavaScriptCore/tools/JSDollarVM.cpp

index 365c84d78e3ba1210895b5ba76b3c5e8013f8a32..730d28e5eef24b3fa5aa9aaf17803032b1b2d989 100644 (file)
@@ -1,3 +1,69 @@
+2018-02-23  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        [JSC] Implement $vm.ftlTrue function for FTL testing
+        https://bugs.webkit.org/show_bug.cgi?id=183071
+
+        Reviewed by Mark Lam.
+
+        * stress/dead-fiat-value-to-int52-then-exit-not-double.js:
+        (foo):
+        * stress/dead-fiat-value-to-int52-then-exit-not-int52.js:
+        (foo):
+        * stress/dead-fiat-value-to-int52.js:
+        (foo):
+        * stress/dead-osr-entry-value.js:
+        (foo):
+        * stress/fiat-value-to-int52-then-exit-not-double.js:
+        (foo):
+        * stress/fiat-value-to-int52-then-exit-not-int52.js:
+        (foo):
+        * stress/fiat-value-to-int52-then-fail-to-fold.js:
+        (foo):
+        * stress/fiat-value-to-int52-then-fold.js:
+        (foo):
+        * stress/fiat-value-to-int52.js:
+        (foo):
+        * stress/fold-based-on-int32-proof-mul-branch.js:
+        (foo):
+        * stress/fold-profiled-call-to-call.js:
+        (foo):
+        * stress/fold-to-double-constant-then-exit.js:
+        (foo):
+        * stress/fold-to-int52-constant-then-exit.js:
+        (foo):
+        * stress/fold-to-primitive-in-cfa.js:
+        (foo):
+        * stress/fold-to-primitive-to-identity-in-cfa.js:
+        (foo):
+        * stress/has-indexed-property-array-storage-ftl.js: Added.
+        (shouldBe):
+        (test1):
+        (test2):
+        * stress/has-indexed-property-slow-put-array-storage-ftl.js: Added.
+        (shouldBe):
+        (test1):
+        (test2):
+        * stress/int52-ai-add-then-filter-int32.js:
+        (foo):
+        * stress/int52-ai-mul-and-clean-neg-zero-then-filter-int32.js:
+        (foo):
+        * stress/int52-ai-mul-then-filter-int32.js:
+        (foo):
+        * stress/int52-ai-neg-then-filter-int32.js:
+        (foo):
+        * stress/int52-ai-sub-then-filter-int32.js:
+        (foo):
+        * stress/licm-pre-header-cannot-exit-nested.js:
+        (foo):
+        * stress/licm-pre-header-cannot-exit.js:
+        (foo):
+        * stress/sparse-array-entry-update-144067.js:
+        (useMemoryToTriggerGCs):
+        * stress/test-spec-misc.js:
+        (foo):
+        * stress/tricky-array-bounds-checks.js:
+        (foo):
+
 2018-02-22  Yusuke Suzuki  <utatane.tea@gmail.com>
 
         [FTL] Support HasIndexedProperty for ArrayStorage and SlowPutArrayStorage
index 33551232711268507b00f70259d29a87aa15adef..c737a43c0a114b1d7603fbd1bf9b9d797cb0476c 100644 (file)
@@ -1,5 +1,5 @@
 function foo() {
-    var value = bar(DFGTrue());
+    var value = bar($vm.dfgTrue());
     fiatInt52(value);
     fiatInt52(value);
 }
index 5ecc40481763a59e344894243e251eb51081ab75..4d29e7f6299859d80085e1c2f4527713940d630c 100644 (file)
@@ -1,5 +1,5 @@
 function foo() {
-    var value = bar(DFGTrue());
+    var value = bar($vm.dfgTrue());
     fiatInt52(value);
     fiatInt52(value);
 }
index 0e54daacd25ed3aef963bd0d1a0918c992adbb46..fbde20195a503cc82b85a53641830aff5c4d8d0a 100644 (file)
@@ -1,5 +1,5 @@
 function foo() {
-    var value = bar(DFGTrue());
+    var value = bar($vm.dfgTrue());
     fiatInt52(value);
     fiatInt52(value);
 }
index dc45338c959e313bc86a93f5fcd21e9f32c11012..db6639cb22b303104832bb33116639e88efe8d27 100644 (file)
@@ -3,7 +3,7 @@ function foo() {
     var result = 0;
     OSRExit();
     for (var i = 0; i < 10000; ++i) {
-        if (!DFGTrue())
+        if (!$vm.dfgTrue())
             result += o.f;
     }
     return result;
index 9cb35b80ba0256f8ab5e8630ced33ce43dc3c8eb..a20a5f8b067944cea9303d87740453119b7324f4 100644 (file)
@@ -1,5 +1,5 @@
 function foo() {
-    return fiatInt52(bar(DFGTrue())) + 1;
+    return fiatInt52(bar($vm.dfgTrue())) + 1;
 }
 
 var thingy = false;
index 0b1129ec171009d718affb5c678d52778e612c26..e477a10b3b29c47a2f5a92d89544797b080535d1 100644 (file)
@@ -1,5 +1,5 @@
 function foo() {
-    return fiatInt52(bar(DFGTrue())) + 1;
+    return fiatInt52(bar($vm.dfgTrue())) + 1;
 }
 
 var thingy = false;
index 4413bd7fbcc4add82a87dee730ff9ac501ff0f51..fde0a28a793f787fa13febd5273b3f9306e4b080 100644 (file)
@@ -1,5 +1,5 @@
 function foo() {
-    return fiatInt52(DFGTrue() ? 5.5 : 42) + 1;
+    return fiatInt52($vm.dfgTrue() ? 5.5 : 42) + 1;
 }
 
 noInline(foo);
index 86f26c69a0c3afaaf36bf98230c2883ed3736d69..380240c75b1f29822c30d0483efc18543353f817 100644 (file)
@@ -1,5 +1,5 @@
 function foo() {
-    return fiatInt52(DFGTrue() ? 42 : 5.5) + 1;
+    return fiatInt52($vm.dfgTrue() ? 42 : 5.5) + 1;
 }
 
 noInline(foo);
index c37c21fa7d022c16baca01f722dd0a97ab905b9e..9833582d3e975c2e74ab870f460847045dc4c412 100644 (file)
@@ -1,5 +1,5 @@
 function foo() {
-    return fiatInt52(bar(DFGTrue())) + 1;
+    return fiatInt52(bar($vm.dfgTrue())) + 1;
 }
 
 function bar(p) {
index 4d1883d523a63e9ea367fd056ffe81bfe51835ef..a9c6f01886e465bd26ebedd73a0f22f482183b66 100644 (file)
@@ -1,8 +1,8 @@
 function foo(a, b) {
-    var value = DFGTrue() ? -0 : "foo";
+    var value = $vm.dfgTrue() ? -0 : "foo";
     if (a * b == value)
-        return [DFGTrue(), true];
-    return [DFGTrue(), false];
+        return [$vm.dfgTrue(), true];
+    return [$vm.dfgTrue(), false];
 }
 noInline(foo);
 
index 387a88c4a26699c7ff1e62f36c8abbf1b6058395..0ca898e318017e4ccca029f1f312447e0810b693 100644 (file)
@@ -1,5 +1,5 @@
 function foo(f) {
-    if (DFGTrue())
+    if ($vm.dfgTrue())
         f = bar;
     return f().f;
 }
index 0c29f0b833c5cc8a012e5fedf3f4641b793e5cd3..8fa2327153a6afa9260e5194efcfa4cb3ec92263 100644 (file)
@@ -1,5 +1,5 @@
 function foo(a, b) {
-    if (DFGTrue())
+    if ($vm.dfgTrue())
         a = b = 5.4;
     var c = a + b;
     if (isFinalTier())
index 3201d9bb3ac763cbd94fc721ace7344508256083..e3b4753766ff09efadef7fbecd87737073cff098 100644 (file)
@@ -1,5 +1,5 @@
 function foo(a, b) {
-    if (DFGTrue())
+    if ($vm.dfgTrue())
         a = b = 2000000000;
     var c = a + b;
     if (isFinalTier())
index eb6f9d18e39289c4ae12f9415602136ca604a6f2..899a171203525299f6e48fc98f2e27675465f9ef 100644 (file)
@@ -1,5 +1,5 @@
 function foo(x) {
-    if (DFGTrue())
+    if ($vm.dfgTrue())
         x = "hello";
     return x + " world";
 }
index 413e1c8b99eb5dfdb84417ff385381d9bb2623cc..277488ca970e35ecccf5db2c0355d95b2b1b4a46 100644 (file)
@@ -1,5 +1,5 @@
 function foo(x, p) {
-    if (DFGTrue())
+    if ($vm.dfgTrue())
         x = p ? "hello" : "bar";
     return x + " world";
 }
diff --git a/JSTests/stress/has-indexed-property-array-storage-ftl.js b/JSTests/stress/has-indexed-property-array-storage-ftl.js
new file mode 100644 (file)
index 0000000..43a29c1
--- /dev/null
@@ -0,0 +1,48 @@
+//@ runFTLNoCJIT
+
+function shouldBe(actual, expected) {
+    if (actual !== expected)
+        throw new Error('bad value: ' + actual);
+}
+
+var didFTLCompile = false;
+var ftlTrue = $vm.ftlTrue;
+function test1(array)
+{
+    didFTLCompile = ftlTrue();
+    return 2 in array;
+}
+noInline(test1);
+
+var array = [1, 2, 3, 4];
+ensureArrayStorage(array);
+didFTLCompile = false;
+for (var i = 0; i < 1e5; ++i)
+    shouldBe(test1(array), true);
+shouldBe(didFTLCompile, true);
+
+var array = [1, 2, , 4];
+ensureArrayStorage(array);
+shouldBe(test1(array), false);
+
+var array = [];
+ensureArrayStorage(array);
+shouldBe(test1(array), false);
+
+function test2(array)
+{
+    didFTLCompile = ftlTrue();
+    return 2 in array;
+}
+noInline(test2);
+
+var array1 = [1, 2, 3, 4];
+ensureArrayStorage(array1);
+var array2 = [1, 2];
+ensureArrayStorage(array2);
+didFTLCompile = false;
+for (var i = 0; i < 1e5; ++i)
+    shouldBe(test2(array2), false);
+shouldBe(didFTLCompile, true);
+shouldBe(test2(array2), false);
+shouldBe(test2(array1), true);
diff --git a/JSTests/stress/has-indexed-property-slow-put-array-storage-ftl.js b/JSTests/stress/has-indexed-property-slow-put-array-storage-ftl.js
new file mode 100644 (file)
index 0000000..7f35580
--- /dev/null
@@ -0,0 +1,61 @@
+//@ runFTLNoCJIT
+
+function shouldBe(actual, expected) {
+    if (actual !== expected)
+        throw new Error('bad value: ' + actual);
+}
+
+var didFTLCompile = false;
+var ftlTrue = $vm.ftlTrue;
+function test1(array)
+{
+    didFTLCompile = ftlTrue();
+    return 2 in array;
+}
+noInline(test1);
+
+var object = { a: 10 };
+Object.defineProperties(object, {
+    "0": {
+        get: function() { return this.a; },
+        set: function(x) { this.a = x; },
+    },
+});
+
+var array = [1, 2, 3, 4];
+array.__proto__ = object;
+ensureArrayStorage(array);
+didFTLCompile = false;
+for (var i = 0; i < 1e5; ++i)
+    shouldBe(test1(array), true);
+shouldBe(didFTLCompile, true);
+
+var array = [1, 2, , 4];
+array.__proto__ = object;
+ensureArrayStorage(array);
+shouldBe(test1(array), false);
+
+var array = [];
+array.__proto__ = object;
+ensureArrayStorage(array);
+shouldBe(test1(array), false);
+
+function test2(array)
+{
+    didFTLCompile = ftlTrue();
+    return 2 in array;
+}
+noInline(test2);
+
+var array1 = [1, 2, 3, 4];
+array1.__proto__ = object;
+ensureArrayStorage(array1);
+var array2 = [1, 2];
+array2.__proto__ = object;
+ensureArrayStorage(array2);
+didFTLCompile = false;
+for (var i = 0; i < 1e5; ++i)
+    shouldBe(test2(array2), false);
+shouldBe(didFTLCompile, true);
+shouldBe(test2(array2), false);
+shouldBe(test2(array1), true);
index 01e4e4f357a3b3d955de86b8c94cafb7d22a66d3..3f038dcbfe074bdac302456902833d18e3e81352 100644 (file)
@@ -1,6 +1,6 @@
 function foo(a, b, c) {
     var o = {f:42};
-    if (DFGTrue())
+    if ($vm.dfgTrue())
         o.f = a + b + c;
     return o.f | 0;
 }
index da4cd82ffb82c46fee3811b955f7bbe49ec2aa0d..061b7ea7fe72a70c14f0bf2ba19aed66dc91db56 100644 (file)
@@ -1,6 +1,6 @@
 function foo(a, b, c) {
     var o = {f:42};
-    if (DFGTrue())
+    if ($vm.dfgTrue())
         o.f = (a * b + 5) * c + 5;
     return o.f | 0;
 }
index 7048e2100f83159cc4a431396280612a3909bcec..541801728fd382a59a930366bdfa41c8a8530ef8 100644 (file)
@@ -1,6 +1,6 @@
 function foo(a, b, c) {
     var o = {f:42};
-    if (DFGTrue())
+    if ($vm.dfgTrue())
         o.f = a * b * c;
     return o.f | 0;
 }
index 68e4f8ee12cf8445421a7327c19ff40de33a987f..82c971c0d164a417aba0262f4026d0ae295d3af1 100644 (file)
@@ -1,6 +1,6 @@
 function foo(a, b) {
     var o = {f:42};
-    if (DFGTrue())
+    if ($vm.dfgTrue())
         o.f = -(a + b);
     return o.f | 0;
 }
index 4f53a6f2ecaa92118fec259ad7d9aaecf0c20917..7d70b155b73ae8c351ccfd2c0520bb79ed177729 100644 (file)
@@ -1,6 +1,6 @@
 function foo(a, b) {
     var o = {f:42};
-    if (DFGTrue())
+    if ($vm.dfgTrue())
         o.f = a - b - 2000000000;
     return o.f | 0;
 }
index 943fd62455cf0914f9ceeb5479d66f347d119d48..b866747cc7f6092acb2144fc811e0404721c22b9 100644 (file)
@@ -4,7 +4,7 @@ function foo(object, predicate) {
     for (var j = 0; j < 10; ++j) {
         var result = 0;
         var i = 0;
-        if (DFGTrue())
+        if ($vm.dfgTrue())
             predicate = 42;
         while (predicate >= 42) {
             result += object.array[i++];
index 0aa893200ff6469e05f6ae7f7c85e08f2f7b0e4e..8a4262d75937198ba4d30a8c7b9fcd1c48cd60c4 100644 (file)
@@ -3,7 +3,7 @@
 function foo(object, predicate) {
     var result = 0;
     var i = 0;
-    if (DFGTrue())
+    if ($vm.dfgTrue())
         predicate = 42;
     while (predicate >= 42) {
         result += object.array[i++];
index 24cea7c52d7c2b2cde25b8065f3e13d89d4c9e62..6802ee1721796f932e1eedc5ad32029023a9fc88 100644 (file)
@@ -36,7 +36,7 @@ for (var i = 0; i < 5; i++)
 
 function useMemoryToTriggerGCs() {
     var arr = [];
-    var limit = DFGTrue() ? 10000 : 100;
+    var limit = $vm.dfgTrue() ? 10000 : 100;
     for (var i = 0; i < limit; i++)
         arr[i] = { a: "using" + i, b: "up" + i, c: "memory" + i };
     return arr;
index 7d7150542dff108397bf1f927448f98d7aea4ea4..4194b0c9c6781bf13951dcb7ddc7bddb8cc0039f 100644 (file)
@@ -11,7 +11,7 @@ noInline(getX);
 
 function foo(index) {
     var result = false;
-    var x = getX(DFGTrue());
+    var x = getX($vm.dfgTrue());
 
     x * 2;
 
index 8cfbe1a9d06d6bcd002298ff0556161362823ace..699f350b63c102a2c649289ce95496cb56e985a1 100644 (file)
@@ -1,6 +1,6 @@
 function foo(a, i, p) {
-    if (p || !DFGTrue())
-        return [DFGTrue(), a[(i - (DFGTrue() ? 2147483646 : 0)) | 0], a[i], a[(i + (DFGTrue() ? 2147483646 : 0)) | 0], DFGTrue()];
+    if (p || !$vm.dfgTrue())
+        return [$vm.dfgTrue(), a[(i - ($vm.dfgTrue() ? 2147483646 : 0)) | 0], a[i], a[(i + ($vm.dfgTrue() ? 2147483646 : 0)) | 0], $vm.dfgTrue()];
     return [12];
 }
 
index 3406289d6c019e2b8caa1636c091bd988925e70e..02e7ba112dd0ba4fea7489a84057c0f016a88acb 100644 (file)
@@ -1,3 +1,28 @@
+2018-02-23  Yusuke Suzuki  <utatane.tea@gmail.com>
+
+        [JSC] Implement $vm.ftlTrue function for FTL testing
+        https://bugs.webkit.org/show_bug.cgi?id=183071
+
+        Reviewed by Mark Lam.
+
+        Add $vm.ftlTrue, which becomes true if the caller is compiled in FTL.
+        This is useful for testing whether the caller function is compiled in FTL.
+
+        We also remove duplicate DFGTrue function in jsc.cpp. We have $vm.dfgTrue.
+
+        * dfg/DFGByteCodeParser.cpp:
+        (JSC::DFG::ByteCodeParser::handleIntrinsicCall):
+        * jsc.cpp:
+        (GlobalObject::finishCreation):
+        (functionFalse1):
+        (functionFalse2): Deleted.
+        * runtime/Intrinsic.cpp:
+        (JSC::intrinsicName):
+        * runtime/Intrinsic.h:
+        * tools/JSDollarVM.cpp:
+        (JSC::functionFTLTrue):
+        (JSC::JSDollarVM::finishCreation):
+
 2018-02-22  Yusuke Suzuki  <utatane.tea@gmail.com>
 
         [FTL] Support HasIndexedProperty for ArrayStorage and SlowPutArrayStorage
index ae8c6bc850c52ea73795cefbad50ab0449207887..8db7f579661c473f319e91e08139a5cdf91eef56 100644 (file)
@@ -2779,6 +2779,12 @@ bool ByteCodeParser::handleIntrinsicCall(Node* callee, int resultOperand, Intrin
         set(VirtualRegister(resultOperand), jsConstant(jsBoolean(true)));
         return true;
     }
+
+    case FTLTrueIntrinsic: {
+        insertChecks();
+        set(VirtualRegister(resultOperand), jsConstant(jsBoolean(isFTL(m_graph.m_plan.mode))));
+        return true;
+    }
         
     case OSRExitIntrinsic: {
         insertChecks();
index 0602e4d9411450cc883c1283d73e5dc27a527c71..3b8839cfc5bbd37883ecff7cd9b05b8b056d3bc8 100644 (file)
@@ -288,8 +288,7 @@ static EncodedJSValue JSC_HOST_CALL functionReoptimizationRetryCount(ExecState*)
 static EncodedJSValue JSC_HOST_CALL functionTransferArrayBuffer(ExecState*);
 static EncodedJSValue JSC_HOST_CALL functionFailNextNewCodeBlock(ExecState*);
 static NO_RETURN_WITH_VALUE EncodedJSValue JSC_HOST_CALL functionQuit(ExecState*);
-static EncodedJSValue JSC_HOST_CALL functionFalse1(ExecState*);
-static EncodedJSValue JSC_HOST_CALL functionFalse2(ExecState*);
+static EncodedJSValue JSC_HOST_CALL functionFalse(ExecState*);
 static EncodedJSValue JSC_HOST_CALL functionUndefined1(ExecState*);
 static EncodedJSValue JSC_HOST_CALL functionUndefined2(ExecState*);
 static EncodedJSValue JSC_HOST_CALL functionIsInt32(ExecState*);
@@ -515,9 +514,8 @@ protected:
         addFunction(vm, "clearSamplingFlags", functionClearSamplingFlags, 1);
 #endif
 
-        putDirectNativeFunction(vm, this, Identifier::fromString(&vm, "DFGTrue"), 0, functionFalse1, DFGTrueIntrinsic, static_cast<unsigned>(PropertyAttribute::DontEnum));
         putDirectNativeFunction(vm, this, Identifier::fromString(&vm, "OSRExit"), 0, functionUndefined1, OSRExitIntrinsic, static_cast<unsigned>(PropertyAttribute::DontEnum));
-        putDirectNativeFunction(vm, this, Identifier::fromString(&vm, "isFinalTier"), 0, functionFalse2, IsFinalTierIntrinsic, static_cast<unsigned>(PropertyAttribute::DontEnum));
+        putDirectNativeFunction(vm, this, Identifier::fromString(&vm, "isFinalTier"), 0, functionFalse, IsFinalTierIntrinsic, static_cast<unsigned>(PropertyAttribute::DontEnum));
         putDirectNativeFunction(vm, this, Identifier::fromString(&vm, "predictInt32"), 0, functionUndefined2, SetInt32HeapPredictionIntrinsic, static_cast<unsigned>(PropertyAttribute::DontEnum));
         putDirectNativeFunction(vm, this, Identifier::fromString(&vm, "isInt32"), 0, functionIsInt32, CheckInt32Intrinsic, static_cast<unsigned>(PropertyAttribute::DontEnum));
         putDirectNativeFunction(vm, this, Identifier::fromString(&vm, "fiatInt52"), 0, functionIdentity, FiatInt52Intrinsic, static_cast<unsigned>(PropertyAttribute::DontEnum));
@@ -1827,8 +1825,7 @@ EncodedJSValue JSC_HOST_CALL functionQuit(ExecState*)
 #endif
 }
 
-EncodedJSValue JSC_HOST_CALL functionFalse1(ExecState*) { return JSValue::encode(jsBoolean(false)); }
-EncodedJSValue JSC_HOST_CALL functionFalse2(ExecState*) { return JSValue::encode(jsBoolean(false)); }
+EncodedJSValue JSC_HOST_CALL functionFalse(ExecState*) { return JSValue::encode(jsBoolean(false)); }
 
 EncodedJSValue JSC_HOST_CALL functionUndefined1(ExecState*) { return JSValue::encode(jsUndefined()); }
 EncodedJSValue JSC_HOST_CALL functionUndefined2(ExecState*) { return JSValue::encode(jsUndefined()); }
index 1e09ab10856685d617bd6966f30dc67220b29152..a0aa108a895ccdc2ea0b82d0e6a05d06fa6a5153 100644 (file)
@@ -213,6 +213,8 @@ const char* intrinsicName(Intrinsic intrinsic)
         return "UnderscoreProtoIntrinsic";
     case DFGTrueIntrinsic:
         return "DFGTrueIntrinsic";
+    case FTLTrueIntrinsic:
+        return "FTLTrueIntrinsic";
     case OSRExitIntrinsic:
         return "OSRExitIntrinsic";
     case IsFinalTierIntrinsic:
index 788acec82866348ea38cf4c9348037e981b407d9..7832e06d2f4b13d8f7093c4cca11282ad906b107 100644 (file)
@@ -124,6 +124,7 @@ enum Intrinsic {
     // Debugging intrinsics. These are meant to be used as testing hacks within
     // jsc.cpp and should never be exposed to users.
     DFGTrueIntrinsic,
+    FTLTrueIntrinsic,
     OSRExitIntrinsic,
     IsFinalTierIntrinsic,
     SetInt32HeapPredictionIntrinsic,
index da96657fe7f9ed0b77fba22cf7577fb487e337f0..9e08afee25dc81a194e9c04598abecfad7dce00a 100644 (file)
@@ -1049,6 +1049,13 @@ static EncodedJSValue JSC_HOST_CALL functionDFGTrue(ExecState*)
     return JSValue::encode(jsBoolean(false));
 }
 
+// Returns true if the current frame is a FTL frame.
+// Usage: isFTL = $vm.ftlTrue()
+static EncodedJSValue JSC_HOST_CALL functionFTLTrue(ExecState*)
+{
+    return JSValue::encode(jsBoolean(false));
+}
+
 static EncodedJSValue JSC_HOST_CALL functionCpuMfence(ExecState*)
 {
 #if CPU(X86_64) && !OS(WINDOWS)
@@ -1759,6 +1766,7 @@ void JSDollarVM::finishCreation(VM& vm)
     addFunction(vm, "crash", functionCrash, 0);
 
     putDirectNativeFunction(vm, globalObject, Identifier::fromString(&vm, "dfgTrue"), 0, functionDFGTrue, DFGTrueIntrinsic, static_cast<unsigned>(PropertyAttribute::DontEnum));
+    putDirectNativeFunction(vm, globalObject, Identifier::fromString(&vm, "ftlTrue"), 0, functionFTLTrue, FTLTrueIntrinsic, static_cast<unsigned>(PropertyAttribute::DontEnum));
 
     putDirectNativeFunction(vm, globalObject, Identifier::fromString(&vm, "cpuMfence"), 0, functionCpuMfence, CPUMfenceIntrinsic, 0);
     putDirectNativeFunction(vm, globalObject, Identifier::fromString(&vm, "cpuRdtsc"), 0, functionCpuRdtsc, CPURdtscIntrinsic, 0);