| 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 2082 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2093 ASSERT(to_space_.Capacity() == from_space_.Capacity()); | 2093 ASSERT(to_space_.Capacity() == from_space_.Capacity()); |
| 2094 return to_space_.Capacity(); | 2094 return to_space_.Capacity(); |
| 2095 } | 2095 } |
| 2096 | 2096 |
| 2097 // Return the total amount of memory committed for new space. | 2097 // Return the total amount of memory committed for new space. |
| 2098 intptr_t CommittedMemory() { | 2098 intptr_t CommittedMemory() { |
| 2099 if (from_space_.is_committed()) return 2 * Capacity(); | 2099 if (from_space_.is_committed()) return 2 * Capacity(); |
| 2100 return Capacity(); | 2100 return Capacity(); |
| 2101 } | 2101 } |
| 2102 | 2102 |
| 2103 // Return the available bytes without growing or switching page in the | 2103 // Return the available bytes without growing. |
| 2104 // active semispace. | |
| 2105 intptr_t Available() { | 2104 intptr_t Available() { |
| 2106 return allocation_info_.limit - allocation_info_.top; | 2105 return Capacity() - Size(); |
| 2107 } | 2106 } |
| 2108 | 2107 |
| 2109 // Return the maximum capacity of a semispace. | 2108 // Return the maximum capacity of a semispace. |
| 2110 int MaximumCapacity() { | 2109 int MaximumCapacity() { |
| 2111 ASSERT(to_space_.MaximumCapacity() == from_space_.MaximumCapacity()); | 2110 ASSERT(to_space_.MaximumCapacity() == from_space_.MaximumCapacity()); |
| 2112 return to_space_.MaximumCapacity(); | 2111 return to_space_.MaximumCapacity(); |
| 2113 } | 2112 } |
| 2114 | 2113 |
| 2115 // Returns the initial capacity of a semispace. | 2114 // Returns the initial capacity of a semispace. |
| 2116 int InitialCapacity() { | 2115 int InitialCapacity() { |
| (...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2619 } | 2618 } |
| 2620 // Must be small, since an iteration is used for lookup. | 2619 // Must be small, since an iteration is used for lookup. |
| 2621 static const int kMaxComments = 64; | 2620 static const int kMaxComments = 64; |
| 2622 }; | 2621 }; |
| 2623 #endif | 2622 #endif |
| 2624 | 2623 |
| 2625 | 2624 |
| 2626 } } // namespace v8::internal | 2625 } } // namespace v8::internal |
| 2627 | 2626 |
| 2628 #endif // V8_SPACES_H_ | 2627 #endif // V8_SPACES_H_ |
| OLD | NEW |