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 22 matching lines...) Expand all Loading... |
33 return reinterpret_cast<RawObject*>(address + kHeapObjectTag); | 33 return reinterpret_cast<RawObject*>(address + kHeapObjectTag); |
34 } | 34 } |
35 | 35 |
36 | 36 |
37 void Deserializer::InitializeHeader(RawObject* raw, | 37 void Deserializer::InitializeHeader(RawObject* raw, |
38 intptr_t class_id, | 38 intptr_t class_id, |
39 intptr_t size, | 39 intptr_t size, |
40 bool is_vm_isolate, | 40 bool is_vm_isolate, |
41 bool is_canonical) { | 41 bool is_canonical) { |
42 ASSERT(Utils::IsAligned(size, kObjectAlignment)); | 42 ASSERT(Utils::IsAligned(size, kObjectAlignment)); |
43 uword tags = 0; | 43 uint32_t tags = 0; |
44 tags = RawObject::ClassIdTag::update(class_id, tags); | 44 tags = RawObject::ClassIdTag::update(class_id, tags); |
45 tags = RawObject::SizeTag::update(size, tags); | 45 tags = RawObject::SizeTag::update(size, tags); |
46 tags = RawObject::VMHeapObjectTag::update(is_vm_isolate, tags); | 46 tags = RawObject::VMHeapObjectTag::update(is_vm_isolate, tags); |
47 tags = RawObject::CanonicalObjectTag::update(is_canonical, tags); | 47 tags = RawObject::CanonicalObjectTag::update(is_canonical, tags); |
48 raw->ptr()->tags_ = tags; | 48 raw->ptr()->tags_ = tags; |
| 49 #if defined(HASH_IN_OBJECT_HEADER) |
| 50 raw->ptr()->hash_ = 0; |
| 51 #endif |
49 } | 52 } |
50 | 53 |
51 | 54 |
52 #if !defined(DART_PRECOMPILED_RUNTIME) | 55 #if !defined(DART_PRECOMPILED_RUNTIME) |
53 class ClassSerializationCluster : public SerializationCluster { | 56 class ClassSerializationCluster : public SerializationCluster { |
54 public: | 57 public: |
55 explicit ClassSerializationCluster(intptr_t num_cids) | 58 explicit ClassSerializationCluster(intptr_t num_cids) |
56 : predefined_(kNumPredefinedCids), objects_(num_cids) {} | 59 : predefined_(kNumPredefinedCids), objects_(num_cids) {} |
57 virtual ~ClassSerializationCluster() {} | 60 virtual ~ClassSerializationCluster() {} |
58 | 61 |
(...skipping 5575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5634 thread_->isolate()->SetupImagePage(data_buffer_, | 5637 thread_->isolate()->SetupImagePage(data_buffer_, |
5635 /* is_executable */ false); | 5638 /* is_executable */ false); |
5636 } | 5639 } |
5637 | 5640 |
5638 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store()); | 5641 deserializer.ReadIsolateSnapshot(thread_->isolate()->object_store()); |
5639 | 5642 |
5640 return ApiError::null(); | 5643 return ApiError::null(); |
5641 } | 5644 } |
5642 | 5645 |
5643 } // namespace dart | 5646 } // namespace dart |
OLD | NEW |