aboutsummaryrefslogtreecommitdiff
path: root/deps/v8/test/cctest/test-assembler-arm.cc
diff options
context:
space:
mode:
authorBen Noordhuis <info@bnoordhuis.nl>2015-03-27 12:04:12 +0100
committerChris Dickinson <christopher.s.dickinson@gmail.com>2015-04-28 14:38:16 -0700
commit36cd5fb9d27b830320e57213f5b8829ffbb93324 (patch)
treebbab4215d26f8597019135206426fccf27a3089e /deps/v8/test/cctest/test-assembler-arm.cc
parentb57cc51d8d3f4ad279591ae8fa6584ee22773b97 (diff)
downloadandroid-node-v8-36cd5fb9d27b830320e57213f5b8829ffbb93324.tar.gz
android-node-v8-36cd5fb9d27b830320e57213f5b8829ffbb93324.tar.bz2
android-node-v8-36cd5fb9d27b830320e57213f5b8829ffbb93324.zip
deps: upgrade v8 to 4.2.77.13
This commit applies some secondary changes in order to make `make test` pass cleanly: * disable broken postmortem debugging in common.gypi * drop obsolete strict mode test in parallel/test-repl * drop obsolete test parallel/test-v8-features PR-URL: https://github.com/iojs/io.js/pull/1232 Reviewed-By: Fedor Indutny <fedor@indutny.com>
Diffstat (limited to 'deps/v8/test/cctest/test-assembler-arm.cc')
-rw-r--r--deps/v8/test/cctest/test-assembler-arm.cc224
1 files changed, 195 insertions, 29 deletions
diff --git a/deps/v8/test/cctest/test-assembler-arm.cc b/deps/v8/test/cctest/test-assembler-arm.cc
index 2bcf022482..526d4567fa 100644
--- a/deps/v8/test/cctest/test-assembler-arm.cc
+++ b/deps/v8/test/cctest/test-assembler-arm.cc
@@ -987,10 +987,10 @@ TEST(11) {
Object* dummy = CALL_GENERATED_CODE(f, &i, 0, 0, 0, 0);
USE(dummy);
- CHECK_EQ(0xabcd0001, i.a);
+ CHECK_EQ(static_cast<int32_t>(0xabcd0001), i.a);
CHECK_EQ(static_cast<int32_t>(0xabcd0000) >> 1, i.b);
CHECK_EQ(0x00000000, i.c);
- CHECK_EQ(0xffffffff, i.d);
+ CHECK_EQ(static_cast<int32_t>(0xffffffff), i.d);
}
@@ -1129,8 +1129,8 @@ TEST(13) {
CHECK_EQ(14.7610017472335499, t.i);
CHECK_EQ(16.0, t.j);
CHECK_EQ(73.8818412254460241, t.k);
- CHECK_EQ(372106121, t.low);
- CHECK_EQ(1079146608, t.high);
+ CHECK_EQ(372106121u, t.low);
+ CHECK_EQ(1079146608u, t.high);
}
}
@@ -1321,22 +1321,22 @@ TEST(15) {
t.dstA7 = 0;
Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0);
USE(dummy);
- CHECK_EQ(0x01020304, t.dst0);
- CHECK_EQ(0x11121314, t.dst1);
- CHECK_EQ(0x21222324, t.dst2);
- CHECK_EQ(0x31323334, t.dst3);
- CHECK_EQ(0x41424344, t.dst4);
- CHECK_EQ(0x51525354, t.dst5);
- CHECK_EQ(0x61626364, t.dst6);
- CHECK_EQ(0x71727374, t.dst7);
- CHECK_EQ(0x00430044, t.dstA0);
- CHECK_EQ(0x00410042, t.dstA1);
- CHECK_EQ(0x00830084, t.dstA2);
- CHECK_EQ(0x00810082, t.dstA3);
- CHECK_EQ(0x00430044, t.dstA4);
- CHECK_EQ(0x00410042, t.dstA5);
- CHECK_EQ(0x00830084, t.dstA6);
- CHECK_EQ(0x00810082, t.dstA7);
+ CHECK_EQ(0x01020304u, t.dst0);
+ CHECK_EQ(0x11121314u, t.dst1);
+ CHECK_EQ(0x21222324u, t.dst2);
+ CHECK_EQ(0x31323334u, t.dst3);
+ CHECK_EQ(0x41424344u, t.dst4);
+ CHECK_EQ(0x51525354u, t.dst5);
+ CHECK_EQ(0x61626364u, t.dst6);
+ CHECK_EQ(0x71727374u, t.dst7);
+ CHECK_EQ(0x00430044u, t.dstA0);
+ CHECK_EQ(0x00410042u, t.dstA1);
+ CHECK_EQ(0x00830084u, t.dstA2);
+ CHECK_EQ(0x00810082u, t.dstA3);
+ CHECK_EQ(0x00430044u, t.dstA4);
+ CHECK_EQ(0x00410042u, t.dstA5);
+ CHECK_EQ(0x00830084u, t.dstA6);
+ CHECK_EQ(0x00810082u, t.dstA7);
}
}
@@ -1406,11 +1406,11 @@ TEST(16) {
t.dst4 = 0;
Object* dummy = CALL_GENERATED_CODE(f, &t, 0, 0, 0, 0);
USE(dummy);
- CHECK_EQ(0x12130304, t.dst0);
- CHECK_EQ(0x01021213, t.dst1);
- CHECK_EQ(0x00010003, t.dst2);
- CHECK_EQ(0x00000003, t.dst3);
- CHECK_EQ(0x11121313, t.dst4);
+ CHECK_EQ(0x12130304u, t.dst0);
+ CHECK_EQ(0x01021213u, t.dst1);
+ CHECK_EQ(0x00010003u, t.dst2);
+ CHECK_EQ(0x00000003u, t.dst3);
+ CHECK_EQ(0x11121313u, t.dst4);
}
@@ -1542,10 +1542,10 @@ TEST(udiv) {
#endif
F3 f = FUNCTION_CAST<F3>(code->entry());
Object* dummy;
- TEST_UDIV(0, 0, 0);
- TEST_UDIV(0, 1024, 0);
- TEST_UDIV(5, 10, 2);
- TEST_UDIV(3, 10, 3);
+ TEST_UDIV(0u, 0, 0);
+ TEST_UDIV(0u, 1024, 0);
+ TEST_UDIV(5u, 10, 2);
+ TEST_UDIV(3u, 10, 3);
USE(dummy);
}
}
@@ -1885,6 +1885,172 @@ TEST(code_relative_offset) {
}
+TEST(jump_tables1) {
+ // Test jump tables with forward jumps.
+ CcTest::InitializeVM();
+ Isolate* isolate = CcTest::i_isolate();
+ HandleScope scope(isolate);
+ Assembler assm(isolate, nullptr, 0);
+
+ const int kNumCases = 512;
+ int values[kNumCases];
+ isolate->random_number_generator()->NextBytes(values, sizeof(values));
+ Label labels[kNumCases];
+
+ __ stm(db_w, sp, lr.bit());
+
+ Label done;
+ __ BlockConstPoolFor(kNumCases + 2);
+ {
+ PredictableCodeSizeScope predictable(
+ &assm, (kNumCases + 2) * Assembler::kInstrSize);
+ __ ldr(pc, MemOperand(pc, r0, LSL, 2));
+ __ nop();
+ for (int i = 0; i < kNumCases; ++i) {
+ __ dd(&labels[i]);
+ }
+ }
+
+ for (int i = 0; i < kNumCases; ++i) {
+ __ bind(&labels[i]);
+ __ mov(r0, Operand(values[i]));
+ __ b(&done);
+ }
+
+ __ bind(&done);
+ __ ldm(ia_w, sp, pc.bit());
+
+ CodeDesc desc;
+ assm.GetCode(&desc);
+ Handle<Code> code = isolate->factory()->NewCode(
+ desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
+#ifdef OBJECT_PRINT
+ code->Print(std::cout);
+#endif
+ F1 f = FUNCTION_CAST<F1>(code->entry());
+ for (int i = 0; i < kNumCases; ++i) {
+ int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, i, 0, 0, 0, 0));
+ ::printf("f(%d) = %d\n", i, res);
+ CHECK_EQ(values[i], res);
+ }
+}
+
+
+TEST(jump_tables2) {
+ // Test jump tables with backward jumps.
+ CcTest::InitializeVM();
+ Isolate* isolate = CcTest::i_isolate();
+ HandleScope scope(isolate);
+ Assembler assm(isolate, nullptr, 0);
+
+ const int kNumCases = 512;
+ int values[kNumCases];
+ isolate->random_number_generator()->NextBytes(values, sizeof(values));
+ Label labels[kNumCases];
+
+ __ stm(db_w, sp, lr.bit());
+
+ Label done, dispatch;
+ __ b(&dispatch);
+
+ for (int i = 0; i < kNumCases; ++i) {
+ __ bind(&labels[i]);
+ __ mov(r0, Operand(values[i]));
+ __ b(&done);
+ }
+
+ __ bind(&dispatch);
+ __ BlockConstPoolFor(kNumCases + 2);
+ {
+ PredictableCodeSizeScope predictable(
+ &assm, (kNumCases + 2) * Assembler::kInstrSize);
+ __ ldr(pc, MemOperand(pc, r0, LSL, 2));
+ __ nop();
+ for (int i = 0; i < kNumCases; ++i) {
+ __ dd(&labels[i]);
+ }
+ }
+
+ __ bind(&done);
+ __ ldm(ia_w, sp, pc.bit());
+
+ CodeDesc desc;
+ assm.GetCode(&desc);
+ Handle<Code> code = isolate->factory()->NewCode(
+ desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
+#ifdef OBJECT_PRINT
+ code->Print(std::cout);
+#endif
+ F1 f = FUNCTION_CAST<F1>(code->entry());
+ for (int i = 0; i < kNumCases; ++i) {
+ int res = reinterpret_cast<int>(CALL_GENERATED_CODE(f, i, 0, 0, 0, 0));
+ ::printf("f(%d) = %d\n", i, res);
+ CHECK_EQ(values[i], res);
+ }
+}
+
+
+TEST(jump_tables3) {
+ // Test jump tables with backward jumps and embedded heap objects.
+ CcTest::InitializeVM();
+ Isolate* isolate = CcTest::i_isolate();
+ HandleScope scope(isolate);
+ Assembler assm(isolate, nullptr, 0);
+
+ const int kNumCases = 256;
+ Handle<Object> values[kNumCases];
+ for (int i = 0; i < kNumCases; ++i) {
+ double value = isolate->random_number_generator()->NextDouble();
+ values[i] = isolate->factory()->NewHeapNumber(value, IMMUTABLE, TENURED);
+ }
+ Label labels[kNumCases];
+
+ __ stm(db_w, sp, lr.bit());
+
+ Label done, dispatch;
+ __ b(&dispatch);
+
+ for (int i = 0; i < kNumCases; ++i) {
+ __ bind(&labels[i]);
+ __ mov(r0, Operand(values[i]));
+ __ b(&done);
+ }
+
+ __ bind(&dispatch);
+ __ BlockConstPoolFor(kNumCases + 2);
+ {
+ PredictableCodeSizeScope predictable(
+ &assm, (kNumCases + 2) * Assembler::kInstrSize);
+ __ ldr(pc, MemOperand(pc, r0, LSL, 2));
+ __ nop();
+ for (int i = 0; i < kNumCases; ++i) {
+ __ dd(&labels[i]);
+ }
+ }
+
+ __ bind(&done);
+ __ ldm(ia_w, sp, pc.bit());
+
+ CodeDesc desc;
+ assm.GetCode(&desc);
+ Handle<Code> code = isolate->factory()->NewCode(
+ desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
+#ifdef OBJECT_PRINT
+ code->Print(std::cout);
+#endif
+ F1 f = FUNCTION_CAST<F1>(code->entry());
+ for (int i = 0; i < kNumCases; ++i) {
+ Handle<Object> result(CALL_GENERATED_CODE(f, i, 0, 0, 0, 0), isolate);
+#ifdef OBJECT_PRINT
+ ::printf("f(%d) = ", i);
+ result->Print(std::cout);
+ ::printf("\n");
+#endif
+ CHECK(values[i].is_identical_to(result));
+ }
+}
+
+
TEST(ARMv8_vrintX) {
// Test the vrintX floating point instructions.
CcTest::InitializeVM();