2017-06-22 15:43:35 +00:00
|
|
|
// Copyright 2017 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 A = {};
|
2017-06-22 15:43:35 +00:00
|
|
|
|
|
|
|
A[Symbol.hasInstance] = function(x) {
|
|
|
|
%DeoptimizeFunction(foo);
|
|
|
|
return 1;
|
2019-06-12 14:00:50 +00:00
|
|
|
};
|
2017-06-22 15:43:35 +00:00
|
|
|
|
2019-06-12 14:00:50 +00:00
|
|
|
var a = {};
|
2017-06-22 15:43:35 +00:00
|
|
|
|
|
|
|
function foo(o) {
|
|
|
|
return o instanceof A;
|
2019-06-12 14:00:50 +00:00
|
|
|
};
|
|
|
|
%PrepareFunctionForOptimization(foo);
|
2017-06-22 15:43:35 +00:00
|
|
|
foo(a);
|
|
|
|
foo(a);
|
|
|
|
assertTrue(foo(a) !== 1);
|
|
|
|
%OptimizeFunctionOnNextCall(foo);
|
|
|
|
assertTrue(foo(a) !== 1);
|