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