2015-01-30 14:35:27 +00:00
|
|
|
// 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: --allow-natives-syntax
|
|
|
|
|
2019-06-12 14:00:50 +00:00
|
|
|
var o = {};
|
|
|
|
o.__defineGetter__('progressChanged', function() {
|
|
|
|
%DeoptimizeFunction(f);
|
|
|
|
return 10;
|
|
|
|
});
|
2015-01-30 14:35:27 +00:00
|
|
|
|
|
|
|
function g(a, b, c) {
|
|
|
|
return a + b + c;
|
|
|
|
}
|
|
|
|
|
|
|
|
function f() {
|
2019-06-12 14:00:50 +00:00
|
|
|
var t = 'progressChanged';
|
2015-01-30 14:35:27 +00:00
|
|
|
return g(1, o[t], 100);
|
2019-06-12 14:00:50 +00:00
|
|
|
};
|
|
|
|
%PrepareFunctionForOptimization(f);
|
2015-01-30 14:35:27 +00:00
|
|
|
f();
|
|
|
|
f();
|
|
|
|
%OptimizeFunctionOnNextCall(f);
|
|
|
|
assertEquals(111, f());
|