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

Unified Diff: runtime/vm/object.cc

Issue 11418046: First part of static call cleanup: store static call targets into code object, referenced by code-o… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 1 month 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/object.cc
===================================================================
--- runtime/vm/object.cc (revision 15037)
+++ runtime/vm/object.cc (working copy)
@@ -7002,6 +7002,30 @@
}
+void Code::set_static_calls_target_table(const Array& value) const {
+ StorePointer(&raw_ptr()->static_calls_target_table_, value.raw());
+}
+
+
+RawFunction* Code::GetStaticCallTargetAt(uword pc) {
+ const Code& code = Code::Handle(Code::LookupCode(pc));
+ if (!code.IsNull()) {
+ RawObject* raw_code_offset =
+ reinterpret_cast<RawObject*>(Smi::New(pc - code.EntryPoint()));
+ const Array& array =
+ Array::Handle(code.raw_ptr()->static_calls_target_table_);
+ for (intptr_t i = 0; i < array.Length(); i += 2) {
+ if (array.At(i) == raw_code_offset) {
+ Function& function = Function::Handle();
+ function ^= array.At(i + 1);
+ return function.raw();
+ }
+ }
+ }
+ return Function::null();
+}
+
+
void Code::set_resolved_static_calls(const GrowableObjectArray& val) const {
StorePointer(&raw_ptr()->resolved_static_calls_, val.raw());
}
« runtime/vm/object.h ('K') | « runtime/vm/object.h ('k') | runtime/vm/raw_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698