Commit 22ca5b97 authored by haitao.feng@intel.com's avatar haitao.feng@intel.com

Guard 32-bit SMI load/store optimization with SmiValuesAre32Bits predicate.

R=verwaest@chromium.org

Review URL: https://codereview.chromium.org/228073004

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@20634 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent 7135c9fd
...@@ -2902,7 +2902,7 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { ...@@ -2902,7 +2902,7 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
} }
Representation representation = access.representation(); Representation representation = access.representation();
if (representation.IsSmi() && if (representation.IsSmi() && SmiValuesAre32Bits() &&
instr->hydrogen()->representation().IsInteger32()) { instr->hydrogen()->representation().IsInteger32()) {
#ifdef DEBUG #ifdef DEBUG
Register scratch = kScratchRegister; Register scratch = kScratchRegister;
...@@ -2912,7 +2912,7 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) { ...@@ -2912,7 +2912,7 @@ void LCodeGen::DoLoadNamedField(LLoadNamedField* instr) {
// Read int value directly from upper half of the smi. // Read int value directly from upper half of the smi.
STATIC_ASSERT(kSmiTag == 0); STATIC_ASSERT(kSmiTag == 0);
STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32); ASSERT(kSmiTagSize + kSmiShiftSize == 32);
offset += kPointerSize / 2; offset += kPointerSize / 2;
representation = Representation::Integer32(); representation = Representation::Integer32();
} }
...@@ -3116,7 +3116,7 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) { ...@@ -3116,7 +3116,7 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
int offset = FixedArray::kHeaderSize - kHeapObjectTag; int offset = FixedArray::kHeaderSize - kHeapObjectTag;
Representation representation = hinstr->representation(); Representation representation = hinstr->representation();
if (representation.IsInteger32() && if (representation.IsInteger32() && SmiValuesAre32Bits() &&
hinstr->elements_kind() == FAST_SMI_ELEMENTS) { hinstr->elements_kind() == FAST_SMI_ELEMENTS) {
ASSERT(!requires_hole_check); ASSERT(!requires_hole_check);
#ifdef DEBUG #ifdef DEBUG
...@@ -3132,7 +3132,7 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) { ...@@ -3132,7 +3132,7 @@ void LCodeGen::DoLoadKeyedFixedArray(LLoadKeyed* instr) {
#endif #endif
// Read int value directly from upper half of the smi. // Read int value directly from upper half of the smi.
STATIC_ASSERT(kSmiTag == 0); STATIC_ASSERT(kSmiTag == 0);
STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32); ASSERT(kSmiTagSize + kSmiShiftSize == 32);
offset += kPointerSize / 2; offset += kPointerSize / 2;
} }
...@@ -4040,7 +4040,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { ...@@ -4040,7 +4040,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
__ movp(write_register, FieldOperand(object, JSObject::kPropertiesOffset)); __ movp(write_register, FieldOperand(object, JSObject::kPropertiesOffset));
} }
if (representation.IsSmi() && if (representation.IsSmi() && SmiValuesAre32Bits() &&
hinstr->value()->representation().IsInteger32()) { hinstr->value()->representation().IsInteger32()) {
ASSERT(hinstr->store_mode() == STORE_TO_INITIALIZED_ENTRY); ASSERT(hinstr->store_mode() == STORE_TO_INITIALIZED_ENTRY);
#ifdef DEBUG #ifdef DEBUG
...@@ -4050,7 +4050,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { ...@@ -4050,7 +4050,7 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) {
#endif #endif
// Store int value directly to upper half of the smi. // Store int value directly to upper half of the smi.
STATIC_ASSERT(kSmiTag == 0); STATIC_ASSERT(kSmiTag == 0);
STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32); ASSERT(kSmiTagSize + kSmiShiftSize == 32);
offset += kPointerSize / 2; offset += kPointerSize / 2;
representation = Representation::Integer32(); representation = Representation::Integer32();
} }
...@@ -4263,7 +4263,7 @@ void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) { ...@@ -4263,7 +4263,7 @@ void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) {
int offset = FixedArray::kHeaderSize - kHeapObjectTag; int offset = FixedArray::kHeaderSize - kHeapObjectTag;
Representation representation = hinstr->value()->representation(); Representation representation = hinstr->value()->representation();
if (representation.IsInteger32()) { if (representation.IsInteger32() && SmiValuesAre32Bits()) {
ASSERT(hinstr->store_mode() == STORE_TO_INITIALIZED_ENTRY); ASSERT(hinstr->store_mode() == STORE_TO_INITIALIZED_ENTRY);
ASSERT(hinstr->elements_kind() == FAST_SMI_ELEMENTS); ASSERT(hinstr->elements_kind() == FAST_SMI_ELEMENTS);
#ifdef DEBUG #ifdef DEBUG
...@@ -4279,7 +4279,7 @@ void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) { ...@@ -4279,7 +4279,7 @@ void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) {
#endif #endif
// Store int value directly to upper half of the smi. // Store int value directly to upper half of the smi.
STATIC_ASSERT(kSmiTag == 0); STATIC_ASSERT(kSmiTag == 0);
STATIC_ASSERT(kSmiTagSize + kSmiShiftSize == 32); ASSERT(kSmiTagSize + kSmiShiftSize == 32);
offset += kPointerSize / 2; offset += kPointerSize / 2;
} }
......
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