Chromium Code Reviews| 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()); |