summaryrefslogtreecommitdiff
path: root/deps/v8/test/mjsunit/maglev/continuation-after-inlined.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/test/mjsunit/maglev/continuation-after-inlined.js')
-rw-r--r--deps/v8/test/mjsunit/maglev/continuation-after-inlined.js29
1 files changed, 29 insertions, 0 deletions
diff --git a/deps/v8/test/mjsunit/maglev/continuation-after-inlined.js b/deps/v8/test/mjsunit/maglev/continuation-after-inlined.js
new file mode 100644
index 0000000000..35fbe9d952
--- /dev/null
+++ b/deps/v8/test/mjsunit/maglev/continuation-after-inlined.js
@@ -0,0 +1,29 @@
+// Copyright 2023 the V8 project authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// Flags: --maglev --maglev-inlining --allow-natives-syntax
+
+function hasInstance(x) {
+ %DeoptimizeFunction(bar);
+ return 5;
+}
+
+function Foo() {}
+Object.defineProperty(Foo, Symbol.hasInstance, {
+ value: hasInstance
+})
+
+let foo = new Foo();
+
+function bar(x) {
+ return x instanceof Foo;
+}
+
+%PrepareFunctionForOptimization(bar);
+%PrepareFunctionForOptimization(hasInstance);
+assertTrue(bar(foo));
+assertTrue(bar(foo));
+
+%OptimizeMaglevOnNextCall(bar);
+assertTrue(bar(foo));