blob: 6840159f30dac8d04585e77013d758bb583659d8 [file] [log] [blame]
Ben Murdochda12d292016-06-02 14:46:10 +01001// Copyright 2016 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: --harmony-tailcalls --allow-natives-syntax
6
7"use strict";
8
9function h() {
10 var stack = (new Error("boom")).stack;
11 print(stack);
12 %DeoptimizeFunction(f1);
13 %DeoptimizeFunction(f2);
14 %DeoptimizeFunction(f3);
15 %DeoptimizeFunction(g);
16 %DeoptimizeFunction(h);
17 return 1;
18}
19%NeverOptimizeFunction(h);
20
21function g(v) {
22 return h();
23}
24%SetForceInlineFlag(g);
25
26
27function f1() {
28 var o = {};
29 o.__defineGetter__('p', g);
30 o.p;
31}
32
33f1();
34f1();
35%OptimizeFunctionOnNextCall(f1);
36f1();
37
38
39function f2() {
40 var o = {};
41 o.__defineSetter__('q', g);
42 o.q = 1;
43}
44
45f2();
46f2();
47%OptimizeFunctionOnNextCall(f2);
48f2();
49
50
51function A() {
52 return h();
53}
54
55function f3() {
56 new A();
57}
58
59f3();
60f3();
61%OptimizeFunctionOnNextCall(f3);
62f3();