OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1593 // Global inline caching age: it is incremented on some GCs after context | 1593 // Global inline caching age: it is incremented on some GCs after context |
1594 // disposal. We use it to flush inline caches. | 1594 // disposal. We use it to flush inline caches. |
1595 int global_ic_age() { | 1595 int global_ic_age() { |
1596 return global_ic_age_; | 1596 return global_ic_age_; |
1597 } | 1597 } |
1598 | 1598 |
1599 void AgeInlineCaches() { | 1599 void AgeInlineCaches() { |
1600 global_ic_age_ = (global_ic_age_ + 1) & SharedFunctionInfo::ICAgeBits::kMax; | 1600 global_ic_age_ = (global_ic_age_ + 1) & SharedFunctionInfo::ICAgeBits::kMax; |
1601 } | 1601 } |
1602 | 1602 |
1603 void RecordObjectStats(InstanceType type, size_t size) { | 1603 enum { |
Michael Starzinger
2012/07/17 10:48:16
Can we have a short comment above this enum descri
danno
2012/07/17 11:57:10
Done.
| |
1604 FIRST_CODE_KIND_SUB_TYPE = LAST_TYPE + 1, | |
1605 OBJECT_STATS_COUNT = FIRST_CODE_KIND_SUB_TYPE + Code::LAST_CODE_KIND + 1 | |
1606 }; | |
1607 | |
1608 void RecordObjectStats(InstanceType type, int sub_type, size_t size) { | |
1604 ASSERT(type <= LAST_TYPE); | 1609 ASSERT(type <= LAST_TYPE); |
1605 object_counts_[type]++; | 1610 if (sub_type < 0) { |
1606 object_sizes_[type] += size; | 1611 object_counts_[type]++; |
1612 object_sizes_[type] += size; | |
1613 } else { | |
1614 if (type == CODE_TYPE) { | |
1615 ASSERT(sub_type <= Code::LAST_CODE_KIND); | |
1616 object_counts_[FIRST_CODE_KIND_SUB_TYPE + sub_type]++; | |
1617 object_sizes_[FIRST_CODE_KIND_SUB_TYPE + sub_type] += size; | |
1618 } | |
1619 } | |
1607 } | 1620 } |
1608 | 1621 |
1609 void CheckpointObjectStats(); | 1622 void CheckpointObjectStats(); |
1610 | 1623 |
1611 private: | 1624 private: |
1612 Heap(); | 1625 Heap(); |
1613 | 1626 |
1614 // This can be calculated directly from a pointer to the heap; however, it is | 1627 // This can be calculated directly from a pointer to the heap; however, it is |
1615 // more expedient to get at the isolate directly from within Heap methods. | 1628 // more expedient to get at the isolate directly from within Heap methods. |
1616 Isolate* isolate_; | 1629 Isolate* isolate_; |
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2001 | 2014 |
2002 void AdvanceIdleIncrementalMarking(intptr_t step_size); | 2015 void AdvanceIdleIncrementalMarking(intptr_t step_size); |
2003 | 2016 |
2004 void ClearObjectStats(bool clear_last_time_stats = false); | 2017 void ClearObjectStats(bool clear_last_time_stats = false); |
2005 | 2018 |
2006 static const int kInitialSymbolTableSize = 2048; | 2019 static const int kInitialSymbolTableSize = 2048; |
2007 static const int kInitialEvalCacheSize = 64; | 2020 static const int kInitialEvalCacheSize = 64; |
2008 static const int kInitialNumberStringCacheSize = 256; | 2021 static const int kInitialNumberStringCacheSize = 256; |
2009 | 2022 |
2010 // Object counts and used memory by InstanceType | 2023 // Object counts and used memory by InstanceType |
2011 size_t object_counts_[LAST_TYPE + 1]; | 2024 size_t object_counts_[OBJECT_STATS_COUNT]; |
2012 size_t object_counts_last_time_[LAST_TYPE + 1]; | 2025 size_t object_counts_last_time_[OBJECT_STATS_COUNT]; |
2013 size_t object_sizes_[LAST_TYPE + 1]; | 2026 size_t object_sizes_[OBJECT_STATS_COUNT]; |
2014 size_t object_sizes_last_time_[LAST_TYPE + 1]; | 2027 size_t object_sizes_last_time_[OBJECT_STATS_COUNT]; |
2015 | 2028 |
2016 // Maximum GC pause. | 2029 // Maximum GC pause. |
2017 int max_gc_pause_; | 2030 int max_gc_pause_; |
2018 | 2031 |
2019 // Maximum size of objects alive after GC. | 2032 // Maximum size of objects alive after GC. |
2020 intptr_t max_alive_after_gc_; | 2033 intptr_t max_alive_after_gc_; |
2021 | 2034 |
2022 // Minimal interval between two subsequent collections. | 2035 // Minimal interval between two subsequent collections. |
2023 int min_in_mutator_; | 2036 int min_in_mutator_; |
2024 | 2037 |
(...skipping 691 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2716 AssertNoAllocation no_alloc; // i.e. no gc allowed. | 2729 AssertNoAllocation no_alloc; // i.e. no gc allowed. |
2717 | 2730 |
2718 private: | 2731 private: |
2719 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2732 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2720 }; | 2733 }; |
2721 #endif // DEBUG || LIVE_OBJECT_LIST | 2734 #endif // DEBUG || LIVE_OBJECT_LIST |
2722 | 2735 |
2723 } } // namespace v8::internal | 2736 } } // namespace v8::internal |
2724 | 2737 |
2725 #endif // V8_HEAP_H_ | 2738 #endif // V8_HEAP_H_ |
OLD | NEW |