Index: src/x64/codegen-x64.cc |
diff --git a/src/x64/codegen-x64.cc b/src/x64/codegen-x64.cc |
index 0c4cd16ceed6d70646659ffda142dddf57ab8078..09deda8eb88d9e7c3ea5d601e7489204e8863c0b 100644 |
--- a/src/x64/codegen-x64.cc |
+++ b/src/x64/codegen-x64.cc |
@@ -5342,13 +5342,18 @@ void CodeGenerator::ToBoolean(ControlDestination* dest) { |
} |
// Smi => false iff zero. |
__ SmiCompare(value.reg(), Smi::FromInt(0)); |
- dest->false_target()->Branch(equal); |
- Condition is_smi = masm_->CheckSmi(value.reg()); |
- dest->true_target()->Branch(is_smi); |
- __ xorpd(xmm0, xmm0); |
- __ ucomisd(xmm0, FieldOperand(value.reg(), HeapNumber::kValueOffset)); |
- value.Unuse(); |
- dest->Split(not_zero); |
+ if (value.is_smi()) { |
+ value.Unuse(); |
+ dest->Split(not_zero); |
+ } else { |
+ dest->false_target()->Branch(equal); |
William Hesse
2010/06/29 10:50:10
Why not also have a case for if value.is_double()?
Lasse Reichstein
2010/06/29 14:13:30
I doubt it will happen in practice that we convert
|
+ Condition is_smi = masm_->CheckSmi(value.reg()); |
+ dest->true_target()->Branch(is_smi); |
+ __ xorpd(xmm0, xmm0); |
+ __ ucomisd(xmm0, FieldOperand(value.reg(), HeapNumber::kValueOffset)); |
+ value.Unuse(); |
+ dest->Split(not_zero); |
+ } |
} else { |
// Fast case checks. |
// 'false' => false. |