Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2339)

Unified Diff: src/a64/lithium-codegen-a64.cc

Issue 145893004: A64: Fix handling of Smis in lithium Load/Store. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/a64/lithium-a64.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/a64/lithium-codegen-a64.cc
diff --git a/src/a64/lithium-codegen-a64.cc b/src/a64/lithium-codegen-a64.cc
index 87072f3c1d424c9f10134ed1bf48144158734d8b..691ba3777b2e05efe7262e1cc1da72f4b45e8d6f 100644
--- a/src/a64/lithium-codegen-a64.cc
+++ b/src/a64/lithium-codegen-a64.cc
@@ -3472,7 +3472,16 @@ void LCodeGen::DoLoadKeyedFixed(LLoadKeyedFixed* instr) {
instr->hydrogen()->elements_kind());
offset = FixedArray::OffsetOfElementAt(instr->additional_index());
}
- __ Ldr(result, FieldMemOperand(load_base, offset));
+ Representation representation = instr->hydrogen()->representation();
+
+ if (representation.IsInteger32() &&
+ instr->hydrogen()->elements_kind() == FAST_SMI_ELEMENTS) {
m.m.capewell 2014/02/07 15:56:50 Perhaps assert the format of a smi here and in sto
ulan 2014/02/07 16:08:09 Done.
+ __ Load(result, UntagSmiFieldMemOperand(load_base, offset),
+ Representation::Integer32());
+ } else {
+ __ Load(result, FieldMemOperand(load_base, offset),
+ representation);
+ }
if (instr->hydrogen()->RequiresHoleCheck()) {
if (IsFastSmiElementsKind(instr->hydrogen()->elements_kind())) {
@@ -4914,7 +4923,15 @@ void LCodeGen::DoStoreKeyedFixed(LStoreKeyedFixed* instr) {
instr->hydrogen()->elements_kind());
offset = FixedArray::OffsetOfElementAt(instr->additional_index());
}
- __ Str(value, FieldMemOperand(store_base, offset));
+ Representation representation = instr->hydrogen()->value()->representation();
+ if (representation.IsInteger32()) {
+ ASSERT(instr->hydrogen()->store_mode() == STORE_TO_INITIALIZED_ENTRY);
+ ASSERT(instr->hydrogen()->elements_kind() == FAST_SMI_ELEMENTS);
+ __ Store(value, UntagSmiFieldMemOperand(store_base, offset),
+ Representation::Integer32());
+ } else {
+ __ Store(value, FieldMemOperand(store_base, offset), representation);
+ }
if (instr->hydrogen()->NeedsWriteBarrier()) {
SmiCheck check_needed =
@@ -5003,7 +5020,15 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
__ Ldr(temp0, FieldMemOperand(object, JSObject::kPropertiesOffset));
destination = temp0;
}
- __ Store(value, FieldMemOperand(destination, offset), representation);
+
+ if (representation.IsSmi() &&
+ instr->hydrogen()->value()->representation().IsInteger32()) {
+ ASSERT(instr->hydrogen()->store_mode() == STORE_TO_INITIALIZED_ENTRY);
+ __ Store(value, UntagSmiFieldMemOperand(destination, offset),
+ Representation::Integer32());
+ } else {
+ __ Store(value, FieldMemOperand(destination, offset), representation);
+ }
if (instr->hydrogen()->NeedsWriteBarrier()) {
__ RecordWriteField(destination,
offset,
« no previous file with comments | « src/a64/lithium-a64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698