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

Unified Diff: runtime/vm/raw_object_snapshot.cc

Issue 1316673005: Track which entries in the ObjectPool are native entries, and reset them when loading a precompiled… (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
Index: runtime/vm/raw_object_snapshot.cc
diff --git a/runtime/vm/raw_object_snapshot.cc b/runtime/vm/raw_object_snapshot.cc
index 13791de86ce08e556787214d9f9775b80492b2a0..06dce1270cfcef8cc55dd362cd12161f0f4d19eb 100644
--- a/runtime/vm/raw_object_snapshot.cc
+++ b/runtime/vm/raw_object_snapshot.cc
@@ -2,6 +2,7 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+#include "vm/native_entry.h"
#include "vm/object.h"
#include "vm/object_store.h"
#include "vm/snapshot.h"
@@ -1296,6 +1297,16 @@ RawObjectPool* ObjectPool::ReadFrom(SnapshotReader* reader,
result.SetRawValueAt(i, raw_value);
break;
}
+ case ObjectPool::kNativeEntry: {
+ // Read nothing. Initialize with the lazy link entry.
+ uword entry = reinterpret_cast<uword>(&NativeEntry::LinkNativeCall);
+#if defined(USING_SIMULATOR)
+ entry = Simulator::RedirectExternalReference(
+ entry, Simulator::kBootstrapNativeCall, NativeEntry::kNumArguments);
+#endif
+ result.SetRawValueAt(i, entry);
+ break;
+ }
default:
UNREACHABLE();
}
@@ -1339,6 +1350,9 @@ void RawObjectPool::WriteTo(SnapshotWriter* writer,
// TODO(rmacnak): Write symbolically.
writer->Write<intptr_t>(entry.raw_value_);
break;
+ case ObjectPool::kNativeEntry:
+ // Write nothing. Will initialize with the lazy link entry.
+ break;
default:
UNREACHABLE();
}
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/simulator_arm.cc » ('j') | runtime/vm/simulator_arm.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698