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

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

Issue 228073004: Guard 32-bit SMI load/store optimization with SmiValuesAre32Bits predicate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/x64/lithium-codegen-x64.cc
diff --git a/src/x64/lithium-codegen-x64.cc b/src/x64/lithium-codegen-x64.cc
index a8536a1841f379a5078e5fc79716f16e9564024f..f9207d7ec0a03ce4c1c1812b9c4c887358f3b71b 100644
--- a/src/x64/lithium-codegen-x64.cc
+++ b/src/x64/lithium-codegen-x64.cc
@@ -2896,7 +2896,7 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
}
Representation representation = access.representation();
- if (representation.IsSmi() &&
+ if (representation.IsSmi() && SmiValuesAre32Bits() &&
instr->hydrogen()->representation().IsInteger32()) {
#ifdef DEBUG
Register scratch = kScratchRegister;
@@ -2906,7 +2906,7 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
// Read int value directly from upper half of the smi.
STATIC_ASSERT(kSmiTag == 0);
- STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32);
+ ASSERT(kSmiTagSize + kSmiShiftSize == 32);
offset += kPointerSize / 2;
representation = Representation::Integer32();
}
@@ -3110,7 +3110,7 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
int offset = FixedArray::kHeaderSize - kHeapObjectTag;
Representation representation = hinstr->representation();
- if (representation.IsInteger32() &&
+ if (representation.IsInteger32() && SmiValuesAre32Bits() &&
hinstr->elements_kind() == FAST_SMI_ELEMENTS) {
ASSERT(!requires_hole_check);
#ifdef DEBUG
@@ -3126,7 +3126,7 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
#endif
// Read int value directly from upper half of the smi.
STATIC_ASSERT(kSmiTag == 0);
- STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32);
+ ASSERT(kSmiTagSize + kSmiShiftSize == 32);
offset += kPointerSize / 2;
}
@@ -4034,7 +4034,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
__ movp(write_register, FieldOperand(object, JSObject::kPropertiesOffset));
}
- if (representation.IsSmi() &&
+ if (representation.IsSmi() && SmiValuesAre32Bits() &&
hinstr->value()->representation().IsInteger32()) {
ASSERT(hinstr->store_mode() == STORE_TO_INITIALIZED_ENTRY);
#ifdef DEBUG
@@ -4044,7 +4044,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
#endif
// Store int value directly to upper half of the smi.
STATIC_ASSERT(kSmiTag == 0);
- STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32);
+ ASSERT(kSmiTagSize + kSmiShiftSize == 32);
offset += kPointerSize / 2;
representation = Representation::Integer32();
}
@@ -4257,7 +4257,7 @@ void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) {
int offset = FixedArray::kHeaderSize - kHeapObjectTag;
Representation representation = hinstr->value()->representation();
- if (representation.IsInteger32()) {
+ if (representation.IsInteger32() && SmiValuesAre32Bits()) {
ASSERT(hinstr->store_mode() == STORE_TO_INITIALIZED_ENTRY);
ASSERT(hinstr->elements_kind() == FAST_SMI_ELEMENTS);
#ifdef DEBUG
@@ -4273,7 +4273,7 @@ void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) {
#endif
// Store int value directly to upper half of the smi.
STATIC_ASSERT(kSmiTag == 0);
- STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32);
+ ASSERT(kSmiTagSize + kSmiShiftSize == 32);
offset += kPointerSize / 2;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698