Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Unified Diff: src/crankshaft/ppc/lithium-codegen-ppc.cc

Issue 2455993002: PPC/s390: [crankshaft] Support all oddballs for truncating TaggedToI changes. (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | src/crankshaft/s390/lithium-codegen-s390.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | src/crankshaft/s390/lithium-codegen-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698