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

Unified Diff: runtime/vm/stub_code_x64.cc

Issue 1314883002: VM: Use constant pool also for leaf runtime calls on x64, arm, arm64 and mips. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: use StubEntry::label directly 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/stub_code_mips.cc ('k') | runtime/vm/stub_code_x64_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code_x64.cc
diff --git a/runtime/vm/stub_code_x64.cc b/runtime/vm/stub_code_x64.cc
index ad428ae986e09bb00b5a42b7ef9f998ed94a1ce2..9d389c15601ae694bfb46ac9f08769321cfb3c17 100644
--- a/runtime/vm/stub_code_x64.cc
+++ b/runtime/vm/stub_code_x64.cc
@@ -184,7 +184,9 @@ void StubCode::GenerateCallNativeCFunctionStub(Assembler* assembler) {
__ movq(CallingConventions::kArg1Reg, RSP);
// Pass pointer to function entrypoint.
__ movq(CallingConventions::kArg2Reg, RBX);
- __ CallCFunction(&NativeEntry::NativeCallWrapperLabel());
+ __ LoadExternalLabel(
+ RAX, &NativeEntry::NativeCallWrapperLabel(), kNotPatchable);
+ __ CallCFunction(RAX);
// Mark that the isolate is executing Dart code.
__ movq(Address(R12, Isolate::vm_tag_offset()),
@@ -384,9 +386,7 @@ static void GenerateDeoptimizationSequence(Assembler* assembler,
bool preserve_result) {
// DeoptimizeCopyFrame expects a Dart frame, i.e. EnterDartFrame(0), but there
// is no need to set the correct PC marker or load PP, since they get patched.
- __ EnterFrame(0);
- __ pushq(Immediate(0));
- __ pushq(PP);
+ __ EnterStubFrame();
// The code in this frame may not cause GC. kDeoptimizeCopyFrameRuntimeEntry
// and kDeoptimizeFillFrameRuntimeEntry are leaf runtime calls.
@@ -419,7 +419,7 @@ static void GenerateDeoptimizationSequence(Assembler* assembler,
}
// There is a Dart Frame on the stack. We must restore PP and leave frame.
- __ LeaveDartFrame();
+ __ LeaveStubFrame();
__ popq(RCX); // Preserve return address.
__ movq(RSP, RBP); // Discard optimized frame.
@@ -428,9 +428,7 @@ static void GenerateDeoptimizationSequence(Assembler* assembler,
// DeoptimizeFillFrame expects a Dart frame, i.e. EnterDartFrame(0), but there
// is no need to set the correct PC marker or load PP, since they get patched.
- __ EnterFrame(0);
- __ pushq(Immediate(0));
- __ pushq(PP);
+ __ EnterStubFrame();
if (preserve_result) {
__ pushq(RBX); // Preserve result as first local.
@@ -445,7 +443,7 @@ static void GenerateDeoptimizationSequence(Assembler* assembler,
}
// Code above cannot cause GC.
// There is a Dart Frame on the stack. We must restore PP and leave frame.
- __ LeaveDartFrame();
+ __ LeaveStubFrame();
// Frame is fully rewritten at this point and it is safe to perform a GC.
// Materialize any objects that were deferred by FillFrame because they
« no previous file with comments | « runtime/vm/stub_code_mips.cc ('k') | runtime/vm/stub_code_x64_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698