Index: runtime/vm/clustered_snapshot.cc |
diff --git a/runtime/vm/clustered_snapshot.cc b/runtime/vm/clustered_snapshot.cc |
index 40e8987152ffd60ba89b584c7bb03b295b6e89ae..9929c3d49f4a97fecd9400eb4fba79108b56bdd1 100644 |
--- a/runtime/vm/clustered_snapshot.cc |
+++ b/runtime/vm/clustered_snapshot.cc |
@@ -4466,13 +4466,13 @@ Serializer::Serializer(Thread* thread, |
uint8_t** buffer, |
ReAlloc alloc, |
intptr_t initial_size, |
- InstructionsWriter* instructions_writer) |
+ ImageWriter* image_writer) |
: StackResource(thread), |
heap_(thread->isolate()->heap()), |
zone_(thread->zone()), |
kind_(kind), |
stream_(buffer, alloc, initial_size), |
- instructions_writer_(instructions_writer), |
+ image_writer_(image_writer), |
clusters_by_cid_(NULL), |
stack_(), |
num_cids_(0), |
@@ -5280,13 +5280,12 @@ class SnapshotTokenStreamVisitor : public ObjectVisitor { |
}; |
-FullSnapshotWriter::FullSnapshotWriter( |
- Snapshot::Kind kind, |
- uint8_t** vm_snapshot_data_buffer, |
- uint8_t** isolate_snapshot_data_buffer, |
- ReAlloc alloc, |
- InstructionsWriter* vm_instructions_writer, |
- InstructionsWriter* isolate_instructions_writer) |
+FullSnapshotWriter::FullSnapshotWriter(Snapshot::Kind kind, |
+ uint8_t** vm_snapshot_data_buffer, |
+ uint8_t** isolate_snapshot_data_buffer, |
+ ReAlloc alloc, |
+ ImageWriter* vm_image_writer, |
+ ImageWriter* isolate_image_writer) |
: thread_(Thread::Current()), |
kind_(kind), |
vm_snapshot_data_buffer_(vm_snapshot_data_buffer), |
@@ -5294,8 +5293,8 @@ FullSnapshotWriter::FullSnapshotWriter( |
alloc_(alloc), |
vm_isolate_snapshot_size_(0), |
isolate_snapshot_size_(0), |
- vm_instructions_writer_(vm_instructions_writer), |
- isolate_instructions_writer_(isolate_instructions_writer), |
+ vm_image_writer_(vm_image_writer), |
+ isolate_image_writer_(isolate_image_writer), |
token_streams_(Array::Handle(zone())), |
saved_symbol_table_(Array::Handle(zone())), |
new_vm_symbol_table_(Array::Handle(zone())), |
@@ -5369,7 +5368,7 @@ intptr_t FullSnapshotWriter::WriteVMSnapshot() { |
ASSERT(vm_snapshot_data_buffer_ != NULL); |
Serializer serializer(thread(), kind_, vm_snapshot_data_buffer_, alloc_, |
- kInitialSize, vm_instructions_writer_); |
+ kInitialSize, vm_image_writer_); |
serializer.ReserveHeader(); |
serializer.WriteVersionAndFeatures(); |
@@ -5383,10 +5382,10 @@ intptr_t FullSnapshotWriter::WriteVMSnapshot() { |
clustered_vm_size_ = serializer.bytes_written(); |
if (Snapshot::IncludesCode(kind_)) { |
- vm_instructions_writer_->Write(serializer.stream(), true); |
- mapped_data_size_ += vm_instructions_writer_->data_size(); |
- mapped_instructions_size_ += vm_instructions_writer_->text_size(); |
- vm_instructions_writer_->ResetOffsets(); |
+ vm_image_writer_->Write(serializer.stream(), true); |
+ mapped_data_size_ += vm_image_writer_->data_size(); |
+ mapped_instructions_size_ += vm_image_writer_->text_size(); |
+ vm_image_writer_->ResetOffsets(); |
} |
// The clustered part + the direct mapped data part. |
@@ -5400,7 +5399,7 @@ void FullSnapshotWriter::WriteIsolateSnapshot(intptr_t num_base_objects) { |
thread(), Timeline::GetIsolateStream(), "WriteIsolateSnapshot")); |
Serializer serializer(thread(), kind_, isolate_snapshot_data_buffer_, alloc_, |
- kInitialSize, isolate_instructions_writer_); |
+ kInitialSize, isolate_image_writer_); |
ObjectStore* object_store = isolate()->object_store(); |
ASSERT(object_store != NULL); |
@@ -5413,10 +5412,10 @@ void FullSnapshotWriter::WriteIsolateSnapshot(intptr_t num_base_objects) { |
clustered_isolate_size_ = serializer.bytes_written(); |
if (Snapshot::IncludesCode(kind_)) { |
- isolate_instructions_writer_->Write(serializer.stream(), false); |
- mapped_data_size_ += isolate_instructions_writer_->data_size(); |
- mapped_instructions_size_ += isolate_instructions_writer_->text_size(); |
- isolate_instructions_writer_->ResetOffsets(); |
+ isolate_image_writer_->Write(serializer.stream(), false); |
+ mapped_data_size_ += isolate_image_writer_->data_size(); |
+ mapped_instructions_size_ += isolate_image_writer_->text_size(); |
+ isolate_image_writer_->ResetOffsets(); |
} |
// The clustered part + the direct mapped data part. |
@@ -5481,9 +5480,11 @@ RawApiError* FullSnapshotReader::ReadVMSnapshot() { |
if (Snapshot::IncludesCode(kind_)) { |
ASSERT(instructions_buffer_ != NULL); |
- thread_->isolate()->SetupInstructionsSnapshotPage(instructions_buffer_); |
+ thread_->isolate()->SetupImagePage(instructions_buffer_, |
+ /* is_executable */ true); |
ASSERT(data_buffer_ != NULL); |
- thread_->isolate()->SetupDataSnapshotPage(data_buffer_); |
+ thread_->isolate()->SetupImagePage(data_buffer_, |
+ /* is_executable */ false); |
} |
deserializer.ReadVMSnapshot(); |
@@ -5503,9 +5504,11 @@ RawApiError* FullSnapshotReader::ReadIsolateSnapshot() { |
if (Snapshot::IncludesCode(kind_)) { |
ASSERT(instructions_buffer_ != NULL); |
- thread_->isolate()->SetupInstructionsSnapshotPage(instructions_buffer_); |
+ thread_->isolate()->SetupImagePage(instructions_buffer_, |
+ /* is_executable */ true); |
ASSERT(data_buffer_ != NULL); |
- thread_->isolate()->SetupDataSnapshotPage(data_buffer_); |
+ thread_->isolate()->SetupImagePage(data_buffer_, |
+ /* is_executable */ false); |
} |
deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store()); |