Commit d057410e authored by verwaest@chromium.org's avatar verwaest@chromium.org

Require smi for keyed store to smi.

R=jkummerow@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@14779 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 632f5918
...@@ -2252,7 +2252,7 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { ...@@ -2252,7 +2252,7 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
val = UseTempRegister(instr->value()); val = UseTempRegister(instr->value());
key = UseRegisterOrConstantAtStart(instr->key()); key = UseRegisterOrConstantAtStart(instr->key());
} else { } else {
ASSERT(instr->value()->representation().IsTagged()); ASSERT(instr->value()->representation().IsSmiOrTagged());
object = UseTempRegister(instr->elements()); object = UseTempRegister(instr->elements());
val = needs_write_barrier ? UseTempRegister(instr->value()) val = needs_write_barrier ? UseTempRegister(instr->value())
: UseRegisterAtStart(instr->value()); : UseRegisterAtStart(instr->value());
......
...@@ -5723,6 +5723,9 @@ class HStoreKeyed ...@@ -5723,6 +5723,9 @@ class HStoreKeyed
} else if (IsFastDoubleElementsKind(elements_kind)) { } else if (IsFastDoubleElementsKind(elements_kind)) {
SetGVNFlag(kChangesDoubleArrayElements); SetGVNFlag(kChangesDoubleArrayElements);
SetFlag(kDeoptimizeOnUndefined); SetFlag(kDeoptimizeOnUndefined);
} else if (IsFastSmiElementsKind(elements_kind)) {
SetGVNFlag(kChangesArrayElements);
SetFlag(kDeoptimizeOnUndefined);
} else { } else {
SetGVNFlag(kChangesArrayElements); SetGVNFlag(kChangesArrayElements);
} }
...@@ -5751,6 +5754,10 @@ class HStoreKeyed ...@@ -5751,6 +5754,10 @@ class HStoreKeyed
return Representation::Double(); return Representation::Double();
} }
if (IsFastSmiElementsKind(elements_kind())) {
return Representation::Smi();
}
return is_external() ? Representation::Integer32() return is_external() ? Representation::Integer32()
: Representation::Tagged(); : Representation::Tagged();
} }
......
...@@ -2344,7 +2344,7 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { ...@@ -2344,7 +2344,7 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
LOperand* key = UseRegisterOrConstantAtStart(instr->key()); LOperand* key = UseRegisterOrConstantAtStart(instr->key());
return new(zone()) LStoreKeyed(object, key, val); return new(zone()) LStoreKeyed(object, key, val);
} else { } else {
ASSERT(instr->value()->representation().IsTagged()); ASSERT(instr->value()->representation().IsSmiOrTagged());
bool needs_write_barrier = instr->NeedsWriteBarrier(); bool needs_write_barrier = instr->NeedsWriteBarrier();
LOperand* obj = UseRegister(instr->elements()); LOperand* obj = UseRegister(instr->elements());
......
...@@ -2172,7 +2172,7 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) { ...@@ -2172,7 +2172,7 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
key = clobbers_key ? UseTempRegister(instr->key()) key = clobbers_key ? UseTempRegister(instr->key())
: UseRegisterOrConstantAtStart(instr->key()); : UseRegisterOrConstantAtStart(instr->key());
} else { } else {
ASSERT(instr->value()->representation().IsTagged()); ASSERT(instr->value()->representation().IsSmiOrTagged());
object = UseTempRegister(instr->elements()); object = UseTempRegister(instr->elements());
if (needs_write_barrier) { if (needs_write_barrier) {
val = UseTempRegister(instr->value()); val = UseTempRegister(instr->value());
......
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