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

Unified Diff: test/cctest/test-macro-assembler-x64.cc

Issue 21014003: Optionally use 31-bits SMI value for 64-bit system (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 5 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
« src/x64/lithium-codegen-x64.h ('K') | « test/cctest/test-log-stack-tracer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-macro-assembler-x64.cc
diff --git a/test/cctest/test-macro-assembler-x64.cc b/test/cctest/test-macro-assembler-x64.cc
index a2070a5ea8fa7cfe99dc1689e0415de6b5bee00e..b04a24bc2d33c6a298c4849619050e9d86310751 100644
--- a/test/cctest/test-macro-assembler-x64.cc
+++ b/test/cctest/test-macro-assembler-x64.cc
@@ -886,6 +886,7 @@ static void SmiSubTest(MacroAssembler* masm,
__ j(not_equal, exit);
}
+
static void SmiSubOverflowTest(MacroAssembler* masm,
Label* exit,
int id,
@@ -1041,7 +1042,6 @@ TEST(SmiSub) {
}
-
void TestSmiMul(MacroAssembler* masm, Label* exit, int id, int x, int y) {
int64_t result = static_cast<int64_t>(x) * static_cast<int64_t>(y);
bool negative_zero = (result == 0) && (x < 0 || y < 0);
@@ -1831,6 +1831,7 @@ void TestSmiShiftLeft(MacroAssembler* masm, Label* exit, int id, int x) {
// rax == id + i * 10.
int shift = shifts[i];
int result = x << shift;
+#if !V8_USE_31_BITS_SMI_VALUE
CHECK(Smi::IsValid(result));
__ Move(r8, Smi::FromInt(result));
__ Move(rcx, Smi::FromInt(x));
@@ -1876,6 +1877,81 @@ void TestSmiShiftLeft(MacroAssembler* masm, Label* exit, int id, int x) {
__ j(not_equal, exit);
__ incq(rax);
+#else
+ if (Smi::IsValid(result)) {
+ __ Move(r8, Smi::FromInt(result));
+ __ Move(rcx, Smi::FromInt(x));
+ __ SmiShiftLeftConstant(r9, rcx, shift, exit);
+
+ __ incq(rax);
+ __ cmpq(r9, r8);
+ __ j(not_equal, exit);
+
+ __ incq(rax);
+ __ Move(rcx, Smi::FromInt(x));
+ __ SmiShiftLeftConstant(rcx, rcx, shift, exit);
+
+ __ incq(rax);
+ __ cmpq(rcx, r8);
+ __ j(not_equal, exit);
+
+ __ incq(rax);
+ __ Move(rdx, Smi::FromInt(x));
+ __ Move(rcx, Smi::FromInt(shift));
+ __ SmiShiftLeft(r9, rdx, rcx, exit);
+
+ __ incq(rax);
+ __ cmpq(r9, r8);
+ __ j(not_equal, exit);
+
+ __ incq(rax);
+ __ Move(rdx, Smi::FromInt(x));
+ __ Move(r11, Smi::FromInt(shift));
+ __ SmiShiftLeft(r9, rdx, r11, exit);
+
+ __ incq(rax);
+ __ cmpq(r9, r8);
+ __ j(not_equal, exit);
+
+ __ incq(rax);
+ __ Move(rdx, Smi::FromInt(x));
+ __ Move(r11, Smi::FromInt(shift));
+ __ SmiShiftLeft(rdx, rdx, r11, exit);
+
+ __ incq(rax);
+ __ cmpq(rdx, r8);
+ __ j(not_equal, exit);
+
+ __ incq(rax);
+ } else {
+ __ Move(rdx, Smi::FromInt(x));
+ __ Move(rcx, Smi::FromInt(shift));
+ __ movq(r11, rcx);
+ Label fail_ok1;
+ __ SmiShiftLeft(r9, rdx, rcx, &fail_ok1);
+ __ jmp(exit);
+ __ bind(&fail_ok1);
+
+ __ incq(rax);
+ __ cmpq(rcx, r11);
+ __ j(not_equal, exit);
+
+ __ incq(rax);
+ __ Move(rcx, Smi::FromInt(x));
+ __ Move(rdx, Smi::FromInt(shift));
+ __ movq(r11, rcx);
+ Label fail_ok2;
+ __ SmiShiftLeft(r9, rcx, rdx, &fail_ok2);
+ __ jmp(exit);
+ __ bind(&fail_ok2);
+
+ __ incq(rax);
+ __ cmpq(rcx, r11);
+ __ j(not_equal, exit);
+
+ __ addq(rax, Immediate(7));
+ }
+#endif
}
}
« src/x64/lithium-codegen-x64.h ('K') | « test/cctest/test-log-stack-tracer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698