| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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_SPACES_H_ | 5 #ifndef V8_SPACES_H_ |
| 6 #define V8_SPACES_H_ | 6 #define V8_SPACES_H_ |
| 7 | 7 |
| 8 #include "allocation.h" | 8 #include "allocation.h" |
| 9 #include "hashmap.h" | 9 #include "hashmap.h" |
| 10 #include "list.h" | 10 #include "list.h" |
| (...skipping 2481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2492 intptr_t Available() { | 2492 intptr_t Available() { |
| 2493 return Capacity() - Size(); | 2493 return Capacity() - Size(); |
| 2494 } | 2494 } |
| 2495 | 2495 |
| 2496 // Return the maximum capacity of a semispace. | 2496 // Return the maximum capacity of a semispace. |
| 2497 int MaximumCapacity() { | 2497 int MaximumCapacity() { |
| 2498 ASSERT(to_space_.MaximumCapacity() == from_space_.MaximumCapacity()); | 2498 ASSERT(to_space_.MaximumCapacity() == from_space_.MaximumCapacity()); |
| 2499 return to_space_.MaximumCapacity(); | 2499 return to_space_.MaximumCapacity(); |
| 2500 } | 2500 } |
| 2501 | 2501 |
| 2502 bool IsAtMaximumCapacity() { |
| 2503 return Capacity() == MaximumCapacity(); |
| 2504 } |
| 2505 |
| 2502 // Returns the initial capacity of a semispace. | 2506 // Returns the initial capacity of a semispace. |
| 2503 int InitialCapacity() { | 2507 int InitialCapacity() { |
| 2504 ASSERT(to_space_.InitialCapacity() == from_space_.InitialCapacity()); | 2508 ASSERT(to_space_.InitialCapacity() == from_space_.InitialCapacity()); |
| 2505 return to_space_.InitialCapacity(); | 2509 return to_space_.InitialCapacity(); |
| 2506 } | 2510 } |
| 2507 | 2511 |
| 2508 // Return the address of the allocation pointer in the active semispace. | 2512 // Return the address of the allocation pointer in the active semispace. |
| 2509 Address top() { | 2513 Address top() { |
| 2510 ASSERT(to_space_.current_page()->ContainsLimit(allocation_info_.top())); | 2514 ASSERT(to_space_.current_page()->ContainsLimit(allocation_info_.top())); |
| 2511 return allocation_info_.top(); | 2515 return allocation_info_.top(); |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2996 } | 3000 } |
| 2997 // Must be small, since an iteration is used for lookup. | 3001 // Must be small, since an iteration is used for lookup. |
| 2998 static const int kMaxComments = 64; | 3002 static const int kMaxComments = 64; |
| 2999 }; | 3003 }; |
| 3000 #endif | 3004 #endif |
| 3001 | 3005 |
| 3002 | 3006 |
| 3003 } } // namespace v8::internal | 3007 } } // namespace v8::internal |
| 3004 | 3008 |
| 3005 #endif // V8_SPACES_H_ | 3009 #endif // V8_SPACES_H_ |
| OLD | NEW |