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

Unified Diff: src/crankshaft/mips/lithium-codegen-mips.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/ia32/lithium-codegen-ia32.cc ('k') | src/crankshaft/mips64/lithium-codegen-mips64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/crankshaft/mips/lithium-codegen-mips.cc
diff --git a/src/crankshaft/mips/lithium-codegen-mips.cc b/src/crankshaft/mips/lithium-codegen-mips.cc
index fbf4169bb5955f2763285730a4958eb0865f6277..93801fa070a4a4c0d97d2045968a33e5c44a8f7e 100644
--- a/src/crankshaft/mips/lithium-codegen-mips.cc
+++ b/src/crankshaft/mips/lithium-codegen-mips.cc
@@ -4487,36 +4487,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/ia32/lithium-codegen-ia32.cc ('k') | src/crankshaft/mips64/lithium-codegen-mips64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698