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

Unified Diff: runtime/vm/snapshot.cc

Issue 1799793002: Precompilation: Have instances calls load the entry point and Code object from the ic data array in… (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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/snapshot.cc
diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc
index 294a90b7d4b41e1fb189881070d18fb40e1c4a1b..bf27ca602294f082d13220aab98e764b8e5fb465 100644
--- a/runtime/vm/snapshot.cc
+++ b/runtime/vm/snapshot.cc
@@ -627,6 +627,27 @@ RawApiError* SnapshotReader::ReadFullSnapshot() {
}
}
+ if (snapshot_code()) {
+ ICData& ic = ICData::Handle();
srdjan 2016/03/15 19:15:48 Get zone (thread->zone()) and use it for handle cr
rmacnak 2016/03/16 18:21:32 Done.
+ Object& funcOrCode = Object::Handle();
+ Code& code = Code::Handle();
+ Smi& entry_point = Smi::Handle();
+ for (intptr_t i = 0; i < backward_references_->length(); i++) {
+ if ((*backward_references_)[i].reference()->IsICData()) {
+ ic ^= (*backward_references_)[i].reference()->raw();
+ for (intptr_t j = 0; j < ic.NumberOfChecks(); j++) {
+ funcOrCode = ic.GetTargetOrCodeAt(j);
+ if (funcOrCode.IsCode()) {
+ code ^= funcOrCode.raw();
+ entry_point = reinterpret_cast<RawSmi*>(code.EntryPoint());
+ ic.SetEntryPointAt(j, entry_point);
+ }
+ }
+ }
+ }
+ }
+
+
// Validate the class table.
#if defined(DEBUG)
isolate->ValidateClassTable();

Powered by Google App Engine
This is Rietveld 408576698