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 #ifndef RUNTIME_VM_BECOME_H_ | 5 #ifndef RUNTIME_VM_BECOME_H_ |
6 #define RUNTIME_VM_BECOME_H_ | 6 #define RUNTIME_VM_BECOME_H_ |
7 | 7 |
8 #include "vm/allocation.h" | 8 #include "vm/allocation.h" |
9 #include "vm/raw_object.h" | 9 #include "vm/raw_object.h" |
10 | 10 |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 static const ClassId kClassId = kForwardingCorpse; | 45 static const ClassId kClassId = kForwardingCorpse; |
46 static bool IsInstance() { return true; } | 46 static bool IsInstance() { return true; } |
47 | 47 |
48 private: | 48 private: |
49 DISALLOW_ALLOCATION(); | 49 DISALLOW_ALLOCATION(); |
50 DISALLOW_COPY_AND_ASSIGN(FakeInstance); | 50 DISALLOW_COPY_AND_ASSIGN(FakeInstance); |
51 }; | 51 }; |
52 | 52 |
53 private: | 53 private: |
54 // This layout mirrors the layout of RawObject. | 54 // This layout mirrors the layout of RawObject. |
55 uword tags_; | 55 uint32_t tags_; |
| 56 #if defined(HASH_IN_OBJECT_HEADER) |
| 57 uint32_t hash_; |
| 58 #endif |
56 RawObject* target_; | 59 RawObject* target_; |
57 | 60 |
58 // Returns the address of the embedded size. | 61 // Returns the address of the embedded size. |
59 intptr_t* SizeAddress() const { | 62 intptr_t* SizeAddress() const { |
60 uword addr = reinterpret_cast<uword>(&target_) + kWordSize; | 63 uword addr = reinterpret_cast<uword>(&target_) + kWordSize; |
61 return reinterpret_cast<intptr_t*>(addr); | 64 return reinterpret_cast<intptr_t*>(addr); |
62 } | 65 } |
63 | 66 |
64 // ForwardingCorpses cannot be allocated. Instead references to them are | 67 // ForwardingCorpses cannot be allocated. Instead references to them are |
65 // created using the AsForwarder factory method. | 68 // created using the AsForwarder factory method. |
(...skipping 16 matching lines...) Expand all Loading... |
82 // (used for morphic instances during reload). | 85 // (used for morphic instances during reload). |
83 static void MakeDummyObject(const Instance& instance); | 86 static void MakeDummyObject(const Instance& instance); |
84 | 87 |
85 private: | 88 private: |
86 static void CrashDump(RawObject* before_obj, RawObject* after_obj); | 89 static void CrashDump(RawObject* before_obj, RawObject* after_obj); |
87 }; | 90 }; |
88 | 91 |
89 } // namespace dart | 92 } // namespace dart |
90 | 93 |
91 #endif // RUNTIME_VM_BECOME_H_ | 94 #endif // RUNTIME_VM_BECOME_H_ |
OLD | NEW |