| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 } | 128 } |
| 129 | 129 |
| 130 | 130 |
| 131 bool PagedSpace::Contains(Address addr) { | 131 bool PagedSpace::Contains(Address addr) { |
| 132 Page* p = Page::FromAddress(addr); | 132 Page* p = Page::FromAddress(addr); |
| 133 if (!p->is_valid()) return false; | 133 if (!p->is_valid()) return false; |
| 134 return p->owner() == this; | 134 return p->owner() == this; |
| 135 } | 135 } |
| 136 | 136 |
| 137 | 137 |
| 138 void MemoryChunk::set_scan_on_scavenge(bool scan) { |
| 139 if (scan) { |
| 140 if (!scan_on_scavenge_) Heap::increment_scan_on_scavenge_pages(); |
| 141 } else { |
| 142 if (scan_on_scavenge_) Heap::decrement_scan_on_scavenge_pages(); |
| 143 } |
| 144 scan_on_scavenge_ = scan; |
| 145 } |
| 146 |
| 147 |
| 138 MemoryChunk* MemoryChunk::FromAnyPointerAddress(Address addr) { | 148 MemoryChunk* MemoryChunk::FromAnyPointerAddress(Address addr) { |
| 139 MemoryChunk* maybe = reinterpret_cast<MemoryChunk*>( | 149 MemoryChunk* maybe = reinterpret_cast<MemoryChunk*>( |
| 140 OffsetFrom(addr) & ~Page::kPageAlignmentMask); | 150 OffsetFrom(addr) & ~Page::kPageAlignmentMask); |
| 141 if (maybe->owner() != NULL) return maybe; | 151 if (maybe->owner() != NULL) return maybe; |
| 142 LargeObjectIterator iterator(Heap::lo_space()); | 152 LargeObjectIterator iterator(Heap::lo_space()); |
| 143 for (HeapObject* o = iterator.next(); o != NULL; o = iterator.next()) { | 153 for (HeapObject* o = iterator.next(); o != NULL; o = iterator.next()) { |
| 144 // Fixed arrays are the only pointer-containing objects in large object | 154 // Fixed arrays are the only pointer-containing objects in large object |
| 145 // space. | 155 // space. |
| 146 if (o->IsFixedArray()) { | 156 if (o->IsFixedArray()) { |
| 147 MemoryChunk* chunk = MemoryChunk::FromAddress(o->address()); | 157 MemoryChunk* chunk = MemoryChunk::FromAddress(o->address()); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 268 | 278 |
| 269 bool FreeListNode::IsFreeListNode(HeapObject* object) { | 279 bool FreeListNode::IsFreeListNode(HeapObject* object) { |
| 270 return object->map() == Heap::raw_unchecked_free_space_map() | 280 return object->map() == Heap::raw_unchecked_free_space_map() |
| 271 || object->map() == Heap::raw_unchecked_one_pointer_filler_map() | 281 || object->map() == Heap::raw_unchecked_one_pointer_filler_map() |
| 272 || object->map() == Heap::raw_unchecked_two_pointer_filler_map(); | 282 || object->map() == Heap::raw_unchecked_two_pointer_filler_map(); |
| 273 } | 283 } |
| 274 | 284 |
| 275 } } // namespace v8::internal | 285 } } // namespace v8::internal |
| 276 | 286 |
| 277 #endif // V8_SPACES_INL_H_ | 287 #endif // V8_SPACES_INL_H_ |
| OLD | NEW |