OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 // Flags: --allow-natives-syntax --block-concurrent-recompilation | |
6 | |
7 function Ctor() { | |
8 this.a = 1; | |
9 } | |
10 | |
11 function get_closure() { | |
12 return function add_field(obj, osr) { | |
13 obj.c = 3; | |
14 var x = 0; | |
15 if (osr) %OptimizeOsr(); | |
16 for (var i = 0; i < 10; i++) { | |
17 x = i + 1; | |
18 } | |
19 return x; | |
20 } | |
21 } | |
22 | |
23 var f1 = get_closure(); | |
24 f1(new Ctor(), false); | |
25 f1(new Ctor(), false); | |
26 | |
27 %OptimizeFunctionOnNextCall(f1, "concurrent"); | |
28 | |
29 // Kick off concurrent recompilation and OSR. | |
30 var o = new Ctor(); | |
31 f1(o, true); | |
32 | |
33 // Flush the optimizing compiler's queue. | |
34 %NotifyContextDisposed(); | |
35 | |
36 // Trigger deopt. | |
37 o.c = 2.2; | |
38 | |
39 var f2 = get_closure(); | |
40 f2(new Ctor(), true); | |
OLD | NEW |