| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 389 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 } | 400 } |
| 401 | 401 |
| 402 #endif | 402 #endif |
| 403 | 403 |
| 404 | 404 |
| 405 // -------------------------------------------------------------------------- | 405 // -------------------------------------------------------------------------- |
| 406 // PagedSpace | 406 // PagedSpace |
| 407 | 407 |
| 408 bool PagedSpace::Contains(Address addr) { | 408 bool PagedSpace::Contains(Address addr) { |
| 409 Page* p = Page::FromAddress(addr); | 409 Page* p = Page::FromAddress(addr); |
| 410 ASSERT(p->is_valid()); | 410 if (!p->is_valid()) return false; |
| 411 | |
| 412 return MemoryAllocator::IsPageInSpace(p, this); | 411 return MemoryAllocator::IsPageInSpace(p, this); |
| 413 } | 412 } |
| 414 | 413 |
| 415 | 414 |
| 416 // Try linear allocation in the page of alloc_info's allocation top. Does | 415 // Try linear allocation in the page of alloc_info's allocation top. Does |
| 417 // not contain slow case logic (eg, move to the next page or try free list | 416 // not contain slow case logic (eg, move to the next page or try free list |
| 418 // allocation) so it can be used by all the allocation functions and for all | 417 // allocation) so it can be used by all the allocation functions and for all |
| 419 // the paged spaces. | 418 // the paged spaces. |
| 420 HeapObject* PagedSpace::AllocateLinearly(AllocationInfo* alloc_info, | 419 HeapObject* PagedSpace::AllocateLinearly(AllocationInfo* alloc_info, |
| 421 int size_in_bytes) { | 420 int size_in_bytes) { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 | 491 |
| 493 bool FreeListNode::IsFreeListNode(HeapObject* object) { | 492 bool FreeListNode::IsFreeListNode(HeapObject* object) { |
| 494 return object->map() == Heap::raw_unchecked_byte_array_map() | 493 return object->map() == Heap::raw_unchecked_byte_array_map() |
| 495 || object->map() == Heap::raw_unchecked_one_pointer_filler_map() | 494 || object->map() == Heap::raw_unchecked_one_pointer_filler_map() |
| 496 || object->map() == Heap::raw_unchecked_two_pointer_filler_map(); | 495 || object->map() == Heap::raw_unchecked_two_pointer_filler_map(); |
| 497 } | 496 } |
| 498 | 497 |
| 499 } } // namespace v8::internal | 498 } } // namespace v8::internal |
| 500 | 499 |
| 501 #endif // V8_SPACES_INL_H_ | 500 #endif // V8_SPACES_INL_H_ |
| OLD | NEW |