Index: src/x64/lithium-codegen-x64.cc |
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc |
index 5849cf4ef910d6573c75dd7b4858a964e75192b9..da0dbd7cf7d1e4c6198a5589129c1b8de342d028 100644 |
--- a/src/x64/lithium-codegen-x64.cc |
+++ b/src/x64/lithium-codegen-x64.cc |
@@ -283,6 +283,22 @@ void LCodeGen::GenerateBodyInstructionPre(LInstruction* instr) { |
} |
+void LCodeGen::GenerateBodyInstructionPost(LInstruction* instr) { |
+ if (instr->HasResult() && instr->MustSignExtendResult(chunk())) { |
+ if (instr->result()->IsRegister()) { |
+ Register result_reg = ToRegister(instr->result()); |
+ __ movsxlq(result_reg, result_reg); |
+ } else { |
+ // Sign extend the 32bit result in the stack slots. |
+ ASSERT(instr->result()->IsStackSlot()); |
+ Operand src = ToOperand(instr->result()); |
+ __ movsxlq(kScratchRegister, src); |
+ __ movq(src, kScratchRegister); |
+ } |
+ } |
+} |
+ |
+ |
bool LCodeGen::GenerateJumpTable() { |
Label needs_frame; |
if (jump_table_.length() > 0) { |
@@ -414,6 +430,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(); |
@@ -2940,19 +2962,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; |
@@ -3026,19 +3035,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); |
@@ -3066,20 +3062,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(); |
@@ -4143,19 +4125,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; |
@@ -4219,20 +4188,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; |
@@ -4260,20 +4215,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(); |