Chromium Code Reviews| Index: src/compiler/code-generator.cc |
| diff --git a/src/compiler/code-generator.cc b/src/compiler/code-generator.cc |
| index 4513c248fc8f886cbe22f2bac4700cc297f5d0ad..4b29e05a20f7abc85390f975ae15f15ad1b0b17e 100644 |
| --- a/src/compiler/code-generator.cc |
| +++ b/src/compiler/code-generator.cc |
| @@ -820,7 +820,9 @@ void CodeGenerator::AddTranslationForOperand(Translation* translation, |
| } else if (type == MachineType::Uint8() || type == MachineType::Uint16() || |
| type == MachineType::Uint32()) { |
| translation->StoreUint32StackSlot(LocationOperand::cast(op)->index()); |
| - } else if (type.representation() == MachineRepresentation::kTagged) { |
| + } else if (type.representation() == MachineRepresentation::kTagged || |
| + type.representation() == MachineRepresentation::kTaggedSigned || |
| + type.representation() == MachineRepresentation::kTaggedPointer) { |
|
mvstanton
2016/08/29 12:02:10
Introduced helper function for these cases, IsAnyT
|
| translation->StoreStackSlot(LocationOperand::cast(op)->index()); |
| } else { |
| CHECK(false); |
| @@ -842,7 +844,9 @@ void CodeGenerator::AddTranslationForOperand(Translation* translation, |
| } else if (type == MachineType::Uint8() || type == MachineType::Uint16() || |
| type == MachineType::Uint32()) { |
| translation->StoreUint32Register(converter.ToRegister(op)); |
| - } else if (type.representation() == MachineRepresentation::kTagged) { |
| + } else if (type.representation() == MachineRepresentation::kTagged || |
| + type.representation() == MachineRepresentation::kTaggedSigned || |
| + type.representation() == MachineRepresentation::kTaggedPointer) { |
| translation->StoreRegister(converter.ToRegister(op)); |
| } else { |
| CHECK(false); |
| @@ -861,7 +865,8 @@ void CodeGenerator::AddTranslationForOperand(Translation* translation, |
| Handle<Object> constant_object; |
| switch (constant.type()) { |
| case Constant::kInt32: |
| - if (type.representation() == MachineRepresentation::kTagged) { |
| + if (type.representation() == MachineRepresentation::kTagged || |
| + type.representation() == MachineRepresentation::kTaggedSigned) { |
| // When pointers are 4 bytes, we can use int32 constants to represent |
| // Smis. |
| DCHECK_EQ(4, kPointerSize); |
| @@ -883,7 +888,8 @@ void CodeGenerator::AddTranslationForOperand(Translation* translation, |
| case Constant::kInt64: |
| // When pointers are 8 bytes, we can use int64 constants to represent |
| // Smis. |
| - DCHECK_EQ(type.representation(), MachineRepresentation::kTagged); |
| + DCHECK(type.representation() == MachineRepresentation::kTagged || |
| + type.representation() == MachineRepresentation::kTaggedSigned); |
| DCHECK_EQ(8, kPointerSize); |
| constant_object = |
| handle(reinterpret_cast<Smi*>(constant.ToInt64()), isolate()); |
| @@ -891,16 +897,19 @@ void CodeGenerator::AddTranslationForOperand(Translation* translation, |
| break; |
| case Constant::kFloat32: |
| DCHECK(type.representation() == MachineRepresentation::kFloat32 || |
| - type.representation() == MachineRepresentation::kTagged); |
| + type.representation() == MachineRepresentation::kTagged || |
| + type.representation() == MachineRepresentation::kTaggedPointer); |
| constant_object = isolate()->factory()->NewNumber(constant.ToFloat32()); |
| break; |
| case Constant::kFloat64: |
| DCHECK(type.representation() == MachineRepresentation::kFloat64 || |
| - type.representation() == MachineRepresentation::kTagged); |
| + type.representation() == MachineRepresentation::kTagged || |
| + type.representation() == MachineRepresentation::kTaggedPointer); |
| constant_object = isolate()->factory()->NewNumber(constant.ToFloat64()); |
| break; |
| case Constant::kHeapObject: |
| - DCHECK(type.representation() == MachineRepresentation::kTagged); |
| + DCHECK(type.representation() == MachineRepresentation::kTagged || |
| + type.representation() == MachineRepresentation::kTaggedPointer); |
| constant_object = constant.ToHeapObject(); |
| break; |
| default: |