Index: src/mips/lithium-mips.cc |
diff --git a/src/mips/lithium-mips.cc b/src/mips/lithium-mips.cc |
index 0b6dcaea51eeef24192f5573750a2749d2a27258..90841ecc75d5ab2c6ce01a51516b2fe9029459da 100644 |
--- a/src/mips/lithium-mips.cc |
+++ b/src/mips/lithium-mips.cc |
@@ -372,7 +372,7 @@ void LStoreNamedGeneric::PrintDataTo(StringStream* stream) { |
} |
-void LStoreKeyedFastElement::PrintDataTo(StringStream* stream) { |
+void LStoreKeyed::PrintDataTo(StringStream* stream) { |
object()->PrintTo(stream); |
stream->Add("["); |
key()->PrintTo(stream); |
@@ -381,30 +381,6 @@ void LStoreKeyedFastElement::PrintDataTo(StringStream* stream) { |
} |
-void LStoreKeyedFastDoubleElement::PrintDataTo(StringStream* stream) { |
- elements()->PrintTo(stream); |
- stream->Add("["); |
- key()->PrintTo(stream); |
- stream->Add("] <- "); |
- value()->PrintTo(stream); |
-} |
- |
- |
-void LStoreKeyedGeneric::PrintDataTo(StringStream* stream) { |
- object()->PrintTo(stream); |
- stream->Add("["); |
- key()->PrintTo(stream); |
- stream->Add("] <- "); |
- value()->PrintTo(stream); |
-} |
- |
- |
-void LTransitionElementsKind::PrintDataTo(StringStream* stream) { |
- object()->PrintTo(stream); |
- stream->Add(" %p -> %p", *original_map(), *transitioned_map()); |
-} |
- |
- |
int LPlatformChunk::GetNextSpillIndex(bool is_double) { |
// Skip a slot if for a double-width slot. |
if (is_double) spill_slot_count_++; |
@@ -1800,34 +1776,26 @@ LInstruction* LChunkBuilder::DoLoadExternalArrayPointer( |
} |
-LInstruction* LChunkBuilder::DoLoadKeyedFastElement( |
- HLoadKeyedFastElement* instr) { |
- ASSERT(instr->representation().IsTagged()); |
+LInstruction* LChunkBuilder::DoLoadKeyed( |
+ HLoadKeyed* instr) { |
ASSERT(instr->key()->representation().IsInteger32() || |
instr->key()->representation().IsTagged()); |
- LOperand* obj = UseRegisterAtStart(instr->object()); |
- LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
- LLoadKeyedFastElement* result = new(zone()) LLoadKeyedFastElement(obj, key); |
- if (instr->RequiresHoleCheck()) AssignEnvironment(result); |
- return DefineAsRegister(result); |
-} |
+ if (!instr->is_external()) { |
+ LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
+ LOperand* obj = NULL; |
+ if (instr->representation.IsDouble()) { |
+ obj = UseTempRegister(instr->object()); |
+ } else { |
+ ASSERT(instr->representation().IsTagged()); |
+ obj = UseRegisterAtStart(instr->object()); |
+ } |
-LInstruction* LChunkBuilder::DoLoadKeyedFastDoubleElement( |
- HLoadKeyedFastDoubleElement* instr) { |
- ASSERT(instr->representation().IsDouble()); |
- ASSERT(instr->key()->representation().IsInteger32() || |
- instr->key()->representation().IsTagged()); |
- LOperand* elements = UseTempRegister(instr->elements()); |
- LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
- LLoadKeyedFastDoubleElement* result = |
- new(zone()) LLoadKeyedFastDoubleElement(elements, key); |
- return AssignEnvironment(DefineAsRegister(result)); |
-} |
- |
+ LLoadKeyed* result = new(zone()) LLoadKeyed(obj, key); |
+ if (instr->RequiresHoleCheck()) AssignEnvironment(result); |
+ return DefineAsRegister(result); |
+ } |
-LInstruction* LChunkBuilder::DoLoadKeyedSpecializedArrayElement( |
- HLoadKeyedSpecializedArrayElement* instr) { |
ElementsKind elements_kind = instr->elements_kind(); |
ASSERT( |
(instr->representation().IsInteger32() && |
@@ -1836,12 +1804,9 @@ LInstruction* LChunkBuilder::DoLoadKeyedSpecializedArrayElement( |
(instr->representation().IsDouble() && |
((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || |
(elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); |
- ASSERT(instr->key()->representation().IsInteger32() || |
- instr->key()->representation().IsTagged()); |
LOperand* external_pointer = UseRegister(instr->external_pointer()); |
LOperand* key = UseRegisterOrConstant(instr->key()); |
- LLoadKeyedSpecializedArrayElement* result = |
- new(zone()) LLoadKeyedSpecializedArrayElement(external_pointer, key); |
+ LLoadKeyed* result = new(zone()) LLoadKeyed(external_pointer, key); |
LInstruction* load_instr = DefineAsRegister(result); |
// An unsigned int array load might overflow and cause a deopt, make sure it |
// has an environment. |
@@ -1860,66 +1825,55 @@ LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { |
} |
-LInstruction* LChunkBuilder::DoStoreKeyedFastElement( |
- HStoreKeyedFastElement* instr) { |
- bool needs_write_barrier = instr->NeedsWriteBarrier(); |
- ASSERT(instr->value()->representation().IsTagged()); |
- ASSERT(instr->object()->representation().IsTagged()); |
- ASSERT(instr->key()->representation().IsInteger32() || |
- instr->key()->representation().IsTagged()); |
- |
- LOperand* obj = UseTempRegister(instr->object()); |
- LOperand* val = needs_write_barrier |
- ? UseTempRegister(instr->value()) |
- : UseRegisterAtStart(instr->value()); |
- LOperand* key = needs_write_barrier |
- ? UseTempRegister(instr->key()) |
- : UseRegisterOrConstantAtStart(instr->key()); |
- return new(zone()) LStoreKeyedFastElement(obj, key, val); |
-} |
- |
- |
-LInstruction* LChunkBuilder::DoStoreKeyedFastDoubleElement( |
- HStoreKeyedFastDoubleElement* instr) { |
- ASSERT(instr->value()->representation().IsDouble()); |
- ASSERT(instr->elements()->representation().IsTagged()); |
+LInstruction* LChunkBuilder::DoStoreKeyed( |
+ HStoreKeyed* instr) { |
ASSERT(instr->key()->representation().IsInteger32() || |
instr->key()->representation().IsTagged()); |
- LOperand* elements = UseRegisterAtStart(instr->elements()); |
- LOperand* val = UseTempRegister(instr->value()); |
- LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
- |
- return new(zone()) LStoreKeyedFastDoubleElement(elements, key, val); |
-} |
+ if (!instr->is_external()) { |
+ ASSERT(instr->object()->representation().IsTagged()); |
+ if (instr->value()->representation().IsDouble()) { |
+ LOperand* object = UseRegisterAtStart(instr->object()); |
+ LOperand* val = UseTempRegister(instr->value()); |
+ LOperand* key = UseRegisterOrConstantAtStart(instr->key()); |
-LInstruction* LChunkBuilder::DoStoreKeyedSpecializedArrayElement( |
- HStoreKeyedSpecializedArrayElement* instr) { |
- ElementsKind elements_kind = instr->elements_kind(); |
- ASSERT( |
- (instr->value()->representation().IsInteger32() && |
- (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && |
- (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || |
- (instr->value()->representation().IsDouble() && |
- ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || |
- (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); |
- ASSERT(instr->external_pointer()->representation().IsExternal()); |
- ASSERT(instr->key()->representation().IsInteger32() || |
- instr->key()->representation().IsTagged()); |
- |
- LOperand* external_pointer = UseRegister(instr->external_pointer()); |
- bool val_is_temp_register = |
- elements_kind == EXTERNAL_PIXEL_ELEMENTS || |
- elements_kind == EXTERNAL_FLOAT_ELEMENTS; |
- LOperand* val = val_is_temp_register |
- ? UseTempRegister(instr->value()) |
- : UseRegister(instr->value()); |
- LOperand* key = UseRegisterOrConstant(instr->key()); |
- |
- return new(zone()) LStoreKeyedSpecializedArrayElement(external_pointer, |
- key, |
- val); |
+ return new(zone()) LStoreKeyed(object, key, val); |
+ } else { |
+ bool needs_write_barrier = instr->NeedsWriteBarrier(); |
+ ASSERT(instr->value()->representation().IsTagged()); |
+ |
+ LOperand* obj = UseTempRegister(instr->object()); |
+ LOperand* val = needs_write_barrier |
+ ? UseTempRegister(instr->value()) |
+ : UseRegisterAtStart(instr->value()); |
+ LOperand* key = needs_write_barrier |
+ ? UseTempRegister(instr->key()) |
+ : UseRegisterOrConstantAtStart(instr->key()); |
+ return new(zone()) LStoreKeyed(obj, key, val); |
+ } |
+ } else { |
+ ElementsKind elements_kind = instr->elements_kind(); |
+ ASSERT( |
+ (instr->value()->representation().IsInteger32() && |
+ (elements_kind != EXTERNAL_FLOAT_ELEMENTS) && |
+ (elements_kind != EXTERNAL_DOUBLE_ELEMENTS)) || |
+ (instr->value()->representation().IsDouble() && |
+ ((elements_kind == EXTERNAL_FLOAT_ELEMENTS) || |
+ (elements_kind == EXTERNAL_DOUBLE_ELEMENTS)))); |
+ ASSERT(instr->external_pointer()->representation().IsExternal()); |
+ |
+ LOperand* external_pointer = UseRegister(instr->external_pointer()); |
+ bool val_is_temp_register = |
+ elements_kind == EXTERNAL_PIXEL_ELEMENTS || |
+ elements_kind == EXTERNAL_FLOAT_ELEMENTS; |
+ LOperand* val = val_is_temp_register |
+ ? UseTempRegister(instr->value()) |
+ : UseRegister(instr->value()); |
+ LOperand* key = UseRegisterOrConstant(instr->key()); |
+ |
+ return new(zone()) LStoreKeyed(external_pointer, key, val); |
+ } |
} |