OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 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 | 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 --noalways-opt | 5 // Flags: --allow-natives-syntax --noalways-opt --no-vector-stores |
| 6 |
| 7 // We disable vector store ICs because slot indices change when this option |
| 8 // is enabled. |
6 | 9 |
7 // Locations in the type feedback vector where call counts are maintained for | 10 // Locations in the type feedback vector where call counts are maintained for |
8 // the two calls made from bar(); | 11 // the two calls made from bar(); |
9 | 12 |
10 (function() { | 13 (function() { |
11 const kFooCallExtraIndex = 5; | 14 const kFooCallExtraIndex = 5; |
12 const kArrayCallExtraIndex = 7; | 15 const kArrayCallExtraIndex = 7; |
13 | 16 |
14 function GetCallCount(func, slot) { | 17 function GetCallCount(func, slot) { |
15 var vector = %GetTypeFeedbackVector(func); | 18 var vector = %GetTypeFeedbackVector(func); |
(...skipping 18 matching lines...) Expand all Loading... |
34 } | 37 } |
35 | 38 |
36 var a = [1, 2, 3]; | 39 var a = [1, 2, 3]; |
37 bar(a); | 40 bar(a); |
38 assertEquals(10, GetCallCount(bar, kFooCallExtraIndex)); | 41 assertEquals(10, GetCallCount(bar, kFooCallExtraIndex)); |
39 assertEquals(5, GetCallCount(bar, kArrayCallExtraIndex)); | 42 assertEquals(5, GetCallCount(bar, kArrayCallExtraIndex)); |
40 | 43 |
41 %OptimizeFunctionOnNextCall(bar); | 44 %OptimizeFunctionOnNextCall(bar); |
42 bar(a); | 45 bar(a); |
43 })(); | 46 })(); |
OLD | NEW |