OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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. |
| 4 |
| 5 // Flags: --allow-natives-syntax |
| 6 |
| 7 (function() { |
| 8 function foo() { |
| 9 var a = foo.bind(this); |
| 10 %DeoptimizeNow(); |
| 11 if (!a) return a; |
| 12 return 0; |
| 13 } |
| 14 |
| 15 assertEquals(0, foo()); |
| 16 assertEquals(0, foo()); |
| 17 %OptimizeFunctionOnNextCall(foo); |
| 18 assertEquals(0, foo()); |
| 19 })(); |
| 20 |
| 21 (function() { |
| 22 "use strict"; |
| 23 |
| 24 function foo() { |
| 25 var a = foo.bind(this); |
| 26 %DeoptimizeNow(); |
| 27 if (!a) return a; |
| 28 return 0; |
| 29 } |
| 30 |
| 31 assertEquals(0, foo()); |
| 32 assertEquals(0, foo()); |
| 33 %OptimizeFunctionOnNextCall(foo); |
| 34 assertEquals(0, foo()); |
| 35 })(); |
| 36 |
| 37 (function() { |
| 38 function foo() { |
| 39 var a = foo.bind(this); |
| 40 %DeoptimizeNow(); |
| 41 if (!a) return a; |
| 42 return 0; |
| 43 } |
| 44 foo.prototype = {custom: "prototype"}; |
| 45 |
| 46 assertEquals(0, foo()); |
| 47 assertEquals(0, foo()); |
| 48 %OptimizeFunctionOnNextCall(foo); |
| 49 assertEquals(0, foo()); |
| 50 })(); |
| 51 |
| 52 (function() { |
| 53 "use strict"; |
| 54 |
| 55 function foo() { |
| 56 var a = foo.bind(this); |
| 57 %DeoptimizeNow(); |
| 58 if (!a) return a; |
| 59 return 0; |
| 60 } |
| 61 foo.prototype = {custom: "prototype"}; |
| 62 |
| 63 assertEquals(0, foo()); |
| 64 assertEquals(0, foo()); |
| 65 %OptimizeFunctionOnNextCall(foo); |
| 66 assertEquals(0, foo()); |
| 67 })(); |
OLD | NEW |