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

Unified Diff: src/crankshaft/s390/lithium-codegen-s390.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 | « src/crankshaft/ppc/lithium-codegen-ppc.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/s390/lithium-codegen-s390.cc
diff --git a/src/crankshaft/s390/lithium-codegen-s390.cc b/src/crankshaft/s390/lithium-codegen-s390.cc
index 1acaf670bdb997a788a3d95a7bf9a1be10b11b65..8cfdc566ccac9982b0c86fd67f50fe561500832b 100644
--- a/src/crankshaft/s390/lithium-codegen-s390.cc
+++ b/src/crankshaft/s390/lithium-codegen-s390.cc
@@ -4720,32 +4720,13 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
__ CompareRoot(scratch1, Heap::kHeapNumberMapRootIndex);
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::kNear);
+ Label truncate;
+ __ beq(&truncate);
+ __ CompareInstanceType(scratch1, scratch1, ODDBALL_TYPE);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNotANumberOrOddball);
+ __ bind(&truncate);
__ LoadRR(scratch2, input_reg);
__ TruncateHeapNumberToI(input_reg, scratch2);
- __ b(&done, Label::kNear);
-
- // Check for Oddballs. Undefined/False is converted to zero and True to one
- // for truncating conversions.
- __ bind(&no_heap_number);
- __ CompareRoot(input_reg, Heap::kUndefinedValueRootIndex);
- __ bne(&check_bools);
- __ LoadImmP(input_reg, Operand::Zero());
- __ b(&done, Label::kNear);
-
- __ bind(&check_bools);
- __ CompareRoot(input_reg, Heap::kTrueValueRootIndex);
- __ bne(&check_false, Label::kNear);
- __ LoadImmP(input_reg, Operand(1));
- __ b(&done, Label::kNear);
-
- __ bind(&check_false);
- __ CompareRoot(input_reg, Heap::kFalseValueRootIndex);
- DeoptimizeIf(ne, instr, DeoptimizeReason::kNotAHeapNumberUndefinedBoolean);
- __ LoadImmP(input_reg, Operand::Zero());
} else {
// Deoptimize if we don't have a heap number.
DeoptimizeIf(ne, instr, DeoptimizeReason::kNotAHeapNumber);
« no previous file with comments | « src/crankshaft/ppc/lithium-codegen-ppc.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698