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

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
« no previous file with comments | « runtime/vm/precompiler.cc ('k') | runtime/vm/stub_code.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/snapshot.cc
diff --git a/runtime/vm/snapshot.cc b/runtime/vm/snapshot.cc
index 294a90b7d4b41e1fb189881070d18fb40e1c4a1b..2dc84fb55569ec174919d2abe6b403451b079a2b 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(thread->zone());
+ Object& funcOrCode = Object::Handle(thread->zone());
+ Code& code = Code::Handle(thread->zone());
+ Smi& entry_point = Smi::Handle(thread->zone());
+ 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 = Smi::FromAlignedAddress(code.EntryPoint());
+ ic.SetEntryPointAt(j, entry_point);
+ }
+ }
+ }
+ }
+ }
+
+
// Validate the class table.
#if defined(DEBUG)
isolate->ValidateClassTable();
« no previous file with comments | « runtime/vm/precompiler.cc ('k') | runtime/vm/stub_code.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698