OLD | NEW |
1 // Copyright (c) 2014, the Fletch project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Fletch 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.md file. | 3 // BSD-style license that can be found in the LICENSE.md file. |
4 | 4 |
5 #ifndef SRC_VM_HEAP_H_ | 5 #ifndef SRC_VM_HEAP_H_ |
6 #define SRC_VM_HEAP_H_ | 6 #define SRC_VM_HEAP_H_ |
7 | 7 |
8 #include "src/shared/globals.h" | 8 #include "src/shared/globals.h" |
9 #include "src/shared/random.h" | 9 #include "src/shared/random.h" |
10 #include "src/vm/object.h" | 10 #include "src/vm/object.h" |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 110 |
111 void AddWeakPointer(HeapObject* object, WeakPointerCallback callback); | 111 void AddWeakPointer(HeapObject* object, WeakPointerCallback callback); |
112 void RemoveWeakPointer(HeapObject* object); | 112 void RemoveWeakPointer(HeapObject* object); |
113 void ProcessWeakPointers(); | 113 void ProcessWeakPointers(); |
114 void VisitWeakObjectPointers(PointerVisitor* visitor) { | 114 void VisitWeakObjectPointers(PointerVisitor* visitor) { |
115 WeakPointer::Visit(weak_pointers_, visitor); | 115 WeakPointer::Visit(weak_pointers_, visitor); |
116 } | 116 } |
117 | 117 |
118 private: | 118 private: |
119 friend class ExitReference; | 119 friend class ExitReference; |
| 120 friend class ImmutableHeap; |
120 Heap(Space* existing_space, WeakPointer* weak_pointers); | 121 Heap(Space* existing_space, WeakPointer* weak_pointers); |
121 | 122 |
122 Object* CreateStringInternal(Class* the_class, int length, bool clear, | 123 Object* CreateStringInternal(Class* the_class, int length, bool clear, |
123 bool immutable); | 124 bool immutable); |
124 | 125 |
125 Object* AllocateRawClass(int size); | 126 Object* AllocateRawClass(int size); |
126 | 127 |
127 // Used for initializing identity hash codes for immutable objects. | 128 // Used for initializing identity hash codes for immutable objects. |
128 RandomLCG* random_; | 129 RandomLCG* random_; |
129 Space* space_; | 130 Space* space_; |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 return object->IsSmi() | 163 return object->IsSmi() |
163 ? Smi::cast(object)->value() | 164 ? Smi::cast(object)->value() |
164 : LargeInteger::cast(object)->value(); | 165 : LargeInteger::cast(object)->value(); |
165 } | 166 } |
166 | 167 |
167 | 168 |
168 } // namespace fletch | 169 } // namespace fletch |
169 | 170 |
170 | 171 |
171 #endif // SRC_VM_HEAP_H_ | 172 #endif // SRC_VM_HEAP_H_ |
OLD | NEW |