Index: src/mips/macro-assembler-mips.cc |
diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc |
index 6cd5e97f62a61252299cbddd4755dff7e8fedccb..2c2445b4c78dce6810639eac3b1c14b521b435b8 100644 |
--- a/src/mips/macro-assembler-mips.cc |
+++ b/src/mips/macro-assembler-mips.cc |
@@ -3341,39 +3341,33 @@ void MacroAssembler::InitializeFieldsWithFiller(Register start_offset, |
void MacroAssembler::CheckFastElements(Register map, |
Register scratch, |
Label* fail) { |
- STATIC_ASSERT(FAST_SMI_ELEMENTS == 0); |
- STATIC_ASSERT(FAST_HOLEY_SMI_ELEMENTS == 1); |
- STATIC_ASSERT(FAST_ELEMENTS == 2); |
- STATIC_ASSERT(FAST_HOLEY_ELEMENTS == 3); |
+ STATIC_ASSERT(FAST_SMI_ONLY_ELEMENTS == 0); |
+ STATIC_ASSERT(FAST_ELEMENTS == 1); |
lbu(scratch, FieldMemOperand(map, Map::kBitField2Offset)); |
- Branch(fail, hi, scratch, |
- Operand(Map::kMaximumBitField2FastHoleyElementValue)); |
+ Branch(fail, hi, scratch, Operand(Map::kMaximumBitField2FastElementValue)); |
} |
void MacroAssembler::CheckFastObjectElements(Register map, |
Register scratch, |
Label* fail) { |
- STATIC_ASSERT(FAST_SMI_ELEMENTS == 0); |
- STATIC_ASSERT(FAST_HOLEY_SMI_ELEMENTS == 1); |
- STATIC_ASSERT(FAST_ELEMENTS == 2); |
- STATIC_ASSERT(FAST_HOLEY_ELEMENTS == 3); |
+ STATIC_ASSERT(FAST_SMI_ONLY_ELEMENTS == 0); |
+ STATIC_ASSERT(FAST_ELEMENTS == 1); |
lbu(scratch, FieldMemOperand(map, Map::kBitField2Offset)); |
Branch(fail, ls, scratch, |
- Operand(Map::kMaximumBitField2FastHoleySmiElementValue)); |
+ Operand(Map::kMaximumBitField2FastSmiOnlyElementValue)); |
Branch(fail, hi, scratch, |
- Operand(Map::kMaximumBitField2FastHoleyElementValue)); |
+ Operand(Map::kMaximumBitField2FastElementValue)); |
} |
-void MacroAssembler::CheckFastSmiElements(Register map, |
- Register scratch, |
- Label* fail) { |
- STATIC_ASSERT(FAST_SMI_ELEMENTS == 0); |
- STATIC_ASSERT(FAST_HOLEY_SMI_ELEMENTS == 1); |
+void MacroAssembler::CheckFastSmiOnlyElements(Register map, |
+ Register scratch, |
+ Label* fail) { |
+ STATIC_ASSERT(FAST_SMI_ONLY_ELEMENTS == 0); |
lbu(scratch, FieldMemOperand(map, Map::kBitField2Offset)); |
Branch(fail, hi, scratch, |
- Operand(Map::kMaximumBitField2FastHoleySmiElementValue)); |
+ Operand(Map::kMaximumBitField2FastSmiOnlyElementValue)); |
} |
@@ -3475,17 +3469,22 @@ void MacroAssembler::CompareMapAndBranch(Register obj, |
lw(scratch, FieldMemOperand(obj, HeapObject::kMapOffset)); |
Operand right = Operand(map); |
if (mode == ALLOW_ELEMENT_TRANSITION_MAPS) { |
- ElementsKind kind = map->elements_kind(); |
- if (IsFastElementsKind(kind)) { |
- bool packed = IsFastPackedElementsKind(kind); |
- Map* current_map = *map; |
- while (CanTransitionToMoreGeneralFastElementsKind(kind, packed)) { |
- kind = GetNextMoreGeneralFastElementsKind(kind, packed); |
- current_map = current_map->LookupElementsTransitionMap(kind, NULL); |
- if (!current_map) break; |
- Branch(early_success, eq, scratch, right); |
- right = Operand(Handle<Map>(current_map)); |
- } |
+ Map* transitioned_fast_element_map( |
+ map->LookupElementsTransitionMap(FAST_ELEMENTS, NULL)); |
+ ASSERT(transitioned_fast_element_map == NULL || |
+ map->elements_kind() != FAST_ELEMENTS); |
+ if (transitioned_fast_element_map != NULL) { |
+ Branch(early_success, eq, scratch, right); |
+ right = Operand(Handle<Map>(transitioned_fast_element_map)); |
+ } |
+ |
+ Map* transitioned_double_map( |
+ map->LookupElementsTransitionMap(FAST_DOUBLE_ELEMENTS, NULL)); |
+ ASSERT(transitioned_double_map == NULL || |
+ map->elements_kind() == FAST_SMI_ONLY_ELEMENTS); |
+ if (transitioned_double_map != NULL) { |
+ Branch(early_success, eq, scratch, right); |
+ right = Operand(Handle<Map>(transitioned_double_map)); |
} |
} |
@@ -4444,37 +4443,27 @@ void MacroAssembler::LoadTransitionedArrayMapConditional( |
lw(scratch, FieldMemOperand(scratch, GlobalObject::kGlobalContextOffset)); |
// Check that the function's map is the same as the expected cached map. |
- lw(scratch, |
- MemOperand(scratch, |
- Context::SlotOffset(Context::JS_ARRAY_MAPS_INDEX))); |
- size_t offset = expected_kind * kPointerSize + |
- FixedArrayBase::kHeaderSize; |
- Branch(no_map_match, ne, map_in_out, Operand(scratch)); |
+ int expected_index = |
+ Context::GetContextMapIndexFromElementsKind(expected_kind); |
+ lw(at, MemOperand(scratch, Context::SlotOffset(expected_index))); |
+ Branch(no_map_match, ne, map_in_out, Operand(at)); |
// Use the transitioned cached map. |
- offset = transitioned_kind * kPointerSize + |
- FixedArrayBase::kHeaderSize; |
- lw(map_in_out, FieldMemOperand(scratch, offset)); |
+ int trans_index = |
+ Context::GetContextMapIndexFromElementsKind(transitioned_kind); |
+ lw(map_in_out, MemOperand(scratch, Context::SlotOffset(trans_index))); |
} |
void MacroAssembler::LoadInitialArrayMap( |
- Register function_in, Register scratch, |
- Register map_out, bool can_have_holes) { |
+ Register function_in, Register scratch, Register map_out) { |
ASSERT(!function_in.is(map_out)); |
Label done; |
lw(map_out, FieldMemOperand(function_in, |
JSFunction::kPrototypeOrInitialMapOffset)); |
if (!FLAG_smi_only_arrays) { |
- ElementsKind kind = can_have_holes ? FAST_HOLEY_ELEMENTS : FAST_ELEMENTS; |
- LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, |
- kind, |
- map_out, |
- scratch, |
- &done); |
- } else if (can_have_holes) { |
- LoadTransitionedArrayMapConditional(FAST_SMI_ELEMENTS, |
- FAST_HOLEY_SMI_ELEMENTS, |
+ LoadTransitionedArrayMapConditional(FAST_SMI_ONLY_ELEMENTS, |
+ FAST_ELEMENTS, |
map_out, |
scratch, |
&done); |