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

Unified Diff: runtime/vm/instructions_ia32_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_ia32_test.cc
diff --git a/runtime/vm/instructions_ia32_test.cc b/runtime/vm/instructions_ia32_test.cc
index 27c52772432da4d06361a738b2a905883a9f57e0..e82bad6572def5d67464b48b1ddd9286fa7465f6 100644
--- a/runtime/vm/instructions_ia32_test.cc
+++ b/runtime/vm/instructions_ia32_test.cc
@@ -17,25 +17,21 @@ namespace dart {
#define __ assembler->
ASSEMBLER_TEST_GENERATE(Call, assembler) {
- StubCode* stub_code = Isolate::Current()->stub_code();
- __ call(&stub_code->InvokeDartCodeLabel());
+ __ call(&StubCode::InvokeDartCodeLabel());
__ ret();
}
ASSEMBLER_TEST_RUN(Call, test) {
- StubCode* stub_code = Isolate::Current()->stub_code();
CallPattern call(test->entry());
- EXPECT_EQ(stub_code->InvokeDartCodeLabel().address(),
+ EXPECT_EQ(StubCode::InvokeDartCodeLabel().address(),
call.TargetAddress());
}
ASSEMBLER_TEST_GENERATE(Jump, assembler) {
- StubCode* stub_code = Isolate::Current()->stub_code();
- __ jmp(&stub_code->InvokeDartCodeLabel());
- const Code& array_stub = Code::Handle(stub_code->GetAllocateArrayStub());
- const ExternalLabel array_label(array_stub.EntryPoint());
+ __ jmp(&StubCode::InvokeDartCodeLabel());
+ const ExternalLabel array_label(StubCode::AllocateArrayEntryPoint());
__ jmp(&array_label);
__ ret();
}
@@ -44,18 +40,18 @@ ASSEMBLER_TEST_GENERATE(Jump, assembler) {
ASSEMBLER_TEST_RUN(Jump, test) {
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(),
VirtualMemory::kReadWrite);
EXPECT(status);
JumpPattern jump1(test->entry(), test->code());
- EXPECT_EQ(stub_code->InvokeDartCodeLabel().address(),
+ EXPECT_EQ(StubCode::InvokeDartCodeLabel().address(),
jump1.TargetAddress());
JumpPattern jump2(test->entry() + jump1.pattern_length_in_bytes(),
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();
@@ -64,7 +60,7 @@ ASSEMBLER_TEST_RUN(Jump, test) {
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