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

Unified Diff: src/crankshaft/mips64/lithium-codegen-mips64.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/mips/lithium-codegen-mips.cc ('k') | src/crankshaft/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/mips64/lithium-codegen-mips64.cc
diff --git a/src/crankshaft/mips64/lithium-codegen-mips64.cc b/src/crankshaft/mips64/lithium-codegen-mips64.cc
index 89696093d02a5724852e1ab18e58e3643bf2f196..5c0f41e460830d9de2177f0659d7f94bb2f6a017 100644
--- a/src/crankshaft/mips64/lithium-codegen-mips64.cc
+++ b/src/crankshaft/mips64/lithium-codegen-mips64.cc
@@ -4695,36 +4695,14 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr) {
// of the if.
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;
- // Check HeapNumber map.
- __ Branch(USE_DELAY_SLOT, &no_heap_number, ne, scratch1, Operand(at));
+ Label truncate;
+ __ Branch(USE_DELAY_SLOT, &truncate, eq, scratch1, Operand(at));
__ mov(scratch2, input_reg); // In delay slot.
+ __ lbu(scratch1, FieldMemOperand(scratch1, Map::kInstanceTypeOffset));
+ DeoptimizeIf(ne, instr, DeoptimizeReason::kNotANumberOrOddball, scratch1,
+ Operand(ODDBALL_TYPE));
+ __ bind(&truncate);
__ TruncateHeapNumberToI(input_reg, scratch2);
- __ Branch(&done);
-
- // Check for Oddballs. Undefined/False is converted to zero and True to one
- // for truncating conversions.
- __ bind(&no_heap_number);
- __ LoadRoot(at, Heap::kUndefinedValueRootIndex);
- __ Branch(&check_bools, ne, input_reg, Operand(at));
- DCHECK(ToRegister(instr->result()).is(input_reg));
- __ Branch(USE_DELAY_SLOT, &done);
- __ mov(input_reg, zero_reg); // In delay slot.
-
- __ bind(&check_bools);
- __ LoadRoot(at, Heap::kTrueValueRootIndex);
- __ Branch(&check_false, ne, scratch2, Operand(at));
- __ Branch(USE_DELAY_SLOT, &done);
- __ li(input_reg, Operand(1)); // In delay slot.
-
- __ bind(&check_false);
- __ LoadRoot(at, Heap::kFalseValueRootIndex);
- DeoptimizeIf(ne, instr, DeoptimizeReason::kNotAHeapNumberUndefinedBoolean,
- scratch2, Operand(at));
- __ Branch(USE_DELAY_SLOT, &done);
- __ mov(input_reg, zero_reg); // In delay slot.
} else {
DeoptimizeIf(ne, instr, DeoptimizeReason::kNotAHeapNumber, scratch1,
Operand(at));
« no previous file with comments | « src/crankshaft/mips/lithium-codegen-mips.cc ('k') | src/crankshaft/x64/lithium-codegen-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698