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) {
val = UseTempRegister(instr->value());
key = UseRegisterOrConstantAtStart(instr->key());
} else {
ASSERT(instr->value()->representation().IsTagged());
ASSERT(instr->value()->representation().IsSmiOrTagged());
object = UseTempRegister(instr->elements());
val = needs_write_barrier ? UseTempRegister(instr->value())
: UseRegisterAtStart(instr->value());
......
......@@ -5723,6 +5723,9 @@ class HStoreKeyed
} else if (IsFastDoubleElementsKind(elements_kind)) {
SetGVNFlag(kChangesDoubleArrayElements);
SetFlag(kDeoptimizeOnUndefined);
} else if (IsFastSmiElementsKind(elements_kind)) {
SetGVNFlag(kChangesArrayElements);
SetFlag(kDeoptimizeOnUndefined);
} else {
SetGVNFlag(kChangesArrayElements);
}
......@@ -5751,6 +5754,10 @@ class HStoreKeyed
return Representation::Double();
}
if (IsFastSmiElementsKind(elements_kind())) {
return Representation::Smi();
}
return is_external() ? Representation::Integer32()
: Representation::Tagged();
}
......
......@@ -2344,7 +2344,7 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
LOperand* key = UseRegisterOrConstantAtStart(instr->key());
return new(zone()) LStoreKeyed(object, key, val);
} else {
ASSERT(instr->value()->representation().IsTagged());
ASSERT(instr->value()->representation().IsSmiOrTagged());
bool needs_write_barrier = instr->NeedsWriteBarrier();
LOperand* obj = UseRegister(instr->elements());
......
......@@ -2172,7 +2172,7 @@ LInstruction* LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
key = clobbers_key ? UseTempRegister(instr->key())
: UseRegisterOrConstantAtStart(instr->key());
} else {
ASSERT(instr->value()->representation().IsTagged());
ASSERT(instr->value()->representation().IsSmiOrTagged());
object = UseTempRegister(instr->elements());
if (needs_write_barrier) {
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