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

Unified Diff: runtime/vm/instructions_x64_test.cc

Issue 1247783002: Make array allocation stub shared between isolates. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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
Index: runtime/vm/instructions_x64_test.cc
diff --git a/runtime/vm/instructions_x64_test.cc b/runtime/vm/instructions_x64_test.cc
index b9e3eb237e3c258a2401b61c35442d5a266d3734..ba40c306eab851840bda41f453902665280eb1f0 100644
--- a/runtime/vm/instructions_x64_test.cc
+++ b/runtime/vm/instructions_x64_test.cc
@@ -15,8 +15,7 @@ namespace dart {
#define __ assembler->
ASSEMBLER_TEST_GENERATE(Call, assembler) {
- StubCode* stub_code = Isolate::Current()->stub_code();
- __ call(&stub_code->InvokeDartCodeLabel());
+ __ call(&StubCode::InvokeDartCodeLabel());
__ ret();
}
@@ -29,10 +28,8 @@ ASSEMBLER_TEST_GENERATE(Jump, assembler) {
__ pushq(PP);
__ LoadPoolPointer(PP);
prologue_code_size = assembler->CodeSize();
- StubCode* stub_code = Isolate::Current()->stub_code();
- __ JmpPatchable(&stub_code->InvokeDartCodeLabel(), PP);
- const Code& array_stub = Code::Handle(stub_code->GetAllocateArrayStub());
- const ExternalLabel array_label(array_stub.EntryPoint());
+ __ JmpPatchable(&StubCode::InvokeDartCodeLabel(), PP);
+ const ExternalLabel array_label(StubCode::AllocateArrayEntryPoint());
__ JmpPatchable(&array_label, PP);
__ popq(PP);
__ ret();
@@ -43,7 +40,6 @@ ASSEMBLER_TEST_RUN(Jump, test) {
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(),
@@ -51,19 +47,20 @@ ASSEMBLER_TEST_RUN(Jump, test) {
EXPECT(status);
JumpPattern jump1(test->entry() + prologue_code_size, test->code());
jump1.IsValid();
- EXPECT_EQ(stub_code->InvokeDartCodeLabel().address(),
+ EXPECT_EQ(StubCode::InvokeDartCodeLabel().address(),
jump1.TargetAddress());
JumpPattern jump2((test->entry() +
jump1.pattern_length_in_bytes() + prologue_code_size),
test->code());
- const Code& array_stub = Code::Handle(stub_code->GetAllocateArrayStub());
+ const Code& array_stub =
+ Code::Handle(StubCode::AllocateArray_entry()->code());
EXPECT_EQ(array_stub.EntryPoint(), jump2.TargetAddress());
uword target1 = jump1.TargetAddress();
uword target2 = jump2.TargetAddress();
jump1.SetTargetAddress(target2);
jump2.SetTargetAddress(target1);
EXPECT_EQ(array_stub.EntryPoint(), jump1.TargetAddress());
- EXPECT_EQ(stub_code->InvokeDartCodeLabel().address(),
+ EXPECT_EQ(StubCode::InvokeDartCodeLabel().address(),
jump2.TargetAddress());
}

Powered by Google App Engine
This is Rietveld 408576698