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
This commit is contained in:
haitao.feng@intel.com 2014-04-10 00:32:19 +00:00
parent 7135c9fde2
commit 22ca5b97e4

View File

@ -2902,7 +2902,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;
@ -2912,7 +2912,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();
}
@ -3116,7 +3116,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
@ -3132,7 +3132,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;
}
@ -4040,7 +4040,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
@ -4050,7 +4050,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();
}
@ -4263,7 +4263,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
@ -4279,7 +4279,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;
}