Revision: 5098
Author: [email protected]
Date: Mon Jul 19 07:26:51 2010
Log: Revert 5097 on ia32 platform until problem is diagnosed.
Review URL: http://codereview.chromium.org/3018009
http://code.google.com/p/v8/source/detail?r=5098
Modified:
/branches/bleeding_edge/src/ia32/codegen-ia32.cc
/branches/bleeding_edge/src/x64/codegen-x64.cc
=======================================
--- /branches/bleeding_edge/src/ia32/codegen-ia32.cc Mon Jul 19 06:35:41
2010
+++ /branches/bleeding_edge/src/ia32/codegen-ia32.cc Mon Jul 19 07:26:51
2010
@@ -11838,6 +11838,12 @@
// Fall through to the general case.
__ bind(&slow);
}
+
+ // Push arguments below the return address.
+ __ pop(ecx);
+ __ push(eax);
+ __ push(edx);
+ __ push(ecx);
// Generate the number comparison code.
if (include_number_compare_) {
@@ -11858,7 +11864,7 @@
__ cmov(above, eax, Operand(ecx));
__ mov(ecx, Immediate(Smi::FromInt(-1)));
__ cmov(below, eax, Operand(ecx));
- __ ret(0);
+ __ ret(2 * kPointerSize);
} else {
FloatingPointHelper::CheckFloatOperands(
masm, &non_number_comparison, ebx);
@@ -11869,20 +11875,22 @@
__ j(parity_even, &unordered, not_taken);
Label below_label, above_label;
- // Return a result of -1, 0, or 1, based on EFLAGS.
+ // Return a result of -1, 0, or 1, based on EFLAGS. In all cases
remove
+ // two arguments from the stack as they have been pushed in
preparation
+ // of a possible runtime call.
__ j(below, &below_label, not_taken);
__ j(above, &above_label, not_taken);
__ xor_(eax, Operand(eax));
- __ ret(0);
+ __ ret(2 * kPointerSize);
__ bind(&below_label);
__ mov(eax, Immediate(Smi::FromInt(-1)));
- __ ret(0);
+ __ ret(2 * kPointerSize);
__ bind(&above_label);
__ mov(eax, Immediate(Smi::FromInt(1)));
- __ ret(0);
+ __ ret(2 * kPointerSize);
}
// If one of the numbers was NaN, then the result is always false.
@@ -11894,7 +11902,7 @@
} else {
__ mov(eax, Immediate(Smi::FromInt(-1)));
}
- __ ret(0);
+ __ ret(2 * kPointerSize); // eax, edx were pushed
// The number comparison code did not provide a valid result.
__ bind(&non_number_comparison);
@@ -11909,7 +11917,7 @@
// We've already checked for object identity, so if both operands
// are symbols they aren't equal. Register eax already holds a
// non-zero value, which indicates not equal, so just return.
- __ ret(0);
+ __ ret(2 * kPointerSize);
}
__ bind(&check_for_strings);
@@ -11962,12 +11970,14 @@
__ bind(&return_unequal);
// Return non-equal by returning the non-zero object pointer in eax,
// or return equal if we fell through to here.
- __ ret(0); // rax, rdx were pushed
+ __ ret(2 * kPointerSize); // rax, rdx were pushed
__ bind(¬_both_objects);
}
- // Push arguments below the return address.
+ // must swap argument order
__ pop(ecx);
+ __ pop(edx);
+ __ pop(eax);
__ push(edx);
__ push(eax);
@@ -13544,19 +13554,19 @@
ASSERT_EQ(0, EQUAL);
ASSERT_EQ(0, kSmiTag);
__ Set(eax, Immediate(Smi::FromInt(EQUAL)));
- __ ret(0);
+ __ ret(2 * kPointerSize);
__ bind(&result_not_equal);
__ j(greater, &result_greater);
// Result is LESS.
__ Set(eax, Immediate(Smi::FromInt(LESS)));
- __ ret(0);
+ __ ret(2 * kPointerSize);
// Result is GREATER.
__ bind(&result_greater);
__ Set(eax, Immediate(Smi::FromInt(GREATER)));
- __ ret(0);
+ __ ret(2 * kPointerSize);
}
@@ -13586,10 +13596,6 @@
__ JumpIfNotBothSequentialAsciiStrings(edx, eax, ecx, ebx, &runtime);
// Compare flat ascii strings.
- // Drop arguments from the stack.
- __ pop(ecx);
- __ add(Operand(esp), Immediate(2 * kPointerSize));
- __ push(ecx);
GenerateCompareFlatAsciiStrings(masm, edx, eax, ecx, ebx, edi);
// Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater)
=======================================
--- /branches/bleeding_edge/src/x64/codegen-x64.cc Mon Jul 19 06:35:41 2010
+++ /branches/bleeding_edge/src/x64/codegen-x64.cc Mon Jul 19 07:26:51 2010
@@ -10287,6 +10287,12 @@
}
__ bind(&slow);
}
+
+ // Push arguments below the return address to prepare jump to builtin.
+ __ pop(rcx);
+ __ push(rax);
+ __ push(rdx);
+ __ push(rcx);
// Generate the number comparison code.
if (include_number_compare_) {
@@ -10303,7 +10309,7 @@
__ setcc(above, rax);
__ setcc(below, rcx);
__ subq(rax, rcx);
- __ ret(0);
+ __ ret(2 * kPointerSize); // rax, rdx were pushed
// If one of the numbers was NaN, then the result is always false.
// The cc is never not-equal.
@@ -10314,7 +10320,7 @@
} else {
__ Set(rax, -1);
}
- __ ret(0);
+ __ ret(2 * kPointerSize); // rax, rdx were pushed
// The number comparison code did not provide a valid result.
__ bind(&non_number_comparison);
@@ -10329,7 +10335,7 @@
// We've already checked for object identity, so if both operands
// are symbols they aren't equal. Register eax (not rax) already holds
a
// non-zero value, which indicates not equal, so just return.
- __ ret(0);
+ __ ret(2 * kPointerSize);
}
__ bind(&check_for_strings);
@@ -10380,12 +10386,14 @@
__ bind(&return_unequal);
// Return non-equal by returning the non-zero object pointer in eax,
// or return equal if we fell through to here.
- __ ret(0);
+ __ ret(2 * kPointerSize); // rax, rdx were pushed
__ bind(¬_both_objects);
}
- // Push arguments below the return address to prepare jump to builtin.
+ // must swap argument order
__ pop(rcx);
+ __ pop(rdx);
+ __ pop(rax);
__ push(rdx);
__ push(rax);
@@ -11962,7 +11970,7 @@
// Result is EQUAL.
__ Move(rax, Smi::FromInt(EQUAL));
- __ ret(0);
+ __ ret(2 * kPointerSize);
Label result_greater;
__ bind(&result_not_equal);
@@ -11971,12 +11979,12 @@
// Result is LESS.
__ Move(rax, Smi::FromInt(LESS));
- __ ret(0);
+ __ ret(2 * kPointerSize);
// Result is GREATER.
__ bind(&result_greater);
__ Move(rax, Smi::FromInt(GREATER));
- __ ret(0);
+ __ ret(2 * kPointerSize);
}
@@ -12006,10 +12014,6 @@
// Inline comparison of ascii strings.
__ IncrementCounter(&Counters::string_compare_native, 1);
- // Drop arguments from the stack
- __ pop(rcx);
- __ addq(rsp, Immediate(2 * kPointerSize));
- __ push(rcx);
GenerateCompareFlatAsciiStrings(masm, rdx, rax, rcx, rbx, rdi, r8);
// Call the runtime; it returns -1 (less), 0 (equal), or 1 (greater)
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev