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 1583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1594 | 1594 |
1595 void AgeInlineCaches() { | 1595 void AgeInlineCaches() { |
1596 global_ic_age_ = (global_ic_age_ + 1) & SharedFunctionInfo::ICAgeBits::kMax; | 1596 global_ic_age_ = (global_ic_age_ + 1) & SharedFunctionInfo::ICAgeBits::kMax; |
1597 } | 1597 } |
1598 | 1598 |
1599 // ObjectStats are kept in two arrays, counts and sizes. Related stats are | 1599 // ObjectStats are kept in two arrays, counts and sizes. Related stats are |
1600 // stored in a contiguous linear buffer. Stats groups are stored one after | 1600 // stored in a contiguous linear buffer. Stats groups are stored one after |
1601 // another. | 1601 // another. |
1602 enum { | 1602 enum { |
1603 FIRST_CODE_KIND_SUB_TYPE = LAST_TYPE + 1, | 1603 FIRST_CODE_KIND_SUB_TYPE = LAST_TYPE + 1, |
1604 OBJECT_STATS_COUNT = FIRST_CODE_KIND_SUB_TYPE + Code::LAST_CODE_KIND + 1 | 1604 FIRST_FIXED_ARRAY_SUB_TYPE = |
| 1605 FIRST_CODE_KIND_SUB_TYPE + Code::LAST_CODE_KIND + 1, |
| 1606 OBJECT_STATS_COUNT = |
| 1607 FIRST_FIXED_ARRAY_SUB_TYPE + LAST_FIXED_ARRAY_SUB_TYPE + 1 |
1605 }; | 1608 }; |
1606 | 1609 |
1607 void RecordObjectStats(InstanceType type, int sub_type, size_t size) { | 1610 void RecordObjectStats(InstanceType type, int sub_type, size_t size) { |
1608 ASSERT(type <= LAST_TYPE); | 1611 ASSERT(type <= LAST_TYPE); |
1609 if (sub_type < 0) { | 1612 if (sub_type < 0) { |
1610 object_counts_[type]++; | 1613 object_counts_[type]++; |
1611 object_sizes_[type] += size; | 1614 object_sizes_[type] += size; |
1612 } else { | 1615 } else { |
1613 if (type == CODE_TYPE) { | 1616 if (type == CODE_TYPE) { |
1614 ASSERT(sub_type <= Code::LAST_CODE_KIND); | 1617 ASSERT(sub_type <= Code::LAST_CODE_KIND); |
1615 object_counts_[FIRST_CODE_KIND_SUB_TYPE + sub_type]++; | 1618 object_counts_[FIRST_CODE_KIND_SUB_TYPE + sub_type]++; |
1616 object_sizes_[FIRST_CODE_KIND_SUB_TYPE + sub_type] += size; | 1619 object_sizes_[FIRST_CODE_KIND_SUB_TYPE + sub_type] += size; |
| 1620 } else if (type == FIXED_ARRAY_TYPE) { |
| 1621 ASSERT(sub_type <= LAST_FIXED_ARRAY_SUB_TYPE); |
| 1622 object_counts_[FIRST_FIXED_ARRAY_SUB_TYPE + sub_type]++; |
| 1623 object_sizes_[FIRST_FIXED_ARRAY_SUB_TYPE + sub_type] += size; |
1617 } | 1624 } |
1618 } | 1625 } |
1619 } | 1626 } |
1620 | 1627 |
1621 void CheckpointObjectStats(); | 1628 void CheckpointObjectStats(); |
1622 | 1629 |
1623 // We don't use a ScopedLock here since we want to lock the heap | 1630 // We don't use a ScopedLock here since we want to lock the heap |
1624 // only when FLAG_parallel_recompilation is true. | 1631 // only when FLAG_parallel_recompilation is true. |
1625 class RelocationLock { | 1632 class RelocationLock { |
1626 public: | 1633 public: |
(...skipping 1124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2751 AssertNoAllocation no_alloc; // i.e. no gc allowed. | 2758 AssertNoAllocation no_alloc; // i.e. no gc allowed. |
2752 | 2759 |
2753 private: | 2760 private: |
2754 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2761 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2755 }; | 2762 }; |
2756 #endif // DEBUG || LIVE_OBJECT_LIST | 2763 #endif // DEBUG || LIVE_OBJECT_LIST |
2757 | 2764 |
2758 } } // namespace v8::internal | 2765 } } // namespace v8::internal |
2759 | 2766 |
2760 #endif // V8_HEAP_H_ | 2767 #endif // V8_HEAP_H_ |
OLD | NEW |