Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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/gc_sweeper.h" | 5 #include "vm/gc_sweeper.h" |
| 6 | 6 |
| 7 #include "vm/freelist.h" | 7 #include "vm/freelist.h" |
| 8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
| 9 #include "vm/heap.h" | 9 #include "vm/heap.h" |
| 10 #include "vm/pages.h" | 10 #include "vm/pages.h" |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 38 } | 38 } |
| 39 // Expand the free block by the size of this object. | 39 // Expand the free block by the size of this object. |
| 40 free_end += next_obj->Size(); | 40 free_end += next_obj->Size(); |
| 41 } | 41 } |
| 42 obj_size = free_end - current; | 42 obj_size = free_end - current; |
| 43 if (is_executable) { | 43 if (is_executable) { |
| 44 memset(reinterpret_cast<void*>(current), 0xcc, obj_size); | 44 memset(reinterpret_cast<void*>(current), 0xcc, obj_size); |
| 45 } | 45 } |
| 46 if ((current != start) || (free_end != end)) { | 46 if ((current != start) || (free_end != end)) { |
| 47 // Only add to the free list if not covering the whole page. | 47 // Only add to the free list if not covering the whole page. |
| 48 freelist->Free(current, obj_size); | 48 freelist->FreeLocked(current, obj_size); |
|
koda
2014/08/20 13:52:22
SweepPage now assumes that 'freelist' is locked, s
Ivan Posva
2014/08/20 14:10:20
Done.
| |
| 49 } | 49 } |
| 50 } | 50 } |
| 51 current += obj_size; | 51 current += obj_size; |
| 52 } | 52 } |
| 53 ASSERT(current == end); | 53 ASSERT(current == end); |
| 54 | 54 |
| 55 return in_use; | 55 return in_use; |
| 56 } | 56 } |
| 57 | 57 |
| 58 | 58 |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 71 while (current < end) { | 71 while (current < end) { |
| 72 RawObject* cur_obj = RawObject::FromAddr(current); | 72 RawObject* cur_obj = RawObject::FromAddr(current); |
| 73 ASSERT(!cur_obj->IsMarked()); | 73 ASSERT(!cur_obj->IsMarked()); |
| 74 current += cur_obj->Size(); | 74 current += cur_obj->Size(); |
| 75 } | 75 } |
| 76 #endif // DEBUG | 76 #endif // DEBUG |
| 77 return words_to_end; | 77 return words_to_end; |
| 78 } | 78 } |
| 79 | 79 |
| 80 } // namespace dart | 80 } // namespace dart |
| OLD | NEW |