Chromium Code Reviews| Index: src/hydrogen.cc |
| diff --git a/src/hydrogen.cc b/src/hydrogen.cc |
| index 82039faebf3bb32188d8ba1058b11d498e1046f2..d418629ea0597b964fd534c44f4f548ddd53330d 100644 |
| --- a/src/hydrogen.cc |
| +++ b/src/hydrogen.cc |
| @@ -3929,6 +3929,7 @@ HInstruction* HGraphBuilder::BuildExternalArrayElementAccess( |
| case EXTERNAL_FLOAT_ELEMENTS: |
| case EXTERNAL_DOUBLE_ELEMENTS: |
| break; |
| + case FAST_SMI_ONLY_ELEMENTS: |
| case FAST_ELEMENTS: |
| case FAST_DOUBLE_ELEMENTS: |
| case DICTIONARY_ELEMENTS: |
| @@ -4040,10 +4041,10 @@ HValue* HGraphBuilder::HandlePolymorphicElementAccess(HValue* object, |
| HLoadExternalArrayPointer* external_elements = NULL; |
| HInstruction* checked_key = NULL; |
| - // FAST_ELEMENTS is assumed to be the first case. |
| - STATIC_ASSERT(FAST_ELEMENTS == 0); |
| + // FAST_SMI_ONLY_ELEMENTS is assumed to be the first case. |
| + STATIC_ASSERT(FAST_SMI_ONLY_ELEMENTS == 0); |
| - for (ElementsKind elements_kind = FAST_ELEMENTS; |
| + for (ElementsKind elements_kind = FAST_SMI_ONLY_ELEMENTS; |
|
Rico
2011/09/16 09:40:10
Use FIRST_ELEMENTS_KIND instead and remove assert?
Jakob Kummerow
2011/09/16 16:30:34
The point is that fast elements are handled before
danno
2011/09/21 14:32:04
Done.
|
| elements_kind <= LAST_ELEMENTS_KIND; |
| elements_kind = ElementsKind(elements_kind + 1)) { |
| // After having handled FAST_ELEMENTS and DICTIONARY_ELEMENTS, we |
|
Jakob Kummerow
2011/09/16 16:30:34
Update this comment please (either "FAST_SMI_ONLY_
danno
2011/09/21 14:32:04
Done.
|
| @@ -4069,11 +4070,13 @@ HValue* HGraphBuilder::HandlePolymorphicElementAccess(HValue* object, |
| set_current_block(if_true); |
| HInstruction* access; |
| - if (elements_kind == FAST_ELEMENTS || |
| + if (elements_kind == FAST_SMI_ONLY_ELEMENTS || |
| + elements_kind == FAST_ELEMENTS || |
| elements_kind == FAST_DOUBLE_ELEMENTS) { |
| bool fast_double_elements = |
| elements_kind == FAST_DOUBLE_ELEMENTS; |
| - if (is_store && elements_kind == FAST_ELEMENTS) { |
| + if (is_store && (elements_kind == FAST_ELEMENTS || |
|
Rico
2011/09/16 09:40:10
is_store && !fast_double_elements ?
danno
2011/09/21 14:32:04
Done.
|
| + elements_kind == FAST_SMI_ONLY_ELEMENTS)) { |
| AddInstruction(new(zone()) HCheckMap( |
| elements, isolate()->factory()->fixed_array_map(), |
| elements_kind_branch)); |
| @@ -4097,8 +4100,11 @@ HValue* HGraphBuilder::HandlePolymorphicElementAccess(HValue* object, |
| checked_key, |
| val)); |
| } else { |
| + ASSERT(elements_kind != FAST_SMI_ONLY_ELEMENTS); |
|
Rico
2011/09/16 09:40:10
Why can't we end up here with FAST_SMI_ONLY_ELEMEN
danno
2011/09/21 14:32:04
Done.
|
| access = AddInstruction( |
| - new(zone()) HStoreKeyedFastElement(elements, checked_key, val)); |
| + new(zone()) HStoreKeyedFastElement(elements, |
|
Jakob Kummerow
2011/09/16 16:30:34
Why the line breaks?
danno
2011/09/21 14:32:04
Done.
|
| + checked_key, |
| + val)); |
| } |
| } else { |
| if (fast_double_elements) { |