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 1238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1249 inline intptr_t PromotedTotalSize() { | 1249 inline intptr_t PromotedTotalSize() { |
1250 int64_t total = PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize(); | 1250 int64_t total = PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize(); |
1251 if (total > std::numeric_limits<intptr_t>::max()) { | 1251 if (total > std::numeric_limits<intptr_t>::max()) { |
1252 // TODO(erikcorry): Use uintptr_t everywhere we do heap size calculations. | 1252 // TODO(erikcorry): Use uintptr_t everywhere we do heap size calculations. |
1253 return std::numeric_limits<intptr_t>::max(); | 1253 return std::numeric_limits<intptr_t>::max(); |
1254 } | 1254 } |
1255 if (total < 0) return 0; | 1255 if (total < 0) return 0; |
1256 return static_cast<intptr_t>(total); | 1256 return static_cast<intptr_t>(total); |
1257 } | 1257 } |
1258 | 1258 |
1259 inline void UpdateNewSpaceAllocationCounter(); | 1259 V8_INLINE void UpdateNewSpaceAllocationCounter(); |
1260 inline size_t NewSpaceAllocationCounter(); | 1260 V8_INLINE size_t NewSpaceAllocationCounter(); |
1261 | 1261 |
1262 // This should be used only for testing. | 1262 // This should be used only for testing. |
1263 void set_new_space_allocation_counter(size_t new_value) { | 1263 void set_new_space_allocation_counter(size_t new_value) { |
1264 new_space_allocation_counter_ = new_value; | 1264 new_space_allocation_counter_ = new_value; |
1265 } | 1265 } |
1266 | 1266 |
1267 void UpdateOldGenerationAllocationCounter() { | 1267 void UpdateOldGenerationAllocationCounter() { |
1268 old_generation_allocation_counter_ = OldGenerationAllocationCounter(); | 1268 old_generation_allocation_counter_ = OldGenerationAllocationCounter(); |
1269 } | 1269 } |
1270 | 1270 |
(...skipping 1378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2649 friend class LargeObjectSpace; | 2649 friend class LargeObjectSpace; |
2650 friend class NewSpace; | 2650 friend class NewSpace; |
2651 friend class PagedSpace; | 2651 friend class PagedSpace; |
2652 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2652 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
2653 }; | 2653 }; |
2654 | 2654 |
2655 } // namespace internal | 2655 } // namespace internal |
2656 } // namespace v8 | 2656 } // namespace v8 |
2657 | 2657 |
2658 #endif // V8_HEAP_HEAP_H_ | 2658 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |