| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef V8_HEAP_HEAP_H_ | 5 #ifndef V8_HEAP_HEAP_H_ |
| 6 #define V8_HEAP_HEAP_H_ | 6 #define V8_HEAP_HEAP_H_ |
| 7 | 7 |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <map> | 9 #include <map> |
| 10 | 10 |
| (...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 | 316 |
| 317 void Initialize(); | 317 void Initialize(); |
| 318 | 318 |
| 319 void Destroy() { | 319 void Destroy() { |
| 320 DCHECK(is_empty()); | 320 DCHECK(is_empty()); |
| 321 delete emergency_stack_; | 321 delete emergency_stack_; |
| 322 emergency_stack_ = NULL; | 322 emergency_stack_ = NULL; |
| 323 } | 323 } |
| 324 | 324 |
| 325 Page* GetHeadPage() { | 325 Page* GetHeadPage() { |
| 326 return Page::FromAllocationTop(reinterpret_cast<Address>(rear_)); | 326 return Page::FromAllocationAreaAddress(reinterpret_cast<Address>(rear_)); |
| 327 } | 327 } |
| 328 | 328 |
| 329 void SetNewLimit(Address limit) { | 329 void SetNewLimit(Address limit) { |
| 330 // If we are already using an emergency stack, we can ignore it. | 330 // If we are already using an emergency stack, we can ignore it. |
| 331 if (emergency_stack_) return; | 331 if (emergency_stack_) return; |
| 332 | 332 |
| 333 // If the limit is not on the same page, we can ignore it. | 333 // If the limit is not on the same page, we can ignore it. |
| 334 if (Page::FromAllocationTop(limit) != GetHeadPage()) return; | 334 if (Page::FromAllocationAreaAddress(limit) != GetHeadPage()) return; |
| 335 | 335 |
| 336 limit_ = reinterpret_cast<struct Entry*>(limit); | 336 limit_ = reinterpret_cast<struct Entry*>(limit); |
| 337 | 337 |
| 338 if (limit_ <= rear_) { | 338 if (limit_ <= rear_) { |
| 339 return; | 339 return; |
| 340 } | 340 } |
| 341 | 341 |
| 342 RelocateQueueHead(); | 342 RelocateQueueHead(); |
| 343 } | 343 } |
| 344 | 344 |
| (...skipping 2305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2650 friend class LargeObjectSpace; | 2650 friend class LargeObjectSpace; |
| 2651 friend class NewSpace; | 2651 friend class NewSpace; |
| 2652 friend class PagedSpace; | 2652 friend class PagedSpace; |
| 2653 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2653 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
| 2654 }; | 2654 }; |
| 2655 | 2655 |
| 2656 } // namespace internal | 2656 } // namespace internal |
| 2657 } // namespace v8 | 2657 } // namespace v8 |
| 2658 | 2658 |
| 2659 #endif // V8_HEAP_HEAP_H_ | 2659 #endif // V8_HEAP_HEAP_H_ |
| OLD | NEW |