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 1548 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1559 virtual ~CodeSerializationCluster() {} | 1559 virtual ~CodeSerializationCluster() {} |
1560 | 1560 |
1561 void Trace(Serializer* s, RawObject* object) { | 1561 void Trace(Serializer* s, RawObject* object) { |
1562 RawCode* code = Code::RawCast(object); | 1562 RawCode* code = Code::RawCast(object); |
1563 objects_.Add(code); | 1563 objects_.Add(code); |
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 #if defined(DART_PRECOMPILED_RUNTIME) || defined(DART_PRECOMPILER) | |
1570 s->Push(code->ptr()->catch_entry_.catch_entry_state_maps_); | |
1571 #else | |
1572 s->Push(code->ptr()->catch_entry_.variables_); | |
1573 #endif | |
1574 s->Push(code->ptr()->stackmaps_); | 1569 s->Push(code->ptr()->stackmaps_); |
1575 s->Push(code->ptr()->inlined_id_to_function_); | 1570 s->Push(code->ptr()->inlined_id_to_function_); |
1576 s->Push(code->ptr()->code_source_map_); | 1571 s->Push(code->ptr()->code_source_map_); |
1577 | 1572 |
1578 if (s->kind() == Snapshot::kAppJIT) { | 1573 if (s->kind() == Snapshot::kAppJIT) { |
1579 s->Push(code->ptr()->deopt_info_array_); | 1574 s->Push(code->ptr()->deopt_info_array_); |
1580 s->Push(code->ptr()->static_calls_target_table_); | 1575 s->Push(code->ptr()->static_calls_target_table_); |
1581 NOT_IN_PRODUCT(s->Push(code->ptr()->return_address_metadata_)); | 1576 NOT_IN_PRODUCT(s->Push(code->ptr()->return_address_metadata_)); |
1582 } | 1577 } |
1583 } | 1578 } |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1618 instr = code->ptr()->active_instructions_; | 1613 instr = code->ptr()->active_instructions_; |
1619 text_offset = s->GetTextOffset(instr, code); | 1614 text_offset = s->GetTextOffset(instr, code); |
1620 } | 1615 } |
1621 s->Write<int32_t>(text_offset); | 1616 s->Write<int32_t>(text_offset); |
1622 } | 1617 } |
1623 | 1618 |
1624 s->WriteRef(code->ptr()->object_pool_); | 1619 s->WriteRef(code->ptr()->object_pool_); |
1625 s->WriteRef(code->ptr()->owner_); | 1620 s->WriteRef(code->ptr()->owner_); |
1626 s->WriteRef(code->ptr()->exception_handlers_); | 1621 s->WriteRef(code->ptr()->exception_handlers_); |
1627 s->WriteRef(code->ptr()->pc_descriptors_); | 1622 s->WriteRef(code->ptr()->pc_descriptors_); |
1628 #if defined(DART_PRECOMPILED_RUNTIME) || defined(DART_PRECOMPILER) | |
1629 s->WriteRef(code->ptr()->catch_entry_.catch_entry_state_maps_); | |
1630 #else | |
1631 s->WriteRef(code->ptr()->catch_entry_.variables_); | |
1632 #endif | |
1633 s->WriteRef(code->ptr()->stackmaps_); | 1623 s->WriteRef(code->ptr()->stackmaps_); |
1634 s->WriteRef(code->ptr()->inlined_id_to_function_); | 1624 s->WriteRef(code->ptr()->inlined_id_to_function_); |
1635 s->WriteRef(code->ptr()->code_source_map_); | 1625 s->WriteRef(code->ptr()->code_source_map_); |
1636 | 1626 |
1637 if (s->kind() == Snapshot::kAppJIT) { | 1627 if (s->kind() == Snapshot::kAppJIT) { |
1638 s->WriteRef(code->ptr()->deopt_info_array_); | 1628 s->WriteRef(code->ptr()->deopt_info_array_); |
1639 s->WriteRef(code->ptr()->static_calls_target_table_); | 1629 s->WriteRef(code->ptr()->static_calls_target_table_); |
1640 NOT_IN_PRODUCT(s->WriteRef(code->ptr()->return_address_metadata_)); | 1630 NOT_IN_PRODUCT(s->WriteRef(code->ptr()->return_address_metadata_)); |
1641 } | 1631 } |
1642 | 1632 |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1693 } | 1683 } |
1694 #endif // !DART_PRECOMPILED_RUNTIME | 1684 #endif // !DART_PRECOMPILED_RUNTIME |
1695 | 1685 |
1696 code->ptr()->object_pool_ = | 1686 code->ptr()->object_pool_ = |
1697 reinterpret_cast<RawObjectPool*>(d->ReadRef()); | 1687 reinterpret_cast<RawObjectPool*>(d->ReadRef()); |
1698 code->ptr()->owner_ = d->ReadRef(); | 1688 code->ptr()->owner_ = d->ReadRef(); |
1699 code->ptr()->exception_handlers_ = | 1689 code->ptr()->exception_handlers_ = |
1700 reinterpret_cast<RawExceptionHandlers*>(d->ReadRef()); | 1690 reinterpret_cast<RawExceptionHandlers*>(d->ReadRef()); |
1701 code->ptr()->pc_descriptors_ = | 1691 code->ptr()->pc_descriptors_ = |
1702 reinterpret_cast<RawPcDescriptors*>(d->ReadRef()); | 1692 reinterpret_cast<RawPcDescriptors*>(d->ReadRef()); |
1703 #if defined(DART_PRECOMPILED_RUNTIME) || defined(DART_PRECOMPILER) | |
1704 code->ptr()->catch_entry_.catch_entry_state_maps_ = | |
1705 reinterpret_cast<RawTypedData*>(d->ReadRef()); | |
1706 #else | |
1707 code->ptr()->catch_entry_.variables_ = | |
1708 reinterpret_cast<RawSmi*>(d->ReadRef()); | |
1709 #endif | |
1710 code->ptr()->stackmaps_ = reinterpret_cast<RawArray*>(d->ReadRef()); | 1693 code->ptr()->stackmaps_ = reinterpret_cast<RawArray*>(d->ReadRef()); |
1711 code->ptr()->inlined_id_to_function_ = | 1694 code->ptr()->inlined_id_to_function_ = |
1712 reinterpret_cast<RawArray*>(d->ReadRef()); | 1695 reinterpret_cast<RawArray*>(d->ReadRef()); |
1713 code->ptr()->code_source_map_ = | 1696 code->ptr()->code_source_map_ = |
1714 reinterpret_cast<RawCodeSourceMap*>(d->ReadRef()); | 1697 reinterpret_cast<RawCodeSourceMap*>(d->ReadRef()); |
1715 | 1698 |
1716 #if !defined(DART_PRECOMPILED_RUNTIME) | 1699 #if !defined(DART_PRECOMPILED_RUNTIME) |
1717 if (d->kind() == Snapshot::kAppJIT) { | 1700 if (d->kind() == Snapshot::kAppJIT) { |
1718 code->ptr()->deopt_info_array_ = | 1701 code->ptr()->deopt_info_array_ = |
1719 reinterpret_cast<RawArray*>(d->ReadRef()); | 1702 reinterpret_cast<RawArray*>(d->ReadRef()); |
(...skipping 3811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5531 thread_->isolate()->SetupImagePage(data_buffer_, | 5514 thread_->isolate()->SetupImagePage(data_buffer_, |
5532 /* is_executable */ false); | 5515 /* is_executable */ false); |
5533 } | 5516 } |
5534 | 5517 |
5535 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store()); | 5518 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store()); |
5536 | 5519 |
5537 return ApiError::null(); | 5520 return ApiError::null(); |
5538 } | 5521 } |
5539 | 5522 |
5540 } // namespace dart | 5523 } // namespace dart |
OLD | NEW |