OLD | NEW |
1 // Copyright (c) 2015, the Dartino project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, the Dartino 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 #include "src/vm/object_memory.h" | 5 #include "src/vm/object_memory.h" |
6 | 6 |
7 #include "src/vm/object.h" | 7 #include "src/vm/object.h" |
8 | 8 |
9 namespace fletch { | 9 namespace dartino { |
10 | 10 |
11 // In the semispaces, the sentinel marks the allocation limit in each chunk. | 11 // In the semispaces, the sentinel marks the allocation limit in each chunk. |
12 // It is written when we flush, and when we allocate during GC, but it is not | 12 // It is written when we flush, and when we allocate during GC, but it is not |
13 // necessarily maintained when allocating between GCs. | 13 // necessarily maintained when allocating between GCs. |
14 static Smi* chunk_end_sentinel() { return Smi::zero(); } | 14 static Smi* chunk_end_sentinel() { return Smi::zero(); } |
15 | 15 |
16 static bool HasSentinelAt(uword address) { | 16 static bool HasSentinelAt(uword address) { |
17 return *reinterpret_cast<Object**>(address) == chunk_end_sentinel(); | 17 return *reinterpret_cast<Object**>(address) == chunk_end_sentinel(); |
18 } | 18 } |
19 | 19 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 172 |
173 current += object->Size(); | 173 current += object->Size(); |
174 } | 174 } |
175 // Set up the already-scanned pointer for next round. | 175 // Set up the already-scanned pointer for next round. |
176 chunk->set_scavenge_pointer(current); | 176 chunk->set_scavenge_pointer(current); |
177 } | 177 } |
178 | 178 |
179 return found_work; | 179 return found_work; |
180 } | 180 } |
181 | 181 |
182 } // namespace fletch | 182 } // namespace dartino |
OLD | NEW |