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

Side by Side 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: Tests run 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 unified diff | Download patch
« no previous file with comments | « src/runtime/runtime-internal.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // Flags: --turbo-deoptimization --allow-natives-syntax
6
7 (function() {
8 var a = function() {
9 return %_GetCallerJSFunction();
10 }
11 var b = function() {
12 return a();
13 }
14 assertEquals(b, b());
15
16 var b2 = function() {
17 return a();
18 }
19 assertEquals(b2, b2());
20 assertEquals(b2, b2());
21 %SetForceInlineFlag(a);
22 %OptimizeFunctionOnNextCall(b2);
23 assertEquals(b2, b2());
24 assertEquals(b2, b2());
25
26 var c = function() {
27 return b();
28 }
29 assertEquals(b, c());
30 assertEquals(b, c());
31 %SetForceInlineFlag(b);
32 %OptimizeFunctionOnNextCall(c);
33 assertEquals(b, c());
34 assertEquals(b, c());
35
36 %SetForceInlineFlag(c);
37 var d = function() {
38 return c();
39 }
40 assertEquals(b, d());
41 assertEquals(b, d());
42 %OptimizeFunctionOnNextCall(d);
43 assertEquals(b, d());
44 assertEquals(b, d());
45
46 var b_mismatch = function() {
47 return a(1,2,3)
Michael Starzinger 2015/05/22 12:41:12 As discussed offline: Can we have another test cas
48 }
49 assertEquals(b_mismatch, b_mismatch());
50 }());
OLDNEW
« no previous file with comments | « src/runtime/runtime-internal.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698