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

Unified Diff: runtime/vm/object.h

Issue 1377583005: Restore back pointer from Instructions to 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 | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.h
diff --git a/runtime/vm/object.h b/runtime/vm/object.h
index 8e4b24ed2981d54857c2e6d980d15e6774244fb5..934697ec3b3f7ed2a6493d5dfdf2b10aa11ea329 100644
--- a/runtime/vm/object.h
+++ b/runtime/vm/object.h
@@ -3714,6 +3714,13 @@ class Instructions : public Object {
public:
intptr_t size() const { return raw_ptr()->size_; } // Excludes HeaderSize().
+ RawCode* code() const {
+ // This should only be accessed when jitting.
+ // TODO(johnmccutchan): Remove code back pointer.
+ ASSERT(!Dart::IsRunningPrecompiledCode());
+ return raw_ptr()->code_;
+ }
+
uword EntryPoint() const {
return reinterpret_cast<uword>(raw_ptr()) + HeaderSize();
}
@@ -3752,6 +3759,10 @@ class Instructions : public Object {
StoreNonPointer(&raw_ptr()->size_, size);
}
+ void set_code(RawCode* code) const {
+ StorePointer(&raw_ptr()->code_, code);
+ }
+
// New is a private method as RawInstruction and RawCode objects should
// only be created using the Code::FinalizeCode method. This method creates
// the RawInstruction and RawCode objects, sets up the pointer offsets
« no previous file with comments | « no previous file | runtime/vm/object.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698