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

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

Issue 2452193003: [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/compiler/effect-control-linearizer.cc ('k') | src/crankshaft/arm64/lithium-codegen-arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/arm/lithium-codegen-arm.cc
diff --git a/src/crankshaft/arm/lithium-codegen-arm.cc b/src/crankshaft/arm/lithium-codegen-arm.cc
index d78cd533fb91c258cf2e2f0c1f42187ffaa7caa1..d6eb69a6fd1fdf4d21fb9be8c846a38fb87afd0a 100644
--- a/src/crankshaft/arm/lithium-codegen-arm.cc
+++ b/src/crankshaft/arm/lithium-codegen-arm.cc
@@ -4538,34 +4538,12 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
__ cmp(scratch1, Operand(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;
- __ b(ne, &no_heap_number);
+ Label truncate;
+ __ b(eq, &truncate);
+ __ CompareInstanceType(scratch1, scratch1, ODDBALL_TYPE);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNotANumberOrOddball);
+ __ bind(&truncate);
__ 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(scratch2, Operand(ip));
- __ b(ne, &check_bools);
- __ mov(input_reg, Operand::Zero());
- __ b(&done);
-
- __ bind(&check_bools);
- __ LoadRoot(ip, Heap::kTrueValueRootIndex);
- __ cmp(scratch2, Operand(ip));
- __ b(ne, &check_false);
- __ mov(input_reg, Operand(1));
- __ b(&done);
-
- __ bind(&check_false);
- __ LoadRoot(ip, Heap::kFalseValueRootIndex);
- __ cmp(scratch2, Operand(ip));
- DeoptimizeIf(ne, instr, DeoptimizeReason::kNotAHeapNumberUndefinedBoolean);
- __ mov(input_reg, Operand::Zero());
} else {
DeoptimizeIf(ne, instr, DeoptimizeReason::kNotAHeapNumber);
« no previous file with comments | « src/compiler/effect-control-linearizer.cc ('k') | src/crankshaft/arm64/lithium-codegen-arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698