| 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_at_last_gc_ = | 1376 old_generation_allocation_counter_at_last_gc_ = |
| 1376 OldGenerationAllocationCounter(); | 1377 OldGenerationAllocationCounter(); |
| (...skipping 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2642 } | 2643 } |
| 2643 | 2644 |
| 2644 private: | 2645 private: |
| 2645 Heap* heap_; | 2646 Heap* heap_; |
| 2646 }; | 2647 }; |
| 2647 | 2648 |
| 2648 } // namespace internal | 2649 } // namespace internal |
| 2649 } // namespace v8 | 2650 } // namespace v8 |
| 2650 | 2651 |
| 2651 #endif // V8_HEAP_HEAP_H_ | 2652 #endif // V8_HEAP_HEAP_H_ |
| OLD | NEW |