Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(777)

Side by Side Diff: src/vm/heap.h

Issue 1263043007: Add ImmutableHeap class consisting of parts (Closed) Base URL: git@github.com:dart-lang/fletch.git@master
Patch Set: Addressed comments, merged other CL about allocation budget in space Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | src/vm/immutable_heap.h » ('j') | src/vm/immutable_heap.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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_
OLDNEW
« no previous file with comments | « no previous file | src/vm/immutable_heap.h » ('j') | src/vm/immutable_heap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698