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

Unified Diff: runtime/vm/instructions_x64.cc

Issue 1343373003: Revert "VM: New calling convention for generated code." (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: 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/instructions_x64.h ('k') | runtime/vm/instructions_x64_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/instructions_x64.cc
diff --git a/runtime/vm/instructions_x64.cc b/runtime/vm/instructions_x64.cc
index dc691a4359893994a939ae6409da42a088e6ffc4..83f427dbb5500c8eafc9d6ed699503c06bf79812 100644
--- a/runtime/vm/instructions_x64.cc
+++ b/runtime/vm/instructions_x64.cc
@@ -11,6 +11,27 @@
namespace dart {
+intptr_t IndexFromPPLoad(uword start) {
+ int32_t offset = *reinterpret_cast<int32_t*>(start);
+ return ObjectPool::IndexFromOffset(offset);
+}
+
+
+uword JumpPattern::TargetAddress() const {
+ ASSERT(IsValid());
+ int index = IndexFromPPLoad(start() + 3);
+ return object_pool_.RawValueAt(index);
+}
+
+
+void JumpPattern::SetTargetAddress(uword target) const {
+ ASSERT(IsValid());
+ int index = IndexFromPPLoad(start() + 3);
+ object_pool_.SetRawValueAt(index, target);
+ // No need to flush the instruction cache, since the code is not modified.
+}
+
+
void ShortCallPattern::SetTargetAddress(uword target) const {
ASSERT(IsValid());
*reinterpret_cast<uint32_t*>(start() + 1) = target - start() - kLengthInBytes;
« no previous file with comments | « runtime/vm/instructions_x64.h ('k') | runtime/vm/instructions_x64_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698