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

Unified Diff: runtime/vm/stub_code_arm.cc

Issue 1295823003: VM: Cache instructions entry point in RawFunction/RawCode. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 4 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/raw_object.h ('k') | runtime/vm/stub_code_arm64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_arm.cc
diff --git a/runtime/vm/stub_code_arm.cc b/runtime/vm/stub_code_arm.cc
index 153f705ca7fe615615fb1e7676cbff2e02433f9a..01f2e34542e441146b2b4ec6592cc9570ac24747 100644
--- a/runtime/vm/stub_code_arm.cc
+++ b/runtime/vm/stub_code_arm.cc
@@ -311,8 +311,7 @@ void StubCode::GenerateCallStaticFunctionStub(Assembler* assembler) {
// Remove the stub frame.
__ LeaveStubFrame();
// Jump to the dart function.
- __ ldr(R0, FieldAddress(R0, Code::instructions_offset()));
- __ AddImmediate(R0, R0, Instructions::HeaderSize() - kHeapObjectTag);
+ __ ldr(R0, FieldAddress(R0, Code::entry_point_offset()));
__ bx(R0);
}
@@ -333,8 +332,7 @@ void StubCode::GenerateFixCallersTargetStub(Assembler* assembler) {
// Remove the stub frame.
__ LeaveStubFrame();
// Jump to the dart function.
- __ ldr(R0, FieldAddress(R0, Code::instructions_offset()));
- __ AddImmediate(R0, R0, Instructions::HeaderSize() - kHeapObjectTag);
+ __ ldr(R0, FieldAddress(R0, Code::entry_point_offset()));
__ bx(R0);
}
@@ -352,8 +350,7 @@ void StubCode::GenerateFixAllocationStubTargetStub(Assembler* assembler) {
// Remove the stub frame.
__ LeaveStubFrame();
// Jump to the dart function.
- __ ldr(R0, FieldAddress(R0, Code::instructions_offset()));
- __ AddImmediate(R0, R0, Instructions::HeaderSize() - kHeapObjectTag);
+ __ ldr(R0, FieldAddress(R0, Code::entry_point_offset()));
__ bx(R0);
}
@@ -585,8 +582,7 @@ void StubCode::GenerateMegamorphicMissStub(Assembler* assembler) {
}
// Tail-call to target function.
- __ ldr(R2, FieldAddress(R0, Function::instructions_offset()));
- __ AddImmediate(R2, Instructions::HeaderSize() - kHeapObjectTag);
+ __ ldr(R2, FieldAddress(R0, Function::entry_point_offset()));
__ bx(R2);
}
@@ -1470,8 +1466,7 @@ void StubCode::GenerateNArgsCheckInlineCacheStub(
__ Comment("Call target");
__ Bind(&call_target_function);
// R0: target function.
- __ ldr(R2, FieldAddress(R0, Function::instructions_offset()));
- __ AddImmediate(R2, Instructions::HeaderSize() - kHeapObjectTag);
+ __ ldr(R2, FieldAddress(R0, Function::entry_point_offset()));
if (range_collection_mode == kCollectRanges) {
__ ldr(R1, Address(SP, 0 * kWordSize));
if (num_args == 2) {
@@ -1651,11 +1646,7 @@ void StubCode::GenerateZeroArgsUnoptimizedStaticCallStub(Assembler* assembler) {
// Get function and call it, if possible.
__ LoadFromOffset(kWord, R0, R6, target_offset);
- __ ldr(R2, FieldAddress(R0, Function::instructions_offset()));
-
- // R0: function.
- // R2: target instructions.
- __ AddImmediate(R2, Instructions::HeaderSize() - kHeapObjectTag);
+ __ ldr(R2, FieldAddress(R0, Function::entry_point_offset()));
__ bx(R2);
if (FLAG_support_debugger) {
@@ -1700,8 +1691,7 @@ void StubCode::GenerateLazyCompileStub(Assembler* assembler) {
__ PopList((1 << R4) | (1 << R5)); // Restore arg desc. and IC data.
__ LeaveStubFrame();
- __ ldr(R2, FieldAddress(R0, Function::instructions_offset()));
- __ AddImmediate(R2, Instructions::HeaderSize() - kHeapObjectTag);
+ __ ldr(R2, FieldAddress(R0, Function::entry_point_offset()));
__ bx(R2);
}
@@ -1906,8 +1896,7 @@ void StubCode::GenerateOptimizeFunctionStub(Assembler* assembler) {
__ Pop(R0); // Discard argument.
__ Pop(R0); // Get Code object
__ Pop(R4); // Restore argument descriptor.
- __ ldr(R0, FieldAddress(R0, Code::instructions_offset()));
- __ AddImmediate(R0, Instructions::HeaderSize() - kHeapObjectTag);
+ __ ldr(R0, FieldAddress(R0, Code::entry_point_offset()));
__ LeaveStubFrame();
__ bx(R0);
__ bkpt(0);
@@ -2069,10 +2058,7 @@ void StubCode::EmitMegamorphicLookup(
// be invoked as a normal Dart function.
__ add(IP, R2, Operand(R3, LSL, 2));
__ ldr(R0, FieldAddress(IP, base + kWordSize));
- __ ldr(target, FieldAddress(R0, Function::instructions_offset()));
- // TODO(srdjan): Evaluate performance impact of moving the instruction below
- // to the call site, instead of having it here.
- __ AddImmediate(target, Instructions::HeaderSize() - kHeapObjectTag);
+ __ ldr(target, FieldAddress(R0, Function::entry_point_offset()));
}
« no previous file with comments | « runtime/vm/raw_object.h ('k') | runtime/vm/stub_code_arm64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698