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

Unified Diff: runtime/vm/instructions_x64_test.cc

Issue 365983002: Make isolate specific stub code accessors instance methods instead (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 6 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
« no previous file with comments | « runtime/vm/instructions_mips_test.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/instructions_x64_test.cc
===================================================================
--- runtime/vm/instructions_x64_test.cc (revision 37923)
+++ runtime/vm/instructions_x64_test.cc (working copy)
@@ -15,14 +15,16 @@
#define __ assembler->
ASSEMBLER_TEST_GENERATE(Call, assembler) {
- __ call(&StubCode::InvokeDartCodeLabel());
+ StubCode* stub_code = Isolate::Current()->stub_code();
+ __ call(&stub_code->InvokeDartCodeLabel());
__ ret();
}
ASSEMBLER_TEST_RUN(Call, test) {
+ StubCode* stub_code = Isolate::Current()->stub_code();
CallPattern call(test->entry(), test->code());
- EXPECT_EQ(StubCode::InvokeDartCodeLabel().address(),
+ EXPECT_EQ(stub_code->InvokeDartCodeLabel().address(),
call.TargetAddress());
}
@@ -35,8 +37,9 @@
__ pushq(PP);
__ LoadPoolPointer(PP);
prologue_code_size = assembler->CodeSize();
- __ JmpPatchable(&StubCode::InvokeDartCodeLabel(), PP);
- __ JmpPatchable(&StubCode::AllocateArrayLabel(), PP);
+ StubCode* stub_code = Isolate::Current()->stub_code();
+ __ JmpPatchable(&stub_code->InvokeDartCodeLabel(), PP);
+ __ JmpPatchable(&stub_code->AllocateArrayLabel(), PP);
__ popq(PP);
__ ret();
}
@@ -46,6 +49,7 @@
ASSERT(prologue_code_size != -1);
const Code& code = test->code();
const Instructions& instrs = Instructions::Handle(code.instructions());
+ StubCode* stub_code = Isolate::Current()->stub_code();
bool status =
VirtualMemory::Protect(reinterpret_cast<void*>(instrs.EntryPoint()),
instrs.size(),
@@ -53,20 +57,20 @@
EXPECT(status);
JumpPattern jump1(test->entry() + prologue_code_size, test->code());
jump1.IsValid();
- EXPECT_EQ(StubCode::InvokeDartCodeLabel().address(),
+ EXPECT_EQ(stub_code->InvokeDartCodeLabel().address(),
jump1.TargetAddress());
JumpPattern jump2((test->entry() +
jump1.pattern_length_in_bytes() + prologue_code_size),
test->code());
- EXPECT_EQ(StubCode::AllocateArrayLabel().address(),
+ EXPECT_EQ(stub_code->AllocateArrayLabel().address(),
jump2.TargetAddress());
uword target1 = jump1.TargetAddress();
uword target2 = jump2.TargetAddress();
jump1.SetTargetAddress(target2);
jump2.SetTargetAddress(target1);
- EXPECT_EQ(StubCode::AllocateArrayLabel().address(),
+ EXPECT_EQ(stub_code->AllocateArrayLabel().address(),
jump1.TargetAddress());
- EXPECT_EQ(StubCode::InvokeDartCodeLabel().address(),
+ EXPECT_EQ(stub_code->InvokeDartCodeLabel().address(),
jump2.TargetAddress());
}
« no previous file with comments | « runtime/vm/instructions_mips_test.cc ('k') | runtime/vm/intermediate_language_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698