Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(448)

Unified Diff: test/mjsunit/get-caller-js-function.js

Issue 1146963002: Add %GetCallerJSFunction intrinsic (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Merge with ToT Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« src/compiler/simplified-lowering.cc ('K') | « src/runtime/runtime-internal.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/get-caller-js-function.js
diff --git a/test/mjsunit/get-caller-js-function.js b/test/mjsunit/get-caller-js-function.js
new file mode 100644
index 0000000000000000000000000000000000000000..87b62e47e71a492d965c575f75ee88506580712b
--- /dev/null
+++ b/test/mjsunit/get-caller-js-function.js
@@ -0,0 +1,32 @@
+// Copyright 2015 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: --turbo-deoptimization --allow-natives-syntax
+
+var a = function() {
+ return %GetCallerJSFunction();
Sven Panne 2015/05/20 14:05:48 This will *always* call the runtime function, do y
danno 2015/05/22 11:21:35 Good catch. Will fix.
+}
+var b = function() {
+ return a();
+}
+assertEquals(b, b());
+
+var c = function() {
+ return a();
+}
+c();
Michael Starzinger 2015/05/20 14:25:18 nit: Can we wrap all three calls to "c" into an as
danno 2015/05/22 11:21:35 Done.
+c();
+%SetForceInlineFlag(a);
+%OptimizeFunctionOnNextCall(c);
+c();
+
+%SetForceInlineFlag(b);
+var d = function() {
+ return b();
+}
+d();
Michael Starzinger 2015/05/20 14:25:18 nit: Likewise.
danno 2015/05/22 11:21:35 Done.
+d();
+%OptimizeFunctionOnNextCall(d);
+d();
+assertEquals(b, d());
« src/compiler/simplified-lowering.cc ('K') | « src/runtime/runtime-internal.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698