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..dd28de87be2eec915a4f558b778e5b692200d209 100644 |
--- a/src/ia32/lithium-codegen-ia32.cc |
+++ b/src/ia32/lithium-codegen-ia32.cc |
@@ -2134,6 +2134,16 @@ void LCodeGen::DoBranch(LBranch* instr) { |
ASSERT(!info()->IsStub()); |
__ test(reg, Operand(reg)); |
EmitBranch(true_block, false_block, not_equal); |
+ } else if (type.IsJSArray()) { |
+ EmitBranch(true_block, false_block, no_condition); |
+ } else if (type.IsHeapNumber()) { |
Toon Verwaest
2013/06/18 17:01:52
ASSERT(!info()->IsStub());
XMM is not available fo
|
+ CpuFeatureScope scope(masm(), SSE2); |
+ __ xorps(xmm0, xmm0); |
+ __ ucomisd(xmm0, FieldOperand(reg, HeapNumber::kValueOffset)); |
+ EmitBranch(true_block, false_block, not_equal); |
+ } else if (type.IsString()) { |
+ __ cmp(FieldOperand(reg, String::kLengthOffset), Immediate(0)); |
+ EmitBranch(true_block, false_block, not_equal); |
} else { |
Label* true_label = chunk_->GetAssemblyLabel(true_block); |
Label* false_label = chunk_->GetAssemblyLabel(false_block); |
@@ -2229,8 +2239,10 @@ void LCodeGen::DoBranch(LBranch* instr) { |
__ bind(¬_heap_number); |
} |
- // We've seen something for the first time -> deopt. |
- DeoptimizeIf(no_condition, instr->environment()); |
+ if (expected != ToBooleanStub::all_types()) { |
+ // We've seen something for the first time -> deopt. |
+ DeoptimizeIf(no_condition, instr->environment()); |
+ } |
} |
} |
} |