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

Unified Diff: runtime/vm/intermediate_language_x64.cc

Issue 1192103004: VM: New calling convention for generated code. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: fixed comments Created 5 years, 3 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/intermediate_language_mips.cc ('k') | runtime/vm/intrinsifier_arm.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/intermediate_language_x64.cc
diff --git a/runtime/vm/intermediate_language_x64.cc b/runtime/vm/intermediate_language_x64.cc
index 19fc8b3fcf4bb8883bde34513525de0706d05776..7339ef80be229e3a194c248680b682a5663d51a4 100644
--- a/runtime/vm/intermediate_language_x64.cc
+++ b/runtime/vm/intermediate_language_x64.cc
@@ -2555,7 +2555,8 @@ void CatchBlockEntryInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
needs_stacktrace());
// Restore the pool pointer.
- __ LoadPoolPointer();
+ __ RestoreCodePointer();
+ __ LoadPoolPointer(PP);
if (HasParallelMove()) {
compiler->parallel_move_resolver()->EmitNativeCode(parallel_move());
@@ -6221,10 +6222,18 @@ LocationSummary* IndirectGotoInstr::MakeLocationSummary(Zone* zone,
void IndirectGotoInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
Register offset_reg = locs()->in(0).reg();
- Register target_address_reg = locs()->temp_slot(0)->reg();
+ Register target_address_reg = locs()->temp(0).reg();
+
+ {
+ const intptr_t kRIPRelativeLeaqSize = 7;
+ const intptr_t entry_to_rip_offset =
+ __ CodeSize() + kRIPRelativeLeaqSize;
+ __ leaq(target_address_reg,
+ Address::AddressRIPRelative(-entry_to_rip_offset));
+ ASSERT(__ CodeSize() == entry_to_rip_offset);
+ }
// Load from [current frame pointer] + kPcMarkerSlotFromFp.
- __ movq(target_address_reg, Address(RBP, kPcMarkerSlotFromFp * kWordSize));
// Calculate the final absolute address.
if (offset()->definition()->representation() == kTagged) {
@@ -6343,6 +6352,7 @@ void ClosureCallInstr::EmitNativeCode(FlowGraphCompiler* compiler) {
// Function in RAX.
ASSERT(locs()->in(0).reg() == RAX);
+ __ movq(CODE_REG, FieldAddress(RAX, Function::code_offset()));
__ movq(RCX, FieldAddress(RAX, Function::entry_point_offset()));
// RAX: Function.
« no previous file with comments | « runtime/vm/intermediate_language_mips.cc ('k') | runtime/vm/intrinsifier_arm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698