| 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 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1453 lib->ptr()->native_entry_symbol_resolver_ = NULL; | 1453 lib->ptr()->native_entry_symbol_resolver_ = NULL; |
| 1454 lib->ptr()->index_ = d->Read<int32_t>(); | 1454 lib->ptr()->index_ = d->Read<int32_t>(); |
| 1455 lib->ptr()->num_imports_ = d->Read<uint16_t>(); | 1455 lib->ptr()->num_imports_ = d->Read<uint16_t>(); |
| 1456 lib->ptr()->load_state_ = d->Read<int8_t>(); | 1456 lib->ptr()->load_state_ = d->Read<int8_t>(); |
| 1457 lib->ptr()->corelib_imported_ = d->Read<bool>(); | 1457 lib->ptr()->corelib_imported_ = d->Read<bool>(); |
| 1458 lib->ptr()->is_dart_scheme_ = d->Read<bool>(); | 1458 lib->ptr()->is_dart_scheme_ = d->Read<bool>(); |
| 1459 lib->ptr()->debuggable_ = d->Read<bool>(); | 1459 lib->ptr()->debuggable_ = d->Read<bool>(); |
| 1460 lib->ptr()->is_in_fullsnapshot_ = true; | 1460 lib->ptr()->is_in_fullsnapshot_ = true; |
| 1461 } | 1461 } |
| 1462 } | 1462 } |
| 1463 | |
| 1464 void PostLoad(const Array& refs, Snapshot::Kind kind, Zone* zone) { | |
| 1465 // TODO(rmacnak): This is surprisingly slow, roughly 20% of deserialization | |
| 1466 // time for the JIT. Maybe make the lookups happy with a null? | |
| 1467 | |
| 1468 NOT_IN_PRODUCT(TimelineDurationScope tds( | |
| 1469 Thread::Current(), Timeline::GetIsolateStream(), "PostLoadLibrary")); | |
| 1470 | |
| 1471 Library& lib = Library::Handle(zone); | |
| 1472 for (intptr_t i = start_index_; i < stop_index_; i++) { | |
| 1473 lib ^= refs.At(i); | |
| 1474 const intptr_t kInitialNameCacheSize = 64; | |
| 1475 lib.InitResolvedNamesCache(kInitialNameCacheSize); | |
| 1476 } | |
| 1477 } | |
| 1478 }; | 1463 }; |
| 1479 | 1464 |
| 1480 | 1465 |
| 1481 #if !defined(DART_PRECOMPILED_RUNTIME) | 1466 #if !defined(DART_PRECOMPILED_RUNTIME) |
| 1482 class NamespaceSerializationCluster : public SerializationCluster { | 1467 class NamespaceSerializationCluster : public SerializationCluster { |
| 1483 public: | 1468 public: |
| 1484 NamespaceSerializationCluster() {} | 1469 NamespaceSerializationCluster() {} |
| 1485 virtual ~NamespaceSerializationCluster() {} | 1470 virtual ~NamespaceSerializationCluster() {} |
| 1486 | 1471 |
| 1487 void Trace(Serializer* s, RawObject* object) { | 1472 void Trace(Serializer* s, RawObject* object) { |
| (...skipping 4078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5566 thread_->isolate()->SetupImagePage(data_buffer_, | 5551 thread_->isolate()->SetupImagePage(data_buffer_, |
| 5567 /* is_executable */ false); | 5552 /* is_executable */ false); |
| 5568 } | 5553 } |
| 5569 | 5554 |
| 5570 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store()); | 5555 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store()); |
| 5571 | 5556 |
| 5572 return ApiError::null(); | 5557 return ApiError::null(); |
| 5573 } | 5558 } |
| 5574 | 5559 |
| 5575 } // namespace dart | 5560 } // namespace dart |
| OLD | NEW |