Chromium Code Reviews| Index: src/x64/lithium-codegen-x64.cc |
| diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
| index 72091c3e4d371e6258e83317f2177b306c25cab3..1ce1657b3c4b3e2fa56fbb2ce76946937f768dd7 100644 |
| --- a/src/x64/lithium-codegen-x64.cc |
| +++ b/src/x64/lithium-codegen-x64.cc |
| @@ -273,6 +273,14 @@ void LCodeGen::GenerateOsrPrologue() { |
| } |
| +void LCodeGen::GenerateBodyInstructionPost(LInstruction* instr) { |
| + if (instr->HasResult() && instr->MustSignExtendResult(chunk())) { |
| + Register result_reg = ToRegister(instr->result()); |
| + __ movsxlq(result_reg, result_reg); |
|
danno
2014/03/19 09:16:43
I think it is possible for results to be allocated
Weiliang
2014/03/19 11:41:04
Done.
|
| + } |
| +} |
| + |
| + |
| bool LCodeGen::GenerateJumpTable() { |
| Label needs_frame; |
| if (jump_table_.length() > 0) { |
| @@ -404,6 +412,12 @@ bool LCodeGen::IsInteger32Constant(LConstantOperand* op) const { |
| } |
| +bool LCodeGen::IsDehoistedKeyConstant(LConstantOperand* op) const { |
| + return op->IsConstantOperand() && |
| + chunk_->IsDehoistedKey(chunk_->LookupConstant(op)); |
| +} |
| + |
| + |
| bool LCodeGen::IsSmiConstant(LConstantOperand* op) const { |
| return op->IsConstantOperand() && |
| chunk_->LookupLiteralRepresentation(op).IsSmi(); |
| @@ -2868,19 +2882,6 @@ void LCodeGen::DoAccessArgumentsAt(LAccessArgumentsAt* instr) { |
| void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) { |
| ElementsKind elements_kind = instr->elements_kind(); |
| LOperand* key = instr->key(); |
| - if (!key->IsConstantOperand()) { |
| - Register key_reg = ToRegister(key); |
| - // Even though the HLoad/StoreKeyed (in this case) instructions force |
| - // the input representation for the key to be an integer, the input |
| - // gets replaced during bound check elimination with the index argument |
| - // to the bounds check, which can be tagged, so that case must be |
| - // handled here, too. |
| - if (instr->hydrogen()->IsDehoisted()) { |
| - // Sign extend key because it could be a 32 bit negative value |
| - // and the dehoisted address computation happens in 64 bits |
| - __ movsxlq(key_reg, key_reg); |
| - } |
| - } |
| int base_offset = instr->is_fixed_typed_array() |
| ? FixedTypedArrayBase::kDataOffset - kHeapObjectTag |
| : 0; |
| @@ -2954,19 +2955,6 @@ void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) { |
| void LCodeGen::DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr) { |
| XMMRegister result(ToDoubleRegister(instr->result())); |
| LOperand* key = instr->key(); |
| - if (!key->IsConstantOperand()) { |
| - Register key_reg = ToRegister(key); |
| - // Even though the HLoad/StoreKeyed instructions force the input |
| - // representation for the key to be an integer, the input gets replaced |
| - // during bound check elimination with the index argument to the bounds |
| - // check, which can be tagged, so that case must be handled here, too. |
| - if (instr->hydrogen()->IsDehoisted()) { |
| - // Sign extend key because it could be a 32 bit negative value |
| - // and the dehoisted address computation happens in 64 bits |
| - __ movsxlq(key_reg, key_reg); |
| - } |
| - } |
| - |
| if (instr->hydrogen()->RequiresHoleCheck()) { |
| int offset = FixedDoubleArray::kHeaderSize - kHeapObjectTag + |
| sizeof(kHoleNanLower32); |
| @@ -2994,20 +2982,6 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) { |
| HLoadKeyed* hinstr = instr->hydrogen(); |
| Register result = ToRegister(instr->result()); |
| LOperand* key = instr->key(); |
| - if (!key->IsConstantOperand()) { |
| - Register key_reg = ToRegister(key); |
| - // Even though the HLoad/StoreKeyedFastElement instructions force |
| - // the input representation for the key to be an integer, the input |
| - // gets replaced during bound check elimination with the index |
| - // argument to the bounds check, which can be tagged, so that |
| - // case must be handled here, too. |
| - if (hinstr->IsDehoisted()) { |
| - // Sign extend key because it could be a 32 bit negative value |
| - // and the dehoisted address computation happens in 64 bits |
| - __ movsxlq(key_reg, key_reg); |
| - } |
| - } |
| - |
| bool requires_hole_check = hinstr->RequiresHoleCheck(); |
| int offset = FixedArray::kHeaderSize - kHeapObjectTag; |
| Representation representation = hinstr->representation(); |
| @@ -4039,7 +4013,8 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
| } |
| } else { |
| Register reg2 = ToRegister(instr->index()); |
| - if (!instr->hydrogen()->index()->representation().IsSmi()) { |
| + if (!instr->hydrogen()->index()->representation().IsSmi() && |
| + !chunk()->IsDehoistedKey(instr->hydrogen()->index())) { |
| __ AssertZeroExtended(reg2); |
| } |
| __ cmpq(reg, reg2); |
| @@ -4067,19 +4042,6 @@ void LCodeGen::DoBoundsCheck(LBoundsCheck* instr) { |
| void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { |
| ElementsKind elements_kind = instr->elements_kind(); |
| LOperand* key = instr->key(); |
| - if (!key->IsConstantOperand()) { |
| - Register key_reg = ToRegister(key); |
| - // Even though the HLoad/StoreKeyedFastElement instructions force |
| - // the input representation for the key to be an integer, the input |
| - // gets replaced during bound check elimination with the index |
| - // argument to the bounds check, which can be tagged, so that case |
| - // must be handled here, too. |
| - if (instr->hydrogen()->IsDehoisted()) { |
| - // Sign extend key because it could be a 32 bit negative value |
| - // and the dehoisted address computation happens in 64 bits |
| - __ movsxlq(key_reg, key_reg); |
| - } |
| - } |
| int base_offset = instr->is_fixed_typed_array() |
| ? FixedTypedArrayBase::kDataOffset - kHeapObjectTag |
| : 0; |
| @@ -4143,20 +4105,6 @@ void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { |
| void LCodeGen::DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr) { |
| XMMRegister value = ToDoubleRegister(instr->value()); |
| LOperand* key = instr->key(); |
| - if (!key->IsConstantOperand()) { |
| - Register key_reg = ToRegister(key); |
| - // Even though the HLoad/StoreKeyedFastElement instructions force |
| - // the input representation for the key to be an integer, the |
| - // input gets replaced during bound check elimination with the index |
| - // argument to the bounds check, which can be tagged, so that case |
| - // must be handled here, too. |
| - if (instr->hydrogen()->IsDehoisted()) { |
| - // Sign extend key because it could be a 32 bit negative value |
| - // and the dehoisted address computation happens in 64 bits |
| - __ movsxlq(key_reg, key_reg); |
| - } |
| - } |
| - |
| if (instr->NeedsCanonicalization()) { |
| Label have_value; |
| @@ -4184,20 +4132,6 @@ void LCodeGen::DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr) { |
| void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) { |
| HStoreKeyed* hinstr = instr->hydrogen(); |
| LOperand* key = instr->key(); |
| - if (!key->IsConstantOperand()) { |
| - Register key_reg = ToRegister(key); |
| - // Even though the HLoad/StoreKeyedFastElement instructions force |
| - // the input representation for the key to be an integer, the |
| - // input gets replaced during bound check elimination with the index |
| - // argument to the bounds check, which can be tagged, so that case |
| - // must be handled here, too. |
| - if (hinstr->IsDehoisted()) { |
| - // Sign extend key because it could be a 32 bit negative value |
| - // and the dehoisted address computation happens in 64 bits |
| - __ movsxlq(key_reg, key_reg); |
| - } |
| - } |
| - |
| int offset = FixedArray::kHeaderSize - kHeapObjectTag; |
| Representation representation = hinstr->value()->representation(); |