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

Unified Diff: runtime/vm/stub_code.cc

Issue 1311403009: More precompiled snapshotting. (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
« no previous file with comments | « runtime/vm/stub_code.h ('k') | no next file » | 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 b073e036e817c6d67e1067b79080332b02b9dd06..65a4966f2e2f149b19b099afb2770eed18d891d4 100644
--- a/runtime/vm/stub_code.cc
+++ b/runtime/vm/stub_code.cc
@@ -10,6 +10,7 @@
#include "vm/disassembler.h"
#include "vm/flags.h"
#include "vm/object_store.h"
+#include "vm/snapshot.h"
#include "vm/virtual_memory.h"
#include "vm/visitor.h"
@@ -53,6 +54,24 @@ 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::WriteTo(SnapshotWriter* writer) {
+ // TODO(rmacnak): Consider writing only the instructions to avoid
+ // vm_isolate_is_symbolic.
+#define WRITE_STUB(name) \
+ writer->WriteObject(StubCode::name##_entry()->code());
+ VM_STUB_CODE_LIST(WRITE_STUB);
+#undef WRITE_STUB
+}
+
+
void StubCode::Init(Isolate* isolate) { }
« no previous file with comments | « runtime/vm/stub_code.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698