2016-05-06 12:36:23 +00:00
|
|
|
// Copyright 2016 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.
|
|
|
|
|
2017-09-13 14:52:42 +00:00
|
|
|
// Flags: --allow-natives-syntax --stress-inline
|
2016-05-06 12:36:23 +00:00
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
function h() {
|
2019-06-12 14:00:50 +00:00
|
|
|
var stack = new Error('boom').stack;
|
2016-05-06 12:36:23 +00:00
|
|
|
print(stack);
|
|
|
|
%DeoptimizeFunction(f1);
|
|
|
|
%DeoptimizeFunction(f2);
|
|
|
|
%DeoptimizeFunction(f3);
|
|
|
|
%DeoptimizeFunction(g);
|
|
|
|
%DeoptimizeFunction(h);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
%NeverOptimizeFunction(h);
|
|
|
|
|
|
|
|
function g(v) {
|
|
|
|
return h();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function f1() {
|
|
|
|
var o = {};
|
|
|
|
o.__defineGetter__('p', g);
|
|
|
|
o.p;
|
2019-06-12 14:00:50 +00:00
|
|
|
};
|
|
|
|
%PrepareFunctionForOptimization(f1);
|
2016-05-06 12:36:23 +00:00
|
|
|
f1();
|
|
|
|
f1();
|
|
|
|
%OptimizeFunctionOnNextCall(f1);
|
|
|
|
f1();
|
|
|
|
|
|
|
|
|
|
|
|
function f2() {
|
|
|
|
var o = {};
|
|
|
|
o.__defineSetter__('q', g);
|
|
|
|
o.q = 1;
|
2019-06-12 14:00:50 +00:00
|
|
|
};
|
|
|
|
%PrepareFunctionForOptimization(f2);
|
2016-05-06 12:36:23 +00:00
|
|
|
f2();
|
|
|
|
f2();
|
|
|
|
%OptimizeFunctionOnNextCall(f2);
|
|
|
|
f2();
|
|
|
|
|
|
|
|
|
|
|
|
function A() {
|
|
|
|
return h();
|
|
|
|
}
|
|
|
|
|
|
|
|
function f3() {
|
|
|
|
new A();
|
2019-06-12 14:00:50 +00:00
|
|
|
};
|
|
|
|
%PrepareFunctionForOptimization(f3);
|
2016-05-06 12:36:23 +00:00
|
|
|
f3();
|
|
|
|
f3();
|
|
|
|
%OptimizeFunctionOnNextCall(f3);
|
|
|
|
f3();
|