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 | |
1368 inline size_t NewSpaceAllocationCounter(); | 1367 inline size_t NewSpaceAllocationCounter(); |
1369 | 1368 |
1370 // This should be used only for testing. | 1369 // This should be used only for testing. |
1371 void set_new_space_allocation_counter(size_t new_value) { | 1370 void set_new_space_allocation_counter(size_t new_value) { |
1372 new_space_allocation_counter_ = new_value; | 1371 new_space_allocation_counter_ = new_value; |
1373 } | 1372 } |
1374 | 1373 |
1375 void UpdateOldGenerationAllocationCounter() { | 1374 void UpdateOldGenerationAllocationCounter() { |
1376 old_generation_allocation_counter_ = OldGenerationAllocationCounter(); | 1375 old_generation_allocation_counter_ = OldGenerationAllocationCounter(); |
1377 } | 1376 } |
(...skipping 1263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2641 friend class LargeObjectSpace; | 2640 friend class LargeObjectSpace; |
2642 friend class NewSpace; | 2641 friend class NewSpace; |
2643 friend class PagedSpace; | 2642 friend class PagedSpace; |
2644 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); | 2643 DISALLOW_COPY_AND_ASSIGN(AllocationObserver); |
2645 }; | 2644 }; |
2646 | 2645 |
2647 } // namespace internal | 2646 } // namespace internal |
2648 } // namespace v8 | 2647 } // namespace v8 |
2649 | 2648 |
2650 #endif // V8_HEAP_HEAP_H_ | 2649 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |