| 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 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 | 176 |
| 177 Page* MemoryAllocator::GetNextPage(Page* p) { | 177 Page* MemoryAllocator::GetNextPage(Page* p) { |
| 178 ASSERT(p->is_valid()); | 178 ASSERT(p->is_valid()); |
| 179 intptr_t raw_addr = p->opaque_header & ~Page::kPageAlignmentMask; | 179 intptr_t raw_addr = p->opaque_header & ~Page::kPageAlignmentMask; |
| 180 return Page::FromAddress(AddressFrom<Address>(raw_addr)); | 180 return Page::FromAddress(AddressFrom<Address>(raw_addr)); |
| 181 } | 181 } |
| 182 | 182 |
| 183 | 183 |
| 184 int MemoryAllocator::GetChunkId(Page* p) { | 184 int MemoryAllocator::GetChunkId(Page* p) { |
| 185 ASSERT(p->is_valid()); | 185 ASSERT(p->is_valid()); |
| 186 return p->opaque_header & Page::kPageAlignmentMask; | 186 return static_cast<int>(p->opaque_header & Page::kPageAlignmentMask); |
| 187 } | 187 } |
| 188 | 188 |
| 189 | 189 |
| 190 void MemoryAllocator::SetNextPage(Page* prev, Page* next) { | 190 void MemoryAllocator::SetNextPage(Page* prev, Page* next) { |
| 191 ASSERT(prev->is_valid()); | 191 ASSERT(prev->is_valid()); |
| 192 int chunk_id = GetChunkId(prev); | 192 int chunk_id = GetChunkId(prev); |
| 193 ASSERT_PAGE_ALIGNED(next->address()); | 193 ASSERT_PAGE_ALIGNED(next->address()); |
| 194 prev->opaque_header = OffsetFrom(next->address()) | chunk_id; | 194 prev->opaque_header = OffsetFrom(next->address()) | chunk_id; |
| 195 } | 195 } |
| 196 | 196 |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 337 | 337 |
| 338 bool FreeListNode::IsFreeListNode(HeapObject* object) { | 338 bool FreeListNode::IsFreeListNode(HeapObject* object) { |
| 339 return object->map() == Heap::raw_unchecked_byte_array_map() | 339 return object->map() == Heap::raw_unchecked_byte_array_map() |
| 340 || object->map() == Heap::raw_unchecked_one_pointer_filler_map() | 340 || object->map() == Heap::raw_unchecked_one_pointer_filler_map() |
| 341 || object->map() == Heap::raw_unchecked_two_pointer_filler_map(); | 341 || object->map() == Heap::raw_unchecked_two_pointer_filler_map(); |
| 342 } | 342 } |
| 343 | 343 |
| 344 } } // namespace v8::internal | 344 } } // namespace v8::internal |
| 345 | 345 |
| 346 #endif // V8_SPACES_INL_H_ | 346 #endif // V8_SPACES_INL_H_ |
| OLD | NEW |