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

Unified Diff: runtime/vm/assembler_x64.cc

Issue 574843002: Fix x64 patching of asllocation stub: the pool pointer must be set-up before patching jump is execu… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 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
Index: runtime/vm/assembler_x64.cc
===================================================================
--- runtime/vm/assembler_x64.cc (revision 40325)
+++ runtime/vm/assembler_x64.cc (working copy)
@@ -3135,6 +3135,27 @@
}
+void Assembler::SetupPP(Register new_pp, Register temp_pc) {
+ Label next;
+ nop(4); // Need a fixed size sequence on frame entry.
+ call(&next);
+ Bind(&next);
+
+ const intptr_t object_pool_pc_dist =
+ Instructions::HeaderSize() - Instructions::object_pool_offset() +
+ CodeSize();
+ const intptr_t offset =
+ Assembler::EntryPointToPcMarkerOffset() - CodeSize();
+ popq(temp_pc);
+ if (offset != 0) {
+ addq(temp_pc, Immediate(offset));
+ }
+
+ // Load callee's pool pointer.
+ movq(new_pp, Address(temp_pc, -object_pool_pc_dist - offset));
+}
+
+
void Assembler::ComputeCounterAddressesForCid(intptr_t cid,
Heap::Space space,
Address* count_address,
« no previous file with comments | « runtime/vm/assembler_x64.h ('k') | runtime/vm/compiler_test.cc » ('j') | runtime/vm/stub_code.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698