1 // Copyright 2015 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.
5 // Flags: --allow-natives-syntax
17 var deopt = { toString : function() {
18 %DeoptimizeFunction(f);
23 var o = { toString : function() {
29 assertEquals(1, f(deopt, o));
30 assertEquals(2, counter);
32 %OptimizeFunctionOnNextCall(f);
34 assertEquals(-1, f(o, deopt));
35 assertEquals(2, counter);
37 %OptimizeFunctionOnNextCall(f);
39 assertEquals(0, f(deopt, deopt));
40 assertEquals(2, counter);