OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 #include "vm/clustered_snapshot.h" | 5 #include "vm/clustered_snapshot.h" |
6 | 6 |
7 #include "platform/assert.h" | 7 #include "platform/assert.h" |
8 #include "vm/bootstrap.h" | 8 #include "vm/bootstrap.h" |
9 #include "vm/class_finalizer.h" | 9 #include "vm/class_finalizer.h" |
10 #include "vm/dart.h" | 10 #include "vm/dart.h" |
(...skipping 4768 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4779 AddBaseObject(table->At(kVoidCid)); | 4779 AddBaseObject(table->At(kVoidCid)); |
4780 | 4780 |
4781 if (!Snapshot::IncludesCode(kind_)) { | 4781 if (!Snapshot::IncludesCode(kind_)) { |
4782 for (intptr_t i = 0; i < StubCode::NumEntries(); i++) { | 4782 for (intptr_t i = 0; i < StubCode::NumEntries(); i++) { |
4783 AddBaseObject(StubCode::EntryAt(i)->code()); | 4783 AddBaseObject(StubCode::EntryAt(i)->code()); |
4784 } | 4784 } |
4785 } | 4785 } |
4786 } | 4786 } |
4787 | 4787 |
4788 intptr_t Serializer::WriteVMSnapshot(const Array& symbols, | 4788 intptr_t Serializer::WriteVMSnapshot(const Array& symbols, |
4789 const Array& scripts) { | 4789 ZoneGrowableArray<Object*>* seed_objects, |
| 4790 ZoneGrowableArray<Code*>* seed_code) { |
4790 NoSafepointScope no_safepoint; | 4791 NoSafepointScope no_safepoint; |
4791 | 4792 |
4792 AddVMIsolateBaseObjects(); | 4793 AddVMIsolateBaseObjects(); |
4793 | 4794 |
4794 // Push roots. | 4795 // Push roots. |
4795 Push(symbols.raw()); | 4796 Push(symbols.raw()); |
4796 Push(scripts.raw()); | |
4797 if (Snapshot::IncludesCode(kind_)) { | 4797 if (Snapshot::IncludesCode(kind_)) { |
4798 for (intptr_t i = 0; i < StubCode::NumEntries(); i++) { | 4798 for (intptr_t i = 0; i < StubCode::NumEntries(); i++) { |
4799 Push(StubCode::EntryAt(i)->code()); | 4799 Push(StubCode::EntryAt(i)->code()); |
4800 } | 4800 } |
4801 } | 4801 } |
| 4802 if (seed_objects != NULL) { |
| 4803 for (intptr_t i = 0; i < seed_objects->length(); i++) { |
| 4804 Push((*seed_objects)[i]->raw()); |
| 4805 } |
| 4806 } |
| 4807 if (seed_code != NULL) { |
| 4808 for (intptr_t i = 0; i < seed_code->length(); i++) { |
| 4809 Code* code = (*seed_code)[i]; |
| 4810 GetTextOffset(code->instructions(), code->raw()); |
| 4811 } |
| 4812 } |
4802 | 4813 |
4803 Serialize(); | 4814 Serialize(); |
4804 | 4815 |
4805 // Write roots. | 4816 // Write roots. |
4806 WriteRef(symbols.raw()); | 4817 WriteRef(symbols.raw()); |
4807 WriteRef(scripts.raw()); | |
4808 if (Snapshot::IncludesCode(kind_)) { | 4818 if (Snapshot::IncludesCode(kind_)) { |
4809 for (intptr_t i = 0; i < StubCode::NumEntries(); i++) { | 4819 for (intptr_t i = 0; i < StubCode::NumEntries(); i++) { |
4810 WriteRef(StubCode::EntryAt(i)->code()); | 4820 WriteRef(StubCode::EntryAt(i)->code()); |
4811 } | 4821 } |
4812 } | 4822 } |
4813 | 4823 |
4814 #if defined(DEBUG) | 4824 #if defined(DEBUG) |
4815 Write<int32_t>(kSectionMarker); | 4825 Write<int32_t>(kSectionMarker); |
4816 #endif | 4826 #endif |
4817 | 4827 |
4818 // Note we are not clearing the object id table. The full ref table | 4828 // Note we are not clearing the object id table. The full ref table |
4819 // of the vm isolate snapshot serves as the base objects for the | 4829 // of the vm isolate snapshot serves as the base objects for the |
4820 // regular isolate snapshot. | 4830 // regular isolate snapshot. |
4821 | 4831 |
4822 // Return the number of objects, -1 accounts for unused ref 0. | 4832 // Return the number of objects, -1 accounts for unused ref 0. |
4823 return next_ref_index_ - 1; | 4833 return next_ref_index_ - 1; |
4824 } | 4834 } |
4825 | 4835 |
| 4836 // Collects Instructions from the VM isolate and adds them to object id table |
| 4837 // with offsets that will refer to the VM snapshot, causing them to be shared |
| 4838 // across isolates. |
| 4839 class SeedInstructionsVisitor : public ObjectVisitor { |
| 4840 public: |
| 4841 SeedInstructionsVisitor(uword text_base, Heap* heap) |
| 4842 : text_base_(text_base), heap_(heap) {} |
| 4843 |
| 4844 void VisitObject(RawObject* obj) { |
| 4845 if (obj->IsInstructions()) { |
| 4846 uword addr = reinterpret_cast<uword>(obj) - kHeapObjectTag; |
| 4847 int32_t offset = addr - text_base_; |
| 4848 heap_->SetObjectId(obj, -offset); |
| 4849 } |
| 4850 } |
| 4851 |
| 4852 private: |
| 4853 uword text_base_; |
| 4854 Heap* heap_; |
| 4855 }; |
| 4856 |
4826 void Serializer::WriteIsolateSnapshot(intptr_t num_base_objects, | 4857 void Serializer::WriteIsolateSnapshot(intptr_t num_base_objects, |
4827 ObjectStore* object_store) { | 4858 ObjectStore* object_store) { |
4828 NoSafepointScope no_safepoint; | 4859 NoSafepointScope no_safepoint; |
4829 | 4860 |
4830 if (num_base_objects == 0) { | 4861 if (num_base_objects == 0) { |
4831 // Units tests not writing a new vm isolate. | 4862 // Not writing a new vm isolate: use the one this VM was loaded from. |
4832 const Array& base_objects = Object::vm_isolate_snapshot_object_table(); | 4863 const Array& base_objects = Object::vm_isolate_snapshot_object_table(); |
4833 for (intptr_t i = 1; i < base_objects.Length(); i++) { | 4864 for (intptr_t i = 1; i < base_objects.Length(); i++) { |
4834 AddBaseObject(base_objects.At(i)); | 4865 AddBaseObject(base_objects.At(i)); |
4835 } | 4866 } |
| 4867 const uint8_t* text_base = Dart::vm_snapshot_instructions(); |
| 4868 if (text_base != NULL) { |
| 4869 SeedInstructionsVisitor visitor(reinterpret_cast<uword>(text_base), |
| 4870 heap_); |
| 4871 Dart::vm_isolate()->heap()->VisitObjectsImagePages(&visitor); |
| 4872 } |
4836 } else { | 4873 } else { |
4837 // Base objects carried over from WriteVMIsolateSnapshot. | 4874 // Base objects carried over from WriteVMIsolateSnapshot. |
4838 num_base_objects_ += num_base_objects; | 4875 num_base_objects_ += num_base_objects; |
4839 next_ref_index_ += num_base_objects; | 4876 next_ref_index_ += num_base_objects; |
4840 } | 4877 } |
4841 | 4878 |
4842 // Push roots. | 4879 // Push roots. |
4843 RawObject** from = object_store->from(); | 4880 RawObject** from = object_store->from(); |
4844 RawObject** to = object_store->to_snapshot(kind_); | 4881 RawObject** to = object_store->to_snapshot(kind_); |
4845 for (RawObject** p = from; p <= to; p++) { | 4882 for (RawObject** p = from; p <= to; p++) { |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5188 NoSafepointScope no_safepoint; | 5225 NoSafepointScope no_safepoint; |
5189 HeapLocker hl(thread(), heap_->old_space()); | 5226 HeapLocker hl(thread(), heap_->old_space()); |
5190 | 5227 |
5191 AddVMIsolateBaseObjects(); | 5228 AddVMIsolateBaseObjects(); |
5192 | 5229 |
5193 Deserialize(); | 5230 Deserialize(); |
5194 | 5231 |
5195 // Read roots. | 5232 // Read roots. |
5196 symbol_table ^= ReadRef(); | 5233 symbol_table ^= ReadRef(); |
5197 isolate()->object_store()->set_symbol_table(symbol_table); | 5234 isolate()->object_store()->set_symbol_table(symbol_table); |
5198 ReadRef(); // Script list. | |
5199 if (Snapshot::IncludesCode(kind_)) { | 5235 if (Snapshot::IncludesCode(kind_)) { |
5200 Code& code = Code::Handle(zone_); | 5236 Code& code = Code::Handle(zone_); |
5201 for (intptr_t i = 0; i < StubCode::NumEntries(); i++) { | 5237 for (intptr_t i = 0; i < StubCode::NumEntries(); i++) { |
5202 code ^= ReadRef(); | 5238 code ^= ReadRef(); |
5203 StubCode::EntryAtPut(i, new StubEntry(code)); | 5239 StubCode::EntryAtPut(i, new StubEntry(code)); |
5204 } | 5240 } |
5205 } | 5241 } |
5206 | 5242 |
5207 #if defined(DEBUG) | 5243 #if defined(DEBUG) |
5208 int32_t section_marker = Read<int32_t>(); | 5244 int32_t section_marker = Read<int32_t>(); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5269 thread(), Timeline::GetIsolateStream(), "PostLoad")); | 5305 thread(), Timeline::GetIsolateStream(), "PostLoad")); |
5270 for (intptr_t i = 0; i < num_clusters_; i++) { | 5306 for (intptr_t i = 0; i < num_clusters_; i++) { |
5271 clusters_[i]->PostLoad(refs, kind_, zone_); | 5307 clusters_[i]->PostLoad(refs, kind_, zone_); |
5272 } | 5308 } |
5273 } | 5309 } |
5274 | 5310 |
5275 // Setup native resolver for bootstrap impl. | 5311 // Setup native resolver for bootstrap impl. |
5276 Bootstrap::SetupNativeResolver(); | 5312 Bootstrap::SetupNativeResolver(); |
5277 } | 5313 } |
5278 | 5314 |
5279 // An object visitor which will iterate over all the token stream objects in the | 5315 // An object visitor which iterates the heap looking for objects to write into |
5280 // heap and either count them or collect them into an array. This is used during | 5316 // the VM isolate's snapshot, causing them to be shared across isolates. |
5281 // full snapshot generation of the VM isolate to write out all token streams so | 5317 class SeedVMIsolateVisitor : public ObjectVisitor { |
5282 // they will be shared across all isolates. | |
5283 class SnapshotTokenStreamVisitor : public ObjectVisitor { | |
5284 public: | 5318 public: |
5285 explicit SnapshotTokenStreamVisitor(Thread* thread) | 5319 SeedVMIsolateVisitor(Zone* zone, bool include_code) |
5286 : objHandle_(Object::Handle(thread->zone())), | 5320 : zone_(zone), |
5287 count_(0), | 5321 include_code_(include_code), |
5288 token_streams_(NULL) {} | 5322 objects_(new (zone) ZoneGrowableArray<Object*>(4 * KB)), |
5289 | 5323 code_(new (zone) ZoneGrowableArray<Code*>(4 * KB)) {} |
5290 SnapshotTokenStreamVisitor(Thread* thread, const Array* token_streams) | |
5291 : objHandle_(Object::Handle(thread->zone())), | |
5292 count_(0), | |
5293 token_streams_(token_streams) {} | |
5294 | 5324 |
5295 void VisitObject(RawObject* obj) { | 5325 void VisitObject(RawObject* obj) { |
5296 if (obj->IsTokenStream()) { | 5326 if (obj->IsTokenStream()) { |
5297 if (token_streams_ != NULL) { | 5327 objects_->Add(&Object::Handle(zone_, obj)); |
5298 objHandle_ = obj; | 5328 } else if (include_code_) { |
5299 token_streams_->SetAt(count_, objHandle_); | 5329 if (obj->IsStackMap() || obj->IsPcDescriptors() || |
| 5330 obj->IsCodeSourceMap()) { |
| 5331 objects_->Add(&Object::Handle(zone_, obj)); |
| 5332 } else if (obj->IsCode()) { |
| 5333 code_->Add(&Code::Handle(zone_, Code::RawCast(obj))); |
5300 } | 5334 } |
5301 count_ += 1; | |
5302 } | 5335 } |
5303 } | 5336 } |
5304 | 5337 |
5305 intptr_t count() const { return count_; } | 5338 ZoneGrowableArray<Object*>* objects() { return objects_; } |
| 5339 ZoneGrowableArray<Code*>* code() { return code_; } |
5306 | 5340 |
5307 private: | 5341 private: |
5308 Object& objHandle_; | 5342 Zone* zone_; |
5309 intptr_t count_; | 5343 bool include_code_; |
5310 const Array* token_streams_; | 5344 ZoneGrowableArray<Object*>* objects_; |
| 5345 ZoneGrowableArray<Code*>* code_; |
5311 }; | 5346 }; |
5312 | 5347 |
5313 FullSnapshotWriter::FullSnapshotWriter(Snapshot::Kind kind, | 5348 FullSnapshotWriter::FullSnapshotWriter(Snapshot::Kind kind, |
5314 uint8_t** vm_snapshot_data_buffer, | 5349 uint8_t** vm_snapshot_data_buffer, |
5315 uint8_t** isolate_snapshot_data_buffer, | 5350 uint8_t** isolate_snapshot_data_buffer, |
5316 ReAlloc alloc, | 5351 ReAlloc alloc, |
5317 ImageWriter* vm_image_writer, | 5352 ImageWriter* vm_image_writer, |
5318 ImageWriter* isolate_image_writer) | 5353 ImageWriter* isolate_image_writer) |
5319 : thread_(Thread::Current()), | 5354 : thread_(Thread::Current()), |
5320 kind_(kind), | 5355 kind_(kind), |
5321 vm_snapshot_data_buffer_(vm_snapshot_data_buffer), | 5356 vm_snapshot_data_buffer_(vm_snapshot_data_buffer), |
5322 isolate_snapshot_data_buffer_(isolate_snapshot_data_buffer), | 5357 isolate_snapshot_data_buffer_(isolate_snapshot_data_buffer), |
5323 alloc_(alloc), | 5358 alloc_(alloc), |
5324 vm_isolate_snapshot_size_(0), | 5359 vm_isolate_snapshot_size_(0), |
5325 isolate_snapshot_size_(0), | 5360 isolate_snapshot_size_(0), |
5326 vm_image_writer_(vm_image_writer), | 5361 vm_image_writer_(vm_image_writer), |
5327 isolate_image_writer_(isolate_image_writer), | 5362 isolate_image_writer_(isolate_image_writer), |
5328 token_streams_(Array::Handle(zone())), | 5363 seed_objects_(NULL), |
| 5364 seed_code_(NULL), |
5329 saved_symbol_table_(Array::Handle(zone())), | 5365 saved_symbol_table_(Array::Handle(zone())), |
5330 new_vm_symbol_table_(Array::Handle(zone())), | 5366 new_vm_symbol_table_(Array::Handle(zone())), |
5331 clustered_vm_size_(0), | 5367 clustered_vm_size_(0), |
5332 clustered_isolate_size_(0), | 5368 clustered_isolate_size_(0), |
5333 mapped_data_size_(0), | 5369 mapped_data_size_(0), |
5334 mapped_instructions_size_(0) { | 5370 mapped_instructions_size_(0) { |
5335 ASSERT(alloc_ != NULL); | 5371 ASSERT(alloc_ != NULL); |
5336 ASSERT(isolate() != NULL); | 5372 ASSERT(isolate() != NULL); |
5337 ASSERT(ClassFinalizer::AllClassesFinalized()); | 5373 ASSERT(ClassFinalizer::AllClassesFinalized()); |
5338 ASSERT(isolate() != NULL); | 5374 ASSERT(isolate() != NULL); |
(...skipping 10 matching lines...) Expand all Loading... |
5349 | 5385 |
5350 // TODO(rmacnak): The special case for AOT causes us to always generate the | 5386 // TODO(rmacnak): The special case for AOT causes us to always generate the |
5351 // same VM isolate snapshot for every app. AOT snapshots should be cleaned up | 5387 // same VM isolate snapshot for every app. AOT snapshots should be cleaned up |
5352 // so the VM isolate snapshot is generated separately and each app is | 5388 // so the VM isolate snapshot is generated separately and each app is |
5353 // generated from a VM that has loaded this snapshots, much like app-jit | 5389 // generated from a VM that has loaded this snapshots, much like app-jit |
5354 // snapshots. | 5390 // snapshots. |
5355 if ((vm_snapshot_data_buffer != NULL) && (kind != Snapshot::kFullAOT)) { | 5391 if ((vm_snapshot_data_buffer != NULL) && (kind != Snapshot::kFullAOT)) { |
5356 NOT_IN_PRODUCT(TimelineDurationScope tds( | 5392 NOT_IN_PRODUCT(TimelineDurationScope tds( |
5357 thread(), Timeline::GetIsolateStream(), "PrepareNewVMIsolate")); | 5393 thread(), Timeline::GetIsolateStream(), "PrepareNewVMIsolate")); |
5358 | 5394 |
5359 // Collect all the token stream objects into an array so that we can write | 5395 HeapIterationScope iteration(thread()); |
5360 // it out as part of the VM isolate snapshot. We first count the number of | 5396 SeedVMIsolateVisitor visitor(thread()->zone(), |
5361 // token streams, allocate an array and then fill it up with the token | 5397 Snapshot::IncludesCode(kind)); |
5362 // streams. | 5398 iteration.IterateObjects(&visitor); |
5363 { | 5399 iteration.IterateVMIsolateObjects(&visitor); |
5364 HeapIterationScope iteration(thread()); | 5400 seed_objects_ = visitor.objects(); |
5365 SnapshotTokenStreamVisitor token_streams_counter(thread()); | 5401 seed_code_ = visitor.code(); |
5366 iteration.IterateObjects(&token_streams_counter); | |
5367 iteration.IterateVMIsolateObjects(&token_streams_counter); | |
5368 intptr_t count = token_streams_counter.count(); | |
5369 token_streams_ = Array::New(count, Heap::kOld); | |
5370 SnapshotTokenStreamVisitor script_visitor(thread(), &token_streams_); | |
5371 iteration.IterateObjects(&script_visitor); | |
5372 iteration.IterateVMIsolateObjects(&script_visitor); | |
5373 ASSERT(script_visitor.count() == count); | |
5374 } | |
5375 | 5402 |
5376 // Tuck away the current symbol table. | 5403 // Tuck away the current symbol table. |
5377 saved_symbol_table_ = object_store->symbol_table(); | 5404 saved_symbol_table_ = object_store->symbol_table(); |
5378 | 5405 |
5379 // Create a unified symbol table that will be written as the vm isolate's | 5406 // Create a unified symbol table that will be written as the vm isolate's |
5380 // symbol table. | 5407 // symbol table. |
5381 new_vm_symbol_table_ = Symbols::UnifiedSymbolTable(); | 5408 new_vm_symbol_table_ = Symbols::UnifiedSymbolTable(); |
5382 | 5409 |
5383 // Create an empty symbol table that will be written as the isolate's symbol | 5410 // Create an empty symbol table that will be written as the isolate's symbol |
5384 // table. | 5411 // table. |
5385 Symbols::SetupSymbolTable(isolate()); | 5412 Symbols::SetupSymbolTable(isolate()); |
5386 } else { | 5413 } else { |
5387 // Reuse the current vm isolate. | 5414 // Reuse the current vm isolate. |
5388 saved_symbol_table_ = object_store->symbol_table(); | 5415 saved_symbol_table_ = object_store->symbol_table(); |
5389 new_vm_symbol_table_ = Dart::vm_isolate()->object_store()->symbol_table(); | 5416 new_vm_symbol_table_ = Dart::vm_isolate()->object_store()->symbol_table(); |
5390 } | 5417 } |
5391 } | 5418 } |
5392 | 5419 |
5393 FullSnapshotWriter::~FullSnapshotWriter() { | 5420 FullSnapshotWriter::~FullSnapshotWriter() { |
5394 // We may run Dart code afterwards, restore the symbol table if needed. | 5421 // We may run Dart code afterwards, restore the symbol table if needed. |
5395 if (!saved_symbol_table_.IsNull()) { | 5422 if (!saved_symbol_table_.IsNull()) { |
5396 isolate()->object_store()->set_symbol_table(saved_symbol_table_); | 5423 isolate()->object_store()->set_symbol_table(saved_symbol_table_); |
5397 saved_symbol_table_ = Array::null(); | 5424 saved_symbol_table_ = Array::null(); |
5398 } | 5425 } |
5399 new_vm_symbol_table_ = Array::null(); | 5426 new_vm_symbol_table_ = Array::null(); |
5400 token_streams_ = Array::null(); | |
5401 } | 5427 } |
5402 | 5428 |
5403 intptr_t FullSnapshotWriter::WriteVMSnapshot() { | 5429 intptr_t FullSnapshotWriter::WriteVMSnapshot() { |
5404 NOT_IN_PRODUCT(TimelineDurationScope tds( | 5430 NOT_IN_PRODUCT(TimelineDurationScope tds( |
5405 thread(), Timeline::GetIsolateStream(), "WriteVMSnapshot")); | 5431 thread(), Timeline::GetIsolateStream(), "WriteVMSnapshot")); |
5406 | 5432 |
5407 ASSERT(vm_snapshot_data_buffer_ != NULL); | 5433 ASSERT(vm_snapshot_data_buffer_ != NULL); |
5408 Serializer serializer(thread(), kind_, vm_snapshot_data_buffer_, alloc_, | 5434 Serializer serializer(thread(), kind_, vm_snapshot_data_buffer_, alloc_, |
5409 kInitialSize, vm_image_writer_); | 5435 kInitialSize, vm_image_writer_); |
5410 | 5436 |
5411 serializer.ReserveHeader(); | 5437 serializer.ReserveHeader(); |
5412 serializer.WriteVersionAndFeatures(); | 5438 serializer.WriteVersionAndFeatures(); |
5413 // VM snapshot roots are: | 5439 // VM snapshot roots are: |
5414 // - the symbol table | 5440 // - the symbol table |
5415 // - all the token streams | 5441 // - all the token streams |
5416 // - the stub code (precompiled snapshots only) | 5442 // - the stub code (precompiled snapshots only) |
5417 intptr_t num_objects = | 5443 intptr_t num_objects = serializer.WriteVMSnapshot(new_vm_symbol_table_, |
5418 serializer.WriteVMSnapshot(new_vm_symbol_table_, token_streams_); | 5444 seed_objects_, seed_code_); |
5419 serializer.FillHeader(serializer.kind()); | 5445 serializer.FillHeader(serializer.kind()); |
5420 clustered_vm_size_ = serializer.bytes_written(); | 5446 clustered_vm_size_ = serializer.bytes_written(); |
5421 | 5447 |
5422 if (Snapshot::IncludesCode(kind_)) { | 5448 if (Snapshot::IncludesCode(kind_)) { |
5423 vm_image_writer_->Write(serializer.stream(), true); | 5449 vm_image_writer_->Write(serializer.stream(), true); |
5424 mapped_data_size_ += vm_image_writer_->data_size(); | 5450 mapped_data_size_ += vm_image_writer_->data_size(); |
5425 mapped_instructions_size_ += vm_image_writer_->text_size(); | 5451 mapped_instructions_size_ += vm_image_writer_->text_size(); |
5426 vm_image_writer_->ResetOffsets(); | 5452 vm_image_writer_->ResetOffsets(); |
5427 } | 5453 } |
5428 | 5454 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5513 return error; | 5539 return error; |
5514 } | 5540 } |
5515 | 5541 |
5516 if (Snapshot::IncludesCode(kind_)) { | 5542 if (Snapshot::IncludesCode(kind_)) { |
5517 ASSERT(instructions_buffer_ != NULL); | 5543 ASSERT(instructions_buffer_ != NULL); |
5518 thread_->isolate()->SetupImagePage(instructions_buffer_, | 5544 thread_->isolate()->SetupImagePage(instructions_buffer_, |
5519 /* is_executable */ true); | 5545 /* is_executable */ true); |
5520 ASSERT(data_buffer_ != NULL); | 5546 ASSERT(data_buffer_ != NULL); |
5521 thread_->isolate()->SetupImagePage(data_buffer_, | 5547 thread_->isolate()->SetupImagePage(data_buffer_, |
5522 /* is_executable */ false); | 5548 /* is_executable */ false); |
| 5549 Dart::set_vm_snapshot_instructions(instructions_buffer_); |
5523 } | 5550 } |
5524 | 5551 |
5525 deserializer.ReadVMSnapshot(); | 5552 deserializer.ReadVMSnapshot(); |
5526 | 5553 |
5527 return ApiError::null(); | 5554 return ApiError::null(); |
5528 } | 5555 } |
5529 | 5556 |
5530 RawApiError* FullSnapshotReader::ReadIsolateSnapshot() { | 5557 RawApiError* FullSnapshotReader::ReadIsolateSnapshot() { |
5531 Deserializer deserializer(thread_, kind_, buffer_, size_, | 5558 Deserializer deserializer(thread_, kind_, buffer_, size_, |
5532 instructions_buffer_, data_buffer_); | 5559 instructions_buffer_, data_buffer_); |
(...skipping 12 matching lines...) Expand all Loading... |
5545 thread_->isolate()->SetupImagePage(data_buffer_, | 5572 thread_->isolate()->SetupImagePage(data_buffer_, |
5546 /* is_executable */ false); | 5573 /* is_executable */ false); |
5547 } | 5574 } |
5548 | 5575 |
5549 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store()); | 5576 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store()); |
5550 | 5577 |
5551 return ApiError::null(); | 5578 return ApiError::null(); |
5552 } | 5579 } |
5553 | 5580 |
5554 } // namespace dart | 5581 } // namespace dart |
OLD | NEW |