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 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1357 int64_t total = PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize(); | 1357 int64_t total = PromotedSpaceSizeOfObjects() + PromotedExternalMemorySize(); |
1358 if (total > std::numeric_limits<intptr_t>::max()) { | 1358 if (total > std::numeric_limits<intptr_t>::max()) { |
1359 // TODO(erikcorry): Use uintptr_t everywhere we do heap size calculations. | 1359 // TODO(erikcorry): Use uintptr_t everywhere we do heap size calculations. |
1360 return std::numeric_limits<intptr_t>::max(); | 1360 return std::numeric_limits<intptr_t>::max(); |
1361 } | 1361 } |
1362 if (total < 0) return 0; | 1362 if (total < 0) return 0; |
1363 return static_cast<intptr_t>(total); | 1363 return static_cast<intptr_t>(total); |
1364 } | 1364 } |
1365 | 1365 |
1366 inline void UpdateNewSpaceAllocationCounter(); | 1366 inline void UpdateNewSpaceAllocationCounter(); |
| 1367 |
1367 inline size_t NewSpaceAllocationCounter(); | 1368 inline size_t NewSpaceAllocationCounter(); |
1368 | 1369 |
1369 // This should be used only for testing. | 1370 // This should be used only for testing. |
1370 void set_new_space_allocation_counter(size_t new_value) { | 1371 void set_new_space_allocation_counter(size_t new_value) { |
1371 new_space_allocation_counter_ = new_value; | 1372 new_space_allocation_counter_ = new_value; |
1372 } | 1373 } |
1373 | 1374 |
1374 void UpdateOldGenerationAllocationCounter() { | 1375 void UpdateOldGenerationAllocationCounter() { |
1375 old_generation_allocation_counter_ = OldGenerationAllocationCounter(); | 1376 old_generation_allocation_counter_ = OldGenerationAllocationCounter(); |
1376 } | 1377 } |
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2640 friend class LargeObjectSpace; | 2641 friend class LargeObjectSpace; |
2641 friend class NewSpace; | 2642 friend class NewSpace; |
2642 friend class PagedSpace; | 2643 friend class PagedSpace; |
2643 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2644 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
2644 }; | 2645 }; |
2645 | 2646 |
2646 } // namespace internal | 2647 } // namespace internal |
2647 } // namespace v8 | 2648 } // namespace v8 |
2648 | 2649 |
2649 #endif // V8_HEAP_HEAP_H_ | 2650 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |