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

Unified Diff: test/cctest/test-assembler-mips.cc

Issue 1446343002: MIPS: Fix trampoline pool handling in MacroAssembler::BranchShort() for r6. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add missing trampoline blocking functions. Created 5 years, 1 month 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
Index: test/cctest/test-assembler-mips.cc
diff --git a/test/cctest/test-assembler-mips.cc b/test/cctest/test-assembler-mips.cc
index bd080a3b63658a1f942cab650869aacd005c4984..c718ffaaf9798f8451de0f7dd9667a3f07c8968d 100644
--- a/test/cctest/test-assembler-mips.cc
+++ b/test/cctest/test-assembler-mips.cc
@@ -5102,4 +5102,37 @@ TEST(bal) {
}
+TEST(Trampoline) {
+ if (IsMipsArchVariant(kMips32r6)) {
paul.l... 2015/11/17 19:59:45 Does this test have to be r6-only? Can we write a
balazs.kilvady 2015/11/18 12:22:53 I am thinking about it. Would be fine.
balazs.kilvady 2015/11/18 14:04:05 Fortunately this test case forces trampoline gener
+ // Private member of Assembler class.
+ static const int kMaxBranchOffset = (1 << (18 - 1)) - 1;
+
+ CcTest::InitializeVM();
+ Isolate* isolate = CcTest::i_isolate();
+ HandleScope scope(isolate);
+
+ MacroAssembler assm(isolate, NULL, 0);
+ Label done;
+ size_t nr_calls = kMaxBranchOffset / (2 * Instruction::kInstrSize) + 2;
+
+ for (size_t i = 0; i < nr_calls; ++i) {
+ __ BranchShort(&done, eq, a0, Operand(a1));
+ }
+ __ bind(&done);
+ __ Ret(USE_DELAY_SLOT);
+ __ mov(v0, zero_reg);
+
+ CodeDesc desc;
+ assm.GetCode(&desc);
+ Handle<Code> code = isolate->factory()->NewCode(
+ desc, Code::ComputeFlags(Code::STUB), Handle<Code>());
+ F2 f = FUNCTION_CAST<F2>(code->entry());
+
+ int32_t res =
+ reinterpret_cast<int32_t>(CALL_GENERATED_CODE(f, 5, 5, 0, 0, 0));
+ CHECK_EQ(res, 0);
+ }
+}
+
+
#undef __

Powered by Google App Engine
This is Rietveld 408576698