Commit 8e719ea4 authored by verwaest@chromium.org's avatar verwaest@chromium.org

Remove support for smi-based keyed accesses on 64bit.

R=mvstanton@chromium.org

Review URL: https://chromiumcodereview.appspot.com/20298002

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@15881 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent b832d8e0
...@@ -5885,8 +5885,8 @@ class ArrayInstructionInterface { ...@@ -5885,8 +5885,8 @@ class ArrayInstructionInterface {
virtual ~ArrayInstructionInterface() { }; virtual ~ArrayInstructionInterface() { };
static Representation KeyedAccessIndexRequirement(Representation r) { static Representation KeyedAccessIndexRequirement(Representation r) {
return r.IsInteger32() ? Representation::Integer32() return r.IsInteger32() || kSmiValueSize != 31
: Representation::Smi(); ? Representation::Integer32() : Representation::Smi();
} }
}; };
......
...@@ -2897,9 +2897,7 @@ void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) { ...@@ -2897,9 +2897,7 @@ void LCodeGen::DoLoadKeyedExternalArray(LLoadKeyed* instr) {
// gets replaced during bound check elimination with the index argument // gets replaced during bound check elimination with the index argument
// to the bounds check, which can be tagged, so that case must be // to the bounds check, which can be tagged, so that case must be
// handled here, too. // handled here, too.
if (instr->hydrogen()->key()->representation().IsSmi()) { if (instr->hydrogen()->IsDehoisted()) {
__ SmiToInteger64(key_reg, key_reg);
} else if (instr->hydrogen()->IsDehoisted()) {
// Sign extend key because it could be a 32 bit negative value // Sign extend key because it could be a 32 bit negative value
// and the dehoisted address computation happens in 64 bits // and the dehoisted address computation happens in 64 bits
__ movsxlq(key_reg, key_reg); __ movsxlq(key_reg, key_reg);
...@@ -2970,9 +2968,7 @@ void LCodeGen::DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr) { ...@@ -2970,9 +2968,7 @@ void LCodeGen::DoLoadKeyedFixedDoubleArray(LLoadKeyed* instr) {
// representation for the key to be an integer, the input gets replaced // representation for the key to be an integer, the input gets replaced
// during bound check elimination with the index argument to the bounds // during bound check elimination with the index argument to the bounds
// check, which can be tagged, so that case must be handled here, too. // check, which can be tagged, so that case must be handled here, too.
if (instr->hydrogen()->key()->representation().IsSmi()) { if (instr->hydrogen()->IsDehoisted()) {
__ SmiToInteger64(key_reg, key_reg);
} else if (instr->hydrogen()->IsDehoisted()) {
// Sign extend key because it could be a 32 bit negative value // Sign extend key because it could be a 32 bit negative value
// and the dehoisted address computation happens in 64 bits // and the dehoisted address computation happens in 64 bits
__ movsxlq(key_reg, key_reg); __ movsxlq(key_reg, key_reg);
...@@ -3012,9 +3008,7 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) { ...@@ -3012,9 +3008,7 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
// gets replaced during bound check elimination with the index // gets replaced during bound check elimination with the index
// argument to the bounds check, which can be tagged, so that // argument to the bounds check, which can be tagged, so that
// case must be handled here, too. // case must be handled here, too.
if (instr->hydrogen()->key()->representation().IsSmi()) { if (instr->hydrogen()->IsDehoisted()) {
__ SmiToInteger64(key_reg, key_reg);
} else if (instr->hydrogen()->IsDehoisted()) {
// Sign extend key because it could be a 32 bit negative value // Sign extend key because it could be a 32 bit negative value
// and the dehoisted address computation happens in 64 bits // and the dehoisted address computation happens in 64 bits
__ movsxlq(key_reg, key_reg); __ movsxlq(key_reg, key_reg);
...@@ -4090,9 +4084,7 @@ void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) { ...@@ -4090,9 +4084,7 @@ void LCodeGen::DoStoreKeyedExternalArray(LStoreKeyed* instr) {
// gets replaced during bound check elimination with the index // gets replaced during bound check elimination with the index
// argument to the bounds check, which can be tagged, so that case // argument to the bounds check, which can be tagged, so that case
// must be handled here, too. // must be handled here, too.
if (instr->hydrogen()->key()->representation().IsSmi()) { if (instr->hydrogen()->IsDehoisted()) {
__ SmiToInteger64(key_reg, key_reg);
} else if (instr->hydrogen()->IsDehoisted()) {
// Sign extend key because it could be a 32 bit negative value // Sign extend key because it could be a 32 bit negative value
// and the dehoisted address computation happens in 64 bits // and the dehoisted address computation happens in 64 bits
__ movsxlq(key_reg, key_reg); __ movsxlq(key_reg, key_reg);
...@@ -4154,9 +4146,7 @@ void LCodeGen::DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr) { ...@@ -4154,9 +4146,7 @@ void LCodeGen::DoStoreKeyedFixedDoubleArray(LStoreKeyed* instr) {
// input gets replaced during bound check elimination with the index // input gets replaced during bound check elimination with the index
// argument to the bounds check, which can be tagged, so that case // argument to the bounds check, which can be tagged, so that case
// must be handled here, too. // must be handled here, too.
if (instr->hydrogen()->key()->representation().IsSmi()) { if (instr->hydrogen()->IsDehoisted()) {
__ SmiToInteger64(key_reg, key_reg);
} else if (instr->hydrogen()->IsDehoisted()) {
// Sign extend key because it could be a 32 bit negative value // Sign extend key because it could be a 32 bit negative value
// and the dehoisted address computation happens in 64 bits // and the dehoisted address computation happens in 64 bits
__ movsxlq(key_reg, key_reg); __ movsxlq(key_reg, key_reg);
...@@ -4197,9 +4187,7 @@ void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) { ...@@ -4197,9 +4187,7 @@ void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) {
// input gets replaced during bound check elimination with the index // input gets replaced during bound check elimination with the index
// argument to the bounds check, which can be tagged, so that case // argument to the bounds check, which can be tagged, so that case
// must be handled here, too. // must be handled here, too.
if (instr->hydrogen()->key()->representation().IsSmi()) { if (instr->hydrogen()->IsDehoisted()) {
__ SmiToInteger64(key_reg, key_reg);
} else if (instr->hydrogen()->IsDehoisted()) {
// Sign extend key because it could be a 32 bit negative value // Sign extend key because it could be a 32 bit negative value
// and the dehoisted address computation happens in 64 bits // and the dehoisted address computation happens in 64 bits
__ movsxlq(key_reg, key_reg); __ movsxlq(key_reg, key_reg);
......
...@@ -2118,13 +2118,9 @@ LInstruction* LChunkBuilder::DoLoadExternalArrayPointer( ...@@ -2118,13 +2118,9 @@ LInstruction* LChunkBuilder::DoLoadExternalArrayPointer(
LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) { LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed* instr) {
ASSERT(instr->key()->representation().IsInteger32() || ASSERT(instr->key()->representation().IsInteger32());
instr->key()->representation().IsSmi());
ElementsKind elements_kind = instr->elements_kind(); ElementsKind elements_kind = instr->elements_kind();
bool clobbers_key = instr->key()->representation().IsSmi(); LOperand* key = UseRegisterOrConstantAtStart(instr->key());
LOperand* key = clobbers_key
? UseTempRegister(instr->key())
: UseRegisterOrConstantAtStart(instr->key());
LLoadKeyed* result = NULL; LLoadKeyed* result = NULL;
if (!instr->is_external()) { if (!instr->is_external()) {
...@@ -2162,7 +2158,6 @@ LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) { ...@@ -2162,7 +2158,6 @@ LInstruction* LChunkBuilder::DoLoadKeyedGeneric(HLoadKeyedGeneric* instr) {
LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
ElementsKind elements_kind = instr->elements_kind(); ElementsKind elements_kind = instr->elements_kind();
bool clobbers_key = instr->key()->representation().IsSmi();
if (!instr->is_external()) { if (!instr->is_external()) {
ASSERT(instr->elements()->representation().IsTagged()); ASSERT(instr->elements()->representation().IsTagged());
...@@ -2174,8 +2169,7 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { ...@@ -2174,8 +2169,7 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
if (instr->value()->representation().IsDouble()) { if (instr->value()->representation().IsDouble()) {
object = UseRegisterAtStart(instr->elements()); object = UseRegisterAtStart(instr->elements());
val = UseTempRegister(instr->value()); val = UseTempRegister(instr->value());
key = clobbers_key ? UseTempRegister(instr->key()) key = UseRegisterOrConstantAtStart(instr->key());
: UseRegisterOrConstantAtStart(instr->key());
} else { } else {
ASSERT(instr->value()->representation().IsSmiOrTagged()); ASSERT(instr->value()->representation().IsSmiOrTagged());
object = UseTempRegister(instr->elements()); object = UseTempRegister(instr->elements());
...@@ -2184,12 +2178,7 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { ...@@ -2184,12 +2178,7 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
key = UseTempRegister(instr->key()); key = UseTempRegister(instr->key());
} else { } else {
val = UseRegisterOrConstantAtStart(instr->value()); val = UseRegisterOrConstantAtStart(instr->value());
key = UseRegisterOrConstantAtStart(instr->key());
if (clobbers_key) {
key = UseTempRegister(instr->key());
} else {
key = UseRegisterOrConstantAtStart(instr->key());
}
} }
} }
...@@ -2209,8 +2198,7 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { ...@@ -2209,8 +2198,7 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
elements_kind == EXTERNAL_FLOAT_ELEMENTS; elements_kind == EXTERNAL_FLOAT_ELEMENTS;
LOperand* val = val_is_temp_register ? UseTempRegister(instr->value()) LOperand* val = val_is_temp_register ? UseTempRegister(instr->value())
: UseRegister(instr->value()); : UseRegister(instr->value());
LOperand* key = clobbers_key ? UseTempRegister(instr->key()) LOperand* key = UseRegisterOrConstantAtStart(instr->key());
: UseRegisterOrConstantAtStart(instr->key());
LOperand* external_pointer = UseRegister(instr->elements()); LOperand* external_pointer = UseRegister(instr->elements());
return new(zone()) LStoreKeyed(external_pointer, key, val); return new(zone()) LStoreKeyed(external_pointer, key, val);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment