| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Flags: --allow-natives-syntax --block-concurrent-recompilation | 5 // Flags: --allow-natives-syntax --block-concurrent-recompilation |
| 6 // Flags: --no-concurrent-osr | 6 // Flags: --no-concurrent-osr |
| 7 | 7 |
| 8 // This test assumes concurrent recompilation is enabled |
| 9 if (%IsConcurrentRecompilationSupported()) { |
| 8 function Ctor() { | 10 function Ctor() { |
| 9 this.a = 1; | 11 this.a = 1; |
| 10 } | 12 } |
| 11 | 13 |
| 12 function get_closure() { | 14 function get_closure() { |
| 13 return function add_field(obj, osr) { | 15 return function add_field(obj, osr) { |
| 14 obj.c = 3; | 16 obj.c = 3; |
| 15 var x = 0; | 17 var x = 0; |
| 16 if (osr) { | 18 if (osr) { |
| 17 %OptimizeFunctionOnNextCall(add_field, "osr"); | 19 %OptimizeFunctionOnNextCall(add_field, "osr"); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 36 | 38 |
| 37 // Flush the optimizing compiler's queue. | 39 // Flush the optimizing compiler's queue. |
| 38 %NotifyContextDisposed(); | 40 %NotifyContextDisposed(); |
| 39 assertUnoptimized(f1, "no sync"); | 41 assertUnoptimized(f1, "no sync"); |
| 40 | 42 |
| 41 // Trigger deopt. | 43 // Trigger deopt. |
| 42 o.c = 2.2; | 44 o.c = 2.2; |
| 43 | 45 |
| 44 var f2 = get_closure(); | 46 var f2 = get_closure(); |
| 45 f2(new Ctor(), true); | 47 f2(new Ctor(), true); |
| 48 } |
| OLD | NEW |