OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
141 assertKind(elements_kind.fast_double, obj); | 141 assertKind(elements_kind.fast_double, obj); |
142 | 142 |
143 // The test below is in a loop because arrays that live | 143 // The test below is in a loop because arrays that live |
144 // at global scope without the chance of being recreated | 144 // at global scope without the chance of being recreated |
145 // don't have allocation site information attached. | 145 // don't have allocation site information attached. |
146 for (i = 0; i < 2; i++) { | 146 for (i = 0; i < 2; i++) { |
147 obj = fastliteralcase([5, 3, 2], 1.5); | 147 obj = fastliteralcase([5, 3, 2], 1.5); |
148 assertKind(elements_kind.fast_double, obj); | 148 assertKind(elements_kind.fast_double, obj); |
149 obj = fastliteralcase([3, 6, 2], 1.5); | 149 obj = fastliteralcase([3, 6, 2], 1.5); |
150 assertKind(elements_kind.fast_double, obj); | 150 assertKind(elements_kind.fast_double, obj); |
151 | |
152 // Note: thanks to pessimistic transition store stubs, we'll attempt | |
153 // to transition to the most general elements kind seen at a particular stor e | |
Benedikt Meurer
2013/10/15 12:06:05
Nit: 80-char limit.
mvstanton
2013/10/15 12:41:53
Done.
| |
154 // site. So, the elements kind will be double. | |
151 obj = fastliteralcase([2, 6, 3], 2); | 155 obj = fastliteralcase([2, 6, 3], 2); |
152 assertKind(elements_kind.fast_smi_only, obj); | 156 assertKind(elements_kind.fast_double, obj); |
153 } | 157 } |
154 | 158 |
155 // Verify that we will not pretransition the double->fast path. | 159 // Verify that we will not pretransition the double->fast path. |
156 obj = fastliteralcase(get_standard_literal(), "elliot"); | 160 obj = fastliteralcase(get_standard_literal(), "elliot"); |
157 assertKind(elements_kind.fast, obj); | 161 assertKind(elements_kind.fast, obj); |
158 obj = fastliteralcase(get_standard_literal(), 3); | 162 obj = fastliteralcase(get_standard_literal(), 3); |
159 assertKind(elements_kind.fast, obj); | 163 assertKind(elements_kind.fast, obj); |
160 | 164 |
161 // Make sure this works in crankshafted code too. | 165 // Make sure this works in crankshafted code too. |
162 %OptimizeFunctionOnNextCall(get_standard_literal); | 166 %OptimizeFunctionOnNextCall(get_standard_literal); |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
373 %ClearFunctionTypeFeedback(instanceof_check); | 377 %ClearFunctionTypeFeedback(instanceof_check); |
374 instanceof_check(Array); | 378 instanceof_check(Array); |
375 instanceof_check(Array); | 379 instanceof_check(Array); |
376 %OptimizeFunctionOnNextCall(instanceof_check); | 380 %OptimizeFunctionOnNextCall(instanceof_check); |
377 instanceof_check(Array); | 381 instanceof_check(Array); |
378 assertOptimized(instanceof_check); | 382 assertOptimized(instanceof_check); |
379 | 383 |
380 instanceof_check(realmBArray); | 384 instanceof_check(realmBArray); |
381 assertUnoptimized(instanceof_check); | 385 assertUnoptimized(instanceof_check); |
382 } | 386 } |
OLD | NEW |