Reviewers: jochen, rodolph, jbramley,
Message:
This ports Smi optimizations for x64 in r18283, r18359, r18360, r18362 and
fixes
many test failures.
Description:
A64: Fix handling of Smis in lithium Load/Store.
BUG=
Please review this at https://codereview.chromium.org/145893004/
SVN Base: https://v8.googlecode.com/svn/branches/experimental/a64
Affected files (+32, -5 lines):
M src/a64/lithium-a64.cc
M src/a64/lithium-codegen-a64.cc
Index: src/a64/lithium-a64.cc
diff --git a/src/a64/lithium-a64.cc b/src/a64/lithium-a64.cc
index
d524d974e8884362728f2cc323a3999a888ee731..03c5ac8e6ce41b6bff381231937cad68db3dc383
100644
--- a/src/a64/lithium-a64.cc
+++ b/src/a64/lithium-a64.cc
@@ -1653,7 +1653,8 @@ LInstruction* LChunkBuilder::DoLoadKeyed(HLoadKeyed*
instr) {
? AssignEnvironment(DefineAsRegister(result))
: DefineAsRegister(result);
} else {
- ASSERT(instr->representation().IsSmiOrTagged());
+ ASSERT(instr->representation().IsSmiOrTagged() ||
+ instr->representation().IsInteger32());
LOperand* temp = instr->key()->IsConstant() ? NULL : TempRegister();
LLoadKeyedFixed* result =
new(zone()) LLoadKeyedFixed(elements, key, temp);
@@ -2136,7 +2137,8 @@ LInstruction*
LChunkBuilder::DoStoreKeyed(HStoreKeyed* instr) {
return new(zone()) LStoreKeyedFixedDouble(elements, key, val, temp);
} else {
ASSERT(instr->elements()->representation().IsTagged());
- ASSERT(instr->value()->representation().IsSmiOrTagged());
+ ASSERT(instr->value()->representation().IsSmiOrTagged() ||
+ instr->value()->representation().IsInteger32());
temp = TempRegister();
return new(zone()) LStoreKeyedFixed(elements, key, val, temp);
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) {
+ __ 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,
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.