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 999 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1010 // Number of "runtime allocations" done so far. | 1010 // Number of "runtime allocations" done so far. |
1011 uint32_t allocations_count() { return allocations_count_; } | 1011 uint32_t allocations_count() { return allocations_count_; } |
1012 | 1012 |
1013 // Returns deterministic "time" value in ms. Works only with | 1013 // Returns deterministic "time" value in ms. Works only with |
1014 // FLAG_verify_predictable. | 1014 // FLAG_verify_predictable. |
1015 double synthetic_time() { return allocations_count_ / 2.0; } | 1015 double synthetic_time() { return allocations_count_ / 2.0; } |
1016 | 1016 |
1017 // Print short heap statistics. | 1017 // Print short heap statistics. |
1018 void PrintShortHeapStatistics(); | 1018 void PrintShortHeapStatistics(); |
1019 | 1019 |
1020 size_t object_count_last_gc(size_t type) { | |
1021 return object_counts_last_time_[type]; | |
picksi
2015/05/05 14:01:55
Should we DCHECK the array bounds here for safety?
ssid
2015/05/05 14:48:01
Done.
| |
1022 } | |
1023 size_t object_size_last_gc(size_t type) { | |
1024 return object_sizes_last_time_[type]; | |
1025 } | |
1026 | |
1020 // Write barrier support for address[offset] = o. | 1027 // Write barrier support for address[offset] = o. |
1021 INLINE(void RecordWrite(Address address, int offset)); | 1028 INLINE(void RecordWrite(Address address, int offset)); |
1022 | 1029 |
1023 // Write barrier support for address[start : start + len[ = o. | 1030 // Write barrier support for address[start : start + len[ = o. |
1024 INLINE(void RecordWrites(Address address, int start, int len)); | 1031 INLINE(void RecordWrites(Address address, int start, int len)); |
1025 | 1032 |
1026 enum HeapState { NOT_IN_GC, SCAVENGE, MARK_COMPACT }; | 1033 enum HeapState { NOT_IN_GC, SCAVENGE, MARK_COMPACT }; |
1027 inline HeapState gc_state() { return gc_state_; } | 1034 inline HeapState gc_state() { return gc_state_; } |
1028 | 1035 |
1029 inline bool IsInGCPostProcessing() { return gc_post_processing_depth_ > 0; } | 1036 inline bool IsInGCPostProcessing() { return gc_post_processing_depth_ > 0; } |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1438 | 1445 |
1439 void RecordFixedArraySubTypeStats(int array_sub_type, size_t size) { | 1446 void RecordFixedArraySubTypeStats(int array_sub_type, size_t size) { |
1440 DCHECK(array_sub_type <= LAST_FIXED_ARRAY_SUB_TYPE); | 1447 DCHECK(array_sub_type <= LAST_FIXED_ARRAY_SUB_TYPE); |
1441 object_counts_[FIRST_FIXED_ARRAY_SUB_TYPE + array_sub_type]++; | 1448 object_counts_[FIRST_FIXED_ARRAY_SUB_TYPE + array_sub_type]++; |
1442 object_sizes_[FIRST_FIXED_ARRAY_SUB_TYPE + array_sub_type] += size; | 1449 object_sizes_[FIRST_FIXED_ARRAY_SUB_TYPE + array_sub_type] += size; |
1443 } | 1450 } |
1444 | 1451 |
1445 void TraceObjectStats(); | 1452 void TraceObjectStats(); |
1446 void TraceObjectStat(const char* name, int count, int size, double time); | 1453 void TraceObjectStat(const char* name, int count, int size, double time); |
1447 void CheckpointObjectStats(); | 1454 void CheckpointObjectStats(); |
1455 const char* GetObjectTypeName(size_t index); | |
Primiano Tucci (use gerrit)
2015/05/05 14:17:53
Should this be near the other ones you are adding?
ssid
2015/05/05 14:26:16
the previous function does the same kind of operat
ulan
2015/05/06 12:46:02
This place is correct. The "index" has meaning onl
| |
1448 | 1456 |
1449 // We don't use a LockGuard here since we want to lock the heap | 1457 // We don't use a LockGuard here since we want to lock the heap |
1450 // only when FLAG_concurrent_recompilation is true. | 1458 // only when FLAG_concurrent_recompilation is true. |
1451 class RelocationLock { | 1459 class RelocationLock { |
1452 public: | 1460 public: |
1453 explicit RelocationLock(Heap* heap) : heap_(heap) { | 1461 explicit RelocationLock(Heap* heap) : heap_(heap) { |
1454 heap_->relocation_mutex_.Lock(); | 1462 heap_->relocation_mutex_.Lock(); |
1455 } | 1463 } |
1456 | 1464 |
1457 | 1465 |
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2608 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. | 2616 DisallowHeapAllocation no_allocation; // i.e. no gc allowed. |
2609 | 2617 |
2610 private: | 2618 private: |
2611 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2619 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2612 }; | 2620 }; |
2613 #endif // DEBUG | 2621 #endif // DEBUG |
2614 } | 2622 } |
2615 } // namespace v8::internal | 2623 } // namespace v8::internal |
2616 | 2624 |
2617 #endif // V8_HEAP_HEAP_H_ | 2625 #endif // V8_HEAP_HEAP_H_ |
OLD | NEW |