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

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

Issue 22810005: Fix CmpHoleAndBranch on no-sse2 (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Don't reset the stack Created 7 years, 4 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 | « no previous file | no next file » | 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 7753e1d37f362b29655a2513a89e91a608a6e991..29749ba2ebeb9e8577d3cd5805f70fb42ec42c04 100644
--- a/src/ia32/lithium-codegen-ia32.cc
+++ b/src/ia32/lithium-codegen-ia32.cc
@@ -2236,7 +2236,11 @@ void LCodeGen::EmitBranch(InstrType instr, Condition cc) {
template<class InstrType>
void LCodeGen::EmitFalseBranch(InstrType instr, Condition cc) {
int false_block = instr->FalseDestination(chunk_);
- __ j(cc, chunk_->GetAssemblyLabel(false_block));
+ if (cc == no_condition) {
+ __ jmp(chunk_->GetAssemblyLabel(false_block));
+ } else {
+ __ j(cc, chunk_->GetAssemblyLabel(false_block));
+ }
}
@@ -2503,6 +2507,7 @@ void LCodeGen::DoCmpHoleAndBranch(LCmpHoleAndBranch* instr) {
CpuFeatureScope scope(masm(), SSE2);
XMMRegister input_reg = ToDoubleRegister(instr->object());
__ ucomisd(input_reg, input_reg);
+ EmitFalseBranch(instr, parity_odd);
} else {
// Put the value to the top of stack
X87Register src = ToX87Register(instr->object());
@@ -2510,9 +2515,13 @@ void LCodeGen::DoCmpHoleAndBranch(LCmpHoleAndBranch* instr) {
__ fld(0);
__ fld(0);
__ FCmp();
+ Label ok;
+ __ j(parity_even, &ok);
+ __ fstp(0);
+ EmitFalseBranch(instr, no_condition);
+ __ bind(&ok);
}
- EmitFalseBranch(instr, parity_odd);
__ sub(esp, Immediate(kDoubleSize));
if (use_sse2) {
@@ -2520,7 +2529,6 @@ void LCodeGen::DoCmpHoleAndBranch(LCmpHoleAndBranch* instr) {
XMMRegister input_reg = ToDoubleRegister(instr->object());
__ movdbl(MemOperand(esp, 0), input_reg);
} else {
- __ fld(0);
__ fstp_d(MemOperand(esp, 0));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698