| 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) { }
|
|
|
|
|
|
|