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 --expose-gc | 6 // Flags: --expose-gc |
7 | 7 |
8 function Ctor() { | 8 function Ctor() { |
9 this.a = 1; | 9 this.a = 1; |
10 } | 10 } |
11 | 11 |
12 function get_closure() { | 12 function get_closure() { |
13 return function add_field(obj) { | 13 return function add_field(obj) { |
14 obj.c = 3; | 14 obj.c = 3; |
15 obj.a = obj.a + obj.c; | 15 obj.a = obj.a + obj.c; |
16 return obj.a; | 16 return obj.a; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 | 57 |
58 // Kill add_field in new space GC. | 58 // Kill add_field in new space GC. |
59 for(var i = 0; i < 3; i++) gc(true); | 59 for(var i = 0; i < 3; i++) gc(true); |
60 | 60 |
61 // Trigger deopt. | 61 // Trigger deopt. |
62 o.c = 2.2; | 62 o.c = 2.2; |
63 | 63 |
64 // Fetch optimized code of add_field from cache and crash. | 64 // Fetch optimized code of add_field from cache and crash. |
65 var f2 = get_closure(); | 65 var f2 = get_closure(); |
66 f2(new Ctor()); | 66 f2(new Ctor()); |
OLD | NEW |