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

Unified Diff: src/ia32/lithium-codegen-ia32.cc

Issue 578583002: Fixed deopt reasons in TaggedToI. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 3 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/arm64/lithium-codegen-arm64.cc ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ia32/lithium-codegen-ia32.cc
diff --git a/src/ia32/lithium-codegen-ia32.cc b/src/ia32/lithium-codegen-ia32.cc
index e0f8d3b3d40ef2cd66d1ee5fa786069db58f001b..b00fa858d2187c9b7adbe40197ebe8a61ddfca1e 100644
--- a/src/ia32/lithium-codegen-ia32.cc
+++ b/src/ia32/lithium-codegen-ia32.cc
@@ -4763,16 +4763,31 @@ void LCodeGen::DoDeferredTaggedToI(LTaggedToI* instr, Label* done) {
__ RecordComment("Deferred TaggedToI: cannot truncate");
DeoptimizeIf(not_equal, instr->environment());
__ Move(input_reg, Immediate(0));
+ __ jmp(done);
Jakob Kummerow 2014/09/17 09:22:35 As discussed, we don't need this jump (as it would
} else {
- Label bailout;
- XMMRegister scratch = (instr->temp() != NULL)
- ? ToDoubleRegister(instr->temp())
- : no_xmm_reg;
- __ TaggedToI(input_reg, input_reg, scratch,
- instr->hydrogen()->GetMinusZeroMode(), &bailout);
+ XMMRegister scratch = ToDoubleRegister(instr->temp());
+ DCHECK(!scratch.is(xmm0));
+ __ cmp(FieldOperand(input_reg, HeapObject::kMapOffset),
+ isolate()->factory()->heap_number_map());
+ __ RecordComment("Deferred TaggedToI: not a heap number");
+ DeoptimizeIf(not_equal, instr->environment());
+ __ movsd(xmm0, FieldOperand(input_reg, HeapNumber::kValueOffset));
+ __ cvttsd2si(input_reg, Operand(xmm0));
+ __ Cvtsi2sd(scratch, Operand(input_reg));
+ __ ucomisd(xmm0, scratch);
+ __ RecordComment("Deferred TaggedToI: lost precision");
+ DeoptimizeIf(not_equal, instr->environment());
+ __ RecordComment("Deferred TaggedToI: NaN");
+ DeoptimizeIf(parity_even, instr->environment());
+ if (instr->hydrogen()->GetMinusZeroMode() == FAIL_ON_MINUS_ZERO) {
+ __ test(input_reg, Operand(input_reg));
+ __ j(not_zero, done);
+ __ movmskpd(input_reg, xmm0);
+ __ and_(input_reg, 1);
+ __ RecordComment("Deferred TaggedToI: minus zero");
+ DeoptimizeIf(not_zero, instr->environment());
+ }
__ jmp(done);
Jakob Kummerow 2014/09/17 09:22:35 This can go too (see above).
- __ bind(&bailout);
- DeoptimizeIf(no_condition, instr->environment());
}
}
« no previous file with comments | « src/arm64/lithium-codegen-arm64.cc ('k') | src/ia32/macro-assembler-ia32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698