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

Unified Diff: runtime/vm/stub_code.cc

Issue 2032153003: Use clustered serialization for full snapshots. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: round2 Created 4 years, 6 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/stub_code.h ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/stub_code.cc
diff --git a/runtime/vm/stub_code.cc b/runtime/vm/stub_code.cc
index 04ca4f492588582eaa5bd853e52825700a299264..a6992bffe568575ad7c41b4406fab1ae73e23e74 100644
--- a/runtime/vm/stub_code.cc
+++ b/runtime/vm/stub_code.cc
@@ -14,6 +14,7 @@
#include "vm/snapshot.h"
#include "vm/virtual_memory.h"
#include "vm/visitor.h"
+#include "vm/clustered_snapshot.h"
namespace dart {
@@ -59,24 +60,33 @@ void StubCode::InitOnce() {
#undef STUB_CODE_GENERATE
-void StubCode::ReadFrom(SnapshotReader* reader) {
-#define READ_STUB(name) \
- *(reader->CodeHandle()) ^= reader->ReadObject(); \
- name##_entry_ = new StubEntry(*(reader->CodeHandle()));
- VM_STUB_CODE_LIST(READ_STUB);
-#undef READ_STUB
+void StubCode::Push(Serializer* serializer) {
+#define WRITE_STUB(name) \
+ serializer->Push(StubCode::name##_entry()->code());
+ VM_STUB_CODE_LIST(WRITE_STUB);
+#undef WRITE_STUB
}
-void StubCode::WriteTo(SnapshotWriter* writer) {
- // TODO(rmacnak): Consider writing only the instructions to avoid
- // vm_isolate_is_symbolic.
+
+void StubCode::WriteRef(Serializer* serializer) {
#define WRITE_STUB(name) \
- writer->WriteObject(StubCode::name##_entry()->code());
+ serializer->WriteRef(StubCode::name##_entry()->code());
VM_STUB_CODE_LIST(WRITE_STUB);
#undef WRITE_STUB
}
+void StubCode::ReadRef(Deserializer* deserializer) {
+ Code& code = Code::Handle();
+#define READ_STUB(name) \
+ code ^= deserializer->ReadRef(); \
+ name##_entry_ = new StubEntry(code);
+ VM_STUB_CODE_LIST(READ_STUB);
+#undef READ_STUB
+}
+
+
+
void StubCode::Init(Isolate* isolate) { }
« no previous file with comments | « runtime/vm/stub_code.h ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698