Index: src/crankshaft/ppc/lithium-codegen-ppc.cc |
diff --git a/src/crankshaft/ppc/lithium-codegen-ppc.cc b/src/crankshaft/ppc/lithium-codegen-ppc.cc |
index c7f0a38694908c07889f98dfdd1cc197a0afacae..fe8df0f27e92e031aaaf81e70d92a8218465e7ce 100644 |
--- a/src/crankshaft/ppc/lithium-codegen-ppc.cc |
+++ b/src/crankshaft/ppc/lithium-codegen-ppc.cc |
@@ -4793,35 +4793,13 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) { |
__ cmp(scratch1, ip); |
if (instr->truncating()) { |
- // Performs a truncating conversion of a floating point number as used by |
- // the JS bitwise operations. |
- Label no_heap_number, check_bools, check_false; |
- __ bne(&no_heap_number); |
+ Label truncate; |
+ __ beq(&truncate); |
+ __ CompareInstanceType(scratch1, scratch1, ODDBALL_TYPE); |
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNotANumberOrOddball); |
+ __ bind(&truncate); |
__ mr(scratch2, input_reg); |
__ TruncateHeapNumberToI(input_reg, scratch2); |
- __ b(&done); |
- |
- // Check for Oddballs. Undefined/False is converted to zero and True to one |
- // for truncating conversions. |
- __ bind(&no_heap_number); |
- __ LoadRoot(ip, Heap::kUndefinedValueRootIndex); |
- __ cmp(input_reg, ip); |
- __ bne(&check_bools); |
- __ li(input_reg, Operand::Zero()); |
- __ b(&done); |
- |
- __ bind(&check_bools); |
- __ LoadRoot(ip, Heap::kTrueValueRootIndex); |
- __ cmp(input_reg, ip); |
- __ bne(&check_false); |
- __ li(input_reg, Operand(1)); |
- __ b(&done); |
- |
- __ bind(&check_false); |
- __ LoadRoot(ip, Heap::kFalseValueRootIndex); |
- __ cmp(input_reg, ip); |
- DeoptimizeIf(ne, instr, DeoptimizeReason::kNotAHeapNumberUndefinedBoolean); |
- __ li(input_reg, Operand::Zero()); |
} else { |
DeoptimizeIf(ne, instr, DeoptimizeReason::kNotAHeapNumber); |