Index: src/arm/lithium-codegen-arm.cc |
diff --git a/src/arm/lithium-codegen-arm.cc b/src/arm/lithium-codegen-arm.cc |
index ef860e0d8774771c00378fc6b7bc8129726d49d6..8a16278023e2445e3884b37fa22dfe0f801f72cc 100644 |
--- a/src/arm/lithium-codegen-arm.cc |
+++ b/src/arm/lithium-codegen-arm.cc |
@@ -1906,10 +1906,12 @@ void LCodeGen::DoValueOf(LValueOf* instr) { |
Register map = ToRegister(instr->temp()); |
Label done; |
- // If the object is a smi return the object. |
- __ SmiTst(input); |
- __ Move(result, input, eq); |
- __ b(eq, &done); |
+ if (!instr->hydrogen()->value()->IsHeapObject()) { |
+ // If the object is a smi return the object. |
+ __ SmiTst(input); |
+ __ Move(result, input, eq); |
+ __ b(eq, &done); |
+ } |
// If the object is not a value type, return the object. |
__ CompareObjectType(input, map, map, JS_VALUE_TYPE); |
@@ -2461,8 +2463,11 @@ void LCodeGen::DoIsObjectAndBranch(LIsObjectAndBranch* instr) { |
Condition LCodeGen::EmitIsString(Register input, |
Register temp1, |
- Label* is_not_string) { |
- __ JumpIfSmi(input, is_not_string); |
+ Label* is_not_string, |
+ SmiCheck check_needed = INLINE_SMI_CHECK) { |
+ if (check_needed == INLINE_SMI_CHECK) { |
+ __ JumpIfSmi(input, is_not_string); |
+ } |
__ CompareObjectType(input, temp1, temp1, FIRST_NONSTRING_TYPE); |
return lt; |
@@ -2477,8 +2482,11 @@ void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) { |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |
Label* false_label = chunk_->GetAssemblyLabel(false_block); |
+ SmiCheck check_needed = |
+ instr->hydrogen()->value()->IsHeapObject() |
+ ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
Condition true_cond = |
- EmitIsString(reg, temp1, false_label); |
+ EmitIsString(reg, temp1, false_label, check_needed); |
EmitBranch(true_block, false_block, true_cond); |
} |
@@ -2501,7 +2509,9 @@ void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) { |
int true_block = chunk_->LookupDestination(instr->true_block_id()); |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |
- __ JumpIfSmi(input, chunk_->GetAssemblyLabel(false_block)); |
+ if (!instr->hydrogen()->value()->IsHeapObject()) { |
+ __ JumpIfSmi(input, chunk_->GetAssemblyLabel(false_block)); |
+ } |
__ ldr(temp, FieldMemOperand(input, HeapObject::kMapOffset)); |
__ ldrb(temp, FieldMemOperand(temp, Map::kBitFieldOffset)); |
__ tst(temp, Operand(1 << Map::kIsUndetectable)); |
@@ -2574,7 +2584,9 @@ void LCodeGen::DoHasInstanceTypeAndBranch(LHasInstanceTypeAndBranch* instr) { |
Label* false_label = chunk_->GetAssemblyLabel(false_block); |
- __ JumpIfSmi(input, false_label); |
+ if (!instr->hydrogen()->value()->IsHeapObject()) { |
+ __ JumpIfSmi(input, false_label); |
+ } |
__ CompareObjectType(input, scratch, scratch, TestType(instr->hydrogen())); |
EmitBranch(true_block, false_block, BranchCondition(instr->hydrogen())); |
@@ -3019,9 +3031,9 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
__ str(value, target); |
if (instr->hydrogen()->NeedsWriteBarrier()) { |
- HType type = instr->hydrogen()->value()->type(); |
SmiCheck check_needed = |
- type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
+ instr->hydrogen()->value()->IsHeapObject() |
+ ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
__ RecordWriteContextSlot(context, |
target.offset(), |
value, |
@@ -4263,9 +4275,9 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
// Do the store. |
Register value = ToRegister(instr->value()); |
ASSERT(!object.is(value)); |
- HType type = instr->hydrogen()->value()->type(); |
SmiCheck check_needed = |
- type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
+ !instr->hydrogen()->value()->IsHeapObject() |
ulan
2013/06/20 07:49:11
Negate the condition to make it consistent with th
|
+ ? INLINE_SMI_CHECK : OMIT_SMI_CHECK; |
if (access.IsInobject()) { |
__ str(value, FieldMemOperand(object, offset)); |
if (instr->hydrogen()->NeedsWriteBarrier()) { |
@@ -4474,9 +4486,9 @@ void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) { |
__ str(value, FieldMemOperand(store_base, offset)); |
if (instr->hydrogen()->NeedsWriteBarrier()) { |
- HType type = instr->hydrogen()->value()->type(); |
SmiCheck check_needed = |
- type.IsHeapObject() ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
+ instr->hydrogen()->value()->IsHeapObject() |
+ ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
// Compute address of modified element and store it into key register. |
__ add(key, store_base, Operand(offset - kHeapObjectTag)); |
__ RecordWrite(elements, |