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

Unified Diff: test/cctest/test-assembler-mips64.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: Support all the mips revisions in cctest case. 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
« no previous file with comments | « test/cctest/test-assembler-mips.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-assembler-mips64.cc
diff --git a/test/cctest/test-assembler-mips64.cc b/test/cctest/test-assembler-mips64.cc
index 8fda0d290f43e027782b40f4ad39b0812013fdec..7de56f93607c767f3ae06bd30668ad28bd198df1 100644
--- a/test/cctest/test-assembler-mips64.cc
+++ b/test/cctest/test-assembler-mips64.cc
@@ -5492,4 +5492,35 @@ TEST(bal) {
}
+TEST(Trampoline) {
+ // 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, nullptr, 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());
+
+ int64_t res =
+ reinterpret_cast<int64_t>(CALL_GENERATED_CODE(f, 42, 42, 0, 0, 0));
+ CHECK_EQ(res, 0);
+}
+
+
#undef __
« no previous file with comments | « test/cctest/test-assembler-mips.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698