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

Unified Diff: runtime/vm/instructions_arm_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_arm_test.cc
diff --git a/runtime/vm/instructions_arm_test.cc b/runtime/vm/instructions_arm_test.cc
index dcee850ee602160795ec5ea287f536c34aad94fb..f3574acc8203162879345efae4f360577a69374a 100644
--- a/runtime/vm/instructions_arm_test.cc
+++ b/runtime/vm/instructions_arm_test.cc
@@ -16,8 +16,7 @@ namespace dart {
#define __ assembler->
ASSEMBLER_TEST_GENERATE(Call, assembler) {
- StubCode* stub_code = Isolate::Current()->stub_code();
- __ BranchLinkPatchable(&stub_code->InvokeDartCodeLabel());
+ __ BranchLinkPatchable(&StubCode::InvokeDartCodeLabel());
__ Ret();
}
@@ -28,17 +27,14 @@ ASSEMBLER_TEST_RUN(Call, test) {
// before the end of the code buffer.
CallPattern call(test->entry() + test->code().Size() - Instr::kInstrSize,
test->code());
- StubCode* stub_code = Isolate::Current()->stub_code();
- 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();
- __ BranchPatchable(&stub_code->InvokeDartCodeLabel());
- const Code& array_stub = Code::Handle(stub_code->GetAllocateArrayStub());
- const ExternalLabel array_label(array_stub.EntryPoint());
+ __ BranchPatchable(&StubCode::InvokeDartCodeLabel());
+ const ExternalLabel array_label(StubCode::AllocateArrayEntryPoint());
__ BranchPatchable(&array_label);
}
@@ -50,21 +46,21 @@ ASSEMBLER_TEST_RUN(Jump, test) {
VirtualMemory::Protect(reinterpret_cast<void*>(instrs.EntryPoint()),
instrs.size(),
VirtualMemory::kReadWrite);
- StubCode* stub_code = Isolate::Current()->stub_code();
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();
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());
}
@@ -72,11 +68,9 @@ ASSEMBLER_TEST_RUN(Jump, test) {
#if defined(USING_SIMULATOR)
ASSEMBLER_TEST_GENERATE(JumpARMv6, assembler) {
// ARMv7 is the default.
- StubCode* stub_code = Isolate::Current()->stub_code();
HostCPUFeatures::set_arm_version(ARMv6);
- __ BranchPatchable(&stub_code->InvokeDartCodeLabel());
- const Code& array_stub = Code::Handle(stub_code->GetAllocateArrayStub());
- const ExternalLabel array_label(array_stub.EntryPoint());
+ __ BranchPatchable(&StubCode::InvokeDartCodeLabel());
+ const ExternalLabel array_label(StubCode::AllocateArrayEntryPoint());
__ BranchPatchable(&array_label);
HostCPUFeatures::set_arm_version(ARMv7);
}
@@ -90,21 +84,21 @@ ASSEMBLER_TEST_RUN(JumpARMv6, test) {
VirtualMemory::Protect(reinterpret_cast<void*>(instrs.EntryPoint()),
instrs.size(),
VirtualMemory::kReadWrite);
- StubCode* stub_code = Isolate::Current()->stub_code();
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();
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());
HostCPUFeatures::set_arm_version(ARMv7);
}

Powered by Google App Engine
This is Rietveld 408576698