| 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 1553 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1564 | 1564 |
| 1565 s->Push(code->ptr()->object_pool_); | 1565 s->Push(code->ptr()->object_pool_); |
| 1566 s->Push(code->ptr()->owner_); | 1566 s->Push(code->ptr()->owner_); |
| 1567 s->Push(code->ptr()->exception_handlers_); | 1567 s->Push(code->ptr()->exception_handlers_); |
| 1568 s->Push(code->ptr()->pc_descriptors_); | 1568 s->Push(code->ptr()->pc_descriptors_); |
| 1569 s->Push(code->ptr()->stackmaps_); | 1569 s->Push(code->ptr()->stackmaps_); |
| 1570 | 1570 |
| 1571 if (s->kind() == Snapshot::kAppJIT) { | 1571 if (s->kind() == Snapshot::kAppJIT) { |
| 1572 s->Push(code->ptr()->deopt_info_array_); | 1572 s->Push(code->ptr()->deopt_info_array_); |
| 1573 s->Push(code->ptr()->static_calls_target_table_); | 1573 s->Push(code->ptr()->static_calls_target_table_); |
| 1574 NOT_IN_PRODUCT(s->Push(code->ptr()->inlined_metadata_)); | 1574 NOT_IN_PRODUCT(s->Push(code->ptr()->inlined_id_to_function_)); |
| 1575 NOT_IN_PRODUCT(s->Push(code->ptr()->return_address_metadata_)); | 1575 NOT_IN_PRODUCT(s->Push(code->ptr()->return_address_metadata_)); |
| 1576 } | 1576 } |
| 1577 } | 1577 } |
| 1578 | 1578 |
| 1579 void WriteAlloc(Serializer* s) { | 1579 void WriteAlloc(Serializer* s) { |
| 1580 s->WriteCid(kCodeCid); | 1580 s->WriteCid(kCodeCid); |
| 1581 intptr_t count = objects_.length(); | 1581 intptr_t count = objects_.length(); |
| 1582 s->Write<int32_t>(count); | 1582 s->Write<int32_t>(count); |
| 1583 for (intptr_t i = 0; i < count; i++) { | 1583 for (intptr_t i = 0; i < count; i++) { |
| 1584 RawCode* code = objects_[i]; | 1584 RawCode* code = objects_[i]; |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1617 | 1617 |
| 1618 s->WriteRef(code->ptr()->object_pool_); | 1618 s->WriteRef(code->ptr()->object_pool_); |
| 1619 s->WriteRef(code->ptr()->owner_); | 1619 s->WriteRef(code->ptr()->owner_); |
| 1620 s->WriteRef(code->ptr()->exception_handlers_); | 1620 s->WriteRef(code->ptr()->exception_handlers_); |
| 1621 s->WriteRef(code->ptr()->pc_descriptors_); | 1621 s->WriteRef(code->ptr()->pc_descriptors_); |
| 1622 s->WriteRef(code->ptr()->stackmaps_); | 1622 s->WriteRef(code->ptr()->stackmaps_); |
| 1623 | 1623 |
| 1624 if (s->kind() == Snapshot::kAppJIT) { | 1624 if (s->kind() == Snapshot::kAppJIT) { |
| 1625 s->WriteRef(code->ptr()->deopt_info_array_); | 1625 s->WriteRef(code->ptr()->deopt_info_array_); |
| 1626 s->WriteRef(code->ptr()->static_calls_target_table_); | 1626 s->WriteRef(code->ptr()->static_calls_target_table_); |
| 1627 NOT_IN_PRODUCT(s->WriteRef(code->ptr()->inlined_metadata_)); | 1627 NOT_IN_PRODUCT(s->WriteRef(code->ptr()->inlined_id_to_function_)); |
| 1628 NOT_IN_PRODUCT(s->WriteRef(code->ptr()->return_address_metadata_)); | 1628 NOT_IN_PRODUCT(s->WriteRef(code->ptr()->return_address_metadata_)); |
| 1629 } | 1629 } |
| 1630 | 1630 |
| 1631 s->Write<int32_t>(code->ptr()->state_bits_); | 1631 s->Write<int32_t>(code->ptr()->state_bits_); |
| 1632 } | 1632 } |
| 1633 } | 1633 } |
| 1634 | 1634 |
| 1635 private: | 1635 private: |
| 1636 GrowableArray<RawCode*> objects_; | 1636 GrowableArray<RawCode*> objects_; |
| 1637 }; | 1637 }; |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1690 reinterpret_cast<RawPcDescriptors*>(d->ReadRef()); | 1690 reinterpret_cast<RawPcDescriptors*>(d->ReadRef()); |
| 1691 code->ptr()->stackmaps_ = reinterpret_cast<RawArray*>(d->ReadRef()); | 1691 code->ptr()->stackmaps_ = reinterpret_cast<RawArray*>(d->ReadRef()); |
| 1692 | 1692 |
| 1693 #if !defined(DART_PRECOMPILED_RUNTIME) | 1693 #if !defined(DART_PRECOMPILED_RUNTIME) |
| 1694 if (d->kind() == Snapshot::kAppJIT) { | 1694 if (d->kind() == Snapshot::kAppJIT) { |
| 1695 code->ptr()->deopt_info_array_ = | 1695 code->ptr()->deopt_info_array_ = |
| 1696 reinterpret_cast<RawArray*>(d->ReadRef()); | 1696 reinterpret_cast<RawArray*>(d->ReadRef()); |
| 1697 code->ptr()->static_calls_target_table_ = | 1697 code->ptr()->static_calls_target_table_ = |
| 1698 reinterpret_cast<RawArray*>(d->ReadRef()); | 1698 reinterpret_cast<RawArray*>(d->ReadRef()); |
| 1699 #if defined(PRODUCT) | 1699 #if defined(PRODUCT) |
| 1700 code->ptr()->inlined_metadata_ = Array::null(); | 1700 code->ptr()->inlined_id_to_function_ = Array::null(); |
| 1701 code->ptr()->return_address_metadata_ = Object::null(); | 1701 code->ptr()->return_address_metadata_ = Object::null(); |
| 1702 #else | 1702 #else |
| 1703 code->ptr()->inlined_metadata_ = | 1703 code->ptr()->inlined_id_to_function_ = |
| 1704 reinterpret_cast<RawArray*>(d->ReadRef()); | 1704 reinterpret_cast<RawArray*>(d->ReadRef()); |
| 1705 code->ptr()->return_address_metadata_ = d->ReadRef(); | 1705 code->ptr()->return_address_metadata_ = d->ReadRef(); |
| 1706 #endif | 1706 #endif |
| 1707 } else { | 1707 } else { |
| 1708 code->ptr()->deopt_info_array_ = Array::null(); | 1708 code->ptr()->deopt_info_array_ = Array::null(); |
| 1709 code->ptr()->static_calls_target_table_ = Array::null(); | 1709 code->ptr()->static_calls_target_table_ = Array::null(); |
| 1710 code->ptr()->inlined_metadata_ = Array::null(); | 1710 code->ptr()->inlined_id_to_function_ = Array::null(); |
| 1711 code->ptr()->return_address_metadata_ = Object::null(); | 1711 code->ptr()->return_address_metadata_ = Object::null(); |
| 1712 } | 1712 } |
| 1713 | 1713 |
| 1714 code->ptr()->var_descriptors_ = LocalVarDescriptors::null(); | 1714 code->ptr()->var_descriptors_ = LocalVarDescriptors::null(); |
| 1715 code->ptr()->code_source_map_ = CodeSourceMap::null(); | 1715 code->ptr()->code_source_map_ = CodeSourceMap::null(); |
| 1716 code->ptr()->comments_ = Array::null(); | 1716 code->ptr()->comments_ = Array::null(); |
| 1717 | 1717 |
| 1718 code->ptr()->compile_timestamp_ = 0; | 1718 code->ptr()->compile_timestamp_ = 0; |
| 1719 #endif // !DART_PRECOMPILED_RUNTIME | 1719 #endif // !DART_PRECOMPILED_RUNTIME |
| 1720 | 1720 |
| (...skipping 3789 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5510 thread_->isolate()->SetupImagePage(data_buffer_, | 5510 thread_->isolate()->SetupImagePage(data_buffer_, |
| 5511 /* is_executable */ false); | 5511 /* is_executable */ false); |
| 5512 } | 5512 } |
| 5513 | 5513 |
| 5514 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store()); | 5514 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store()); |
| 5515 | 5515 |
| 5516 return ApiError::null(); | 5516 return ApiError::null(); |
| 5517 } | 5517 } |
| 5518 | 5518 |
| 5519 } // namespace dart | 5519 } // namespace dart |
| OLD | NEW |