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

Unified Diff: src/crankshaft/arm64/lithium-codegen-arm64.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/crankshaft/arm/lithium-codegen-arm.cc ('k') | src/crankshaft/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/arm64/lithium-codegen-arm64.cc
diff --git a/src/crankshaft/arm64/lithium-codegen-arm64.cc b/src/crankshaft/arm64/lithium-codegen-arm64.cc
index d2c024f79d2790a9201780ea157f98bb3e37a1bf..ff2a6d3a6982df35420bab1f3eeed21e0bd24a67 100644
--- a/src/crankshaft/arm64/lithium-codegen-arm64.cc
+++ b/src/crankshaft/arm64/lithium-codegen-arm64.cc
@@ -5181,30 +5181,18 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr,
Label done;
if (instr->truncating()) {
+ UseScratchRegisterScope temps(masm());
Register output = ToRegister(instr->result());
- Label check_bools;
-
- // If it's not a heap number, jump to undefined check.
- __ JumpIfNotHeapNumber(input, &check_bools);
-
- // A heap number: load value and convert to int32 using truncating function.
+ Register input_map = temps.AcquireX();
+ Register input_instance_type = input_map;
+ Label truncate;
+ __ CompareObjectType(input, input_map, input_instance_type,
+ HEAP_NUMBER_TYPE);
+ __ B(eq, &truncate);
+ __ Cmp(input_instance_type, ODDBALL_TYPE);
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNotANumberOrOddball);
+ __ Bind(&truncate);
__ TruncateHeapNumberToI(output, input);
- __ B(&done);
-
- __ Bind(&check_bools);
-
- Register true_root = output;
- Register false_root = scratch1;
- __ LoadTrueFalseRoots(true_root, false_root);
- __ Cmp(input, true_root);
- __ Cset(output, eq);
- __ Ccmp(input, false_root, ZFlag, ne);
- __ B(eq, &done);
-
- // Output contains zero, undefined is converted to zero for truncating
- // conversions.
- DeoptimizeIfNotRoot(input, Heap::kUndefinedValueRootIndex, instr,
- DeoptimizeReason::kNotAHeapNumberUndefinedBoolean);
} else {
Register output = ToRegister32(instr->result());
DoubleRegister dbl_scratch2 = ToDoubleRegister(temp2);
« no previous file with comments | « src/crankshaft/arm/lithium-codegen-arm.cc ('k') | src/crankshaft/ia32/lithium-codegen-ia32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698