2014-04-09 07:35:12 +00:00
|
|
|
// Copyright 2014 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: --allow-natives-syntax
|
|
|
|
|
|
|
|
function runNearStackLimit(f) {
|
|
|
|
function t() {
|
2019-06-12 14:00:50 +00:00
|
|
|
try {
|
|
|
|
t();
|
|
|
|
} catch (e) {
|
|
|
|
f();
|
|
|
|
}
|
2014-04-09 07:35:12 +00:00
|
|
|
};
|
2019-06-12 14:00:50 +00:00
|
|
|
try {
|
|
|
|
t();
|
|
|
|
} catch (e) {
|
|
|
|
}
|
2014-04-09 07:35:12 +00:00
|
|
|
}
|
|
|
|
|
2019-06-12 14:00:50 +00:00
|
|
|
function g(x) {
|
|
|
|
return x.bar;
|
|
|
|
};
|
|
|
|
%PrepareFunctionForOptimization(g);
|
|
|
|
function f1() {}
|
|
|
|
function f2() {}
|
2014-04-09 07:35:12 +00:00
|
|
|
|
|
|
|
var x = Object.defineProperty({}, "bar", { get: f1 });
|
|
|
|
g(x);
|
|
|
|
g(x);
|
|
|
|
var y = Object.defineProperty({}, "bar", { get: f2 });
|
|
|
|
g(y);
|
|
|
|
%OptimizeFunctionOnNextCall(g);
|
2019-06-12 14:00:50 +00:00
|
|
|
runNearStackLimit(function() {
|
|
|
|
g(y);
|
|
|
|
});
|