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 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 } | 241 } |
242 | 242 |
243 | 243 |
244 void Page::set_prev_page(Page* page) { | 244 void Page::set_prev_page(Page* page) { |
245 ASSERT(page->owner() == owner()); | 245 ASSERT(page->owner() == owner()); |
246 set_prev_chunk(page); | 246 set_prev_chunk(page); |
247 } | 247 } |
248 | 248 |
249 | 249 |
250 // Try linear allocation in the page of alloc_info's allocation top. Does | 250 // Try linear allocation in the page of alloc_info's allocation top. Does |
251 // not contain slow case logic (eg, move to the next page or try free list | 251 // not contain slow case logic (e.g. move to the next page or try free list |
252 // allocation) so it can be used by all the allocation functions and for all | 252 // allocation) so it can be used by all the allocation functions and for all |
253 // the paged spaces. | 253 // the paged spaces. |
254 HeapObject* PagedSpace::AllocateLinearly(int size_in_bytes) { | 254 HeapObject* PagedSpace::AllocateLinearly(int size_in_bytes) { |
255 Address current_top = allocation_info_.top; | 255 Address current_top = allocation_info_.top; |
256 Address new_top = current_top + size_in_bytes; | 256 Address new_top = current_top + size_in_bytes; |
257 if (new_top > allocation_info_.limit) return NULL; | 257 if (new_top > allocation_info_.limit) return NULL; |
258 | 258 |
259 allocation_info_.top = new_top; | 259 allocation_info_.top = new_top; |
260 return HeapObject::FromAddress(current_top); | 260 return HeapObject::FromAddress(current_top); |
261 } | 261 } |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
341 Map* map = object->map(); | 341 Map* map = object->map(); |
342 Heap* heap = object->GetHeap(); | 342 Heap* heap = object->GetHeap(); |
343 return map == heap->raw_unchecked_free_space_map() | 343 return map == heap->raw_unchecked_free_space_map() |
344 || map == heap->raw_unchecked_one_pointer_filler_map() | 344 || map == heap->raw_unchecked_one_pointer_filler_map() |
345 || map == heap->raw_unchecked_two_pointer_filler_map(); | 345 || map == heap->raw_unchecked_two_pointer_filler_map(); |
346 } | 346 } |
347 | 347 |
348 } } // namespace v8::internal | 348 } } // namespace v8::internal |
349 | 349 |
350 #endif // V8_SPACES_INL_H_ | 350 #endif // V8_SPACES_INL_H_ |
OLD | NEW |