Index: src/ia32/lithium-codegen-ia32.cc |
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc |
index ec87a9c72ed88b442efa294297e25d551426a076..8df9d4629765a9e84fbec971b688ab8055a33761 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -1836,8 +1836,11 @@ void LCodeGen::DoValueOf(LValueOf* instr) { |
ASSERT(input.is(result)); |
Label done; |
- // If the object is a smi return the object. |
- __ JumpIfSmi(input, &done, Label::kNear); |
+ |
+ if (!instr->hydrogen()->value()->IsHeapObject()) { |
+ // If the object is a smi return the object. |
+ __ JumpIfSmi(input, &done, Label::kNear); |
+ } |
// If the object is not a value type, return the object. |
__ CmpObjectType(input, JS_VALUE_TYPE, map); |
@@ -2390,8 +2393,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); |
+ } |
Condition cond = masm_->IsObjectStringType(input, temp1, temp1); |
@@ -2407,7 +2413,11 @@ void LCodeGen::DoIsStringAndBranch(LIsStringAndBranch* instr) { |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |
Label* false_label = chunk_->GetAssemblyLabel(false_block); |
- Condition true_cond = EmitIsString(reg, temp, false_label); |
+ SmiCheck check_needed = |
+ instr->hydrogen()->value()->IsHeapObject() |
+ ? OMIT_SMI_CHECK : INLINE_SMI_CHECK; |
+ |
+ Condition true_cond = EmitIsString(reg, temp, false_label, check_needed); |
EmitBranch(true_block, false_block, true_cond); |
} |
@@ -2431,8 +2441,10 @@ void LCodeGen::DoIsUndetectableAndBranch(LIsUndetectableAndBranch* instr) { |
int true_block = chunk_->LookupDestination(instr->true_block_id()); |
int false_block = chunk_->LookupDestination(instr->false_block_id()); |
- STATIC_ASSERT(kSmiTag == 0); |
- __ JumpIfSmi(input, chunk_->GetAssemblyLabel(false_block)); |
+ if (!instr->hydrogen()->value()->IsHeapObject()) { |
+ STATIC_ASSERT(kSmiTag == 0); |
+ __ JumpIfSmi(input, chunk_->GetAssemblyLabel(false_block)); |
+ } |
__ mov(temp, FieldOperand(input, HeapObject::kMapOffset)); |
__ test_b(FieldOperand(temp, Map::kBitFieldOffset), |
1 << Map::kIsUndetectable); |
@@ -2504,7 +2516,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); |
+ } |
__ CmpObjectType(input, TestType(instr->hydrogen()), temp); |
EmitBranch(true_block, false_block, BranchCondition(instr->hydrogen())); |
@@ -2952,9 +2966,9 @@ void LCodeGen::DoStoreContextSlot(LStoreContextSlot* instr) { |
__ mov(target, value); |
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; |
Register temp = ToRegister(instr->temp()); |
int offset = Context::SlotOffset(instr->slot_index()); |
__ RecordWriteContextSlot(context, |
@@ -4327,9 +4341,9 @@ void LCodeGen::DoStoreNamedField(LStoreNamedField* instr) { |
} |
// Do the store. |
- 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; |
Register write_register = object; |
if (!access.IsInobject()) { |
@@ -4566,9 +4580,9 @@ void LCodeGen::DoStoreKeyedFixedArray(LStoreKeyed* instr) { |
ASSERT(instr->value()->IsRegister()); |
Register value = ToRegister(instr->value()); |
ASSERT(!instr->key()->IsConstantOperand()); |
- 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. |
__ lea(key, operand); |
__ RecordWrite(elements, |
@@ -5709,9 +5723,11 @@ void LCodeGen::DoCheckSmi(LCheckSmi* instr) { |
void LCodeGen::DoCheckNonSmi(LCheckNonSmi* instr) { |
- LOperand* input = instr->value(); |
- __ test(ToOperand(input), Immediate(kSmiTagMask)); |
- DeoptimizeIf(zero, instr->environment()); |
+ if (!instr->hydrogen()->value()->IsHeapObject()) { |
ulan
2013/06/20 07:53:54
This check is not present on arm and x64.
|
+ LOperand* input = instr->value(); |
+ __ test(ToOperand(input), Immediate(kSmiTagMask)); |
+ DeoptimizeIf(zero, instr->environment()); |
+ } |
} |