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 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1096 void CollectAllAvailableGarbage(const char* gc_reason = NULL); | 1096 void CollectAllAvailableGarbage(const char* gc_reason = NULL); |
1097 | 1097 |
1098 // Check whether the heap is currently iterable. | 1098 // Check whether the heap is currently iterable. |
1099 bool IsHeapIterable(); | 1099 bool IsHeapIterable(); |
1100 | 1100 |
1101 // Ensure that we have swept all spaces in such a way that we can iterate | 1101 // Ensure that we have swept all spaces in such a way that we can iterate |
1102 // over all objects. May cause a GC. | 1102 // over all objects. May cause a GC. |
1103 void EnsureHeapIsIterable(); | 1103 void EnsureHeapIsIterable(); |
1104 | 1104 |
1105 // Notify the heap that a context has been disposed. | 1105 // Notify the heap that a context has been disposed. |
1106 int NotifyContextDisposed() { return ++contexts_disposed_; } | 1106 int NotifyContextDisposed() { |
| 1107 flush_monomorphic_ics_ = true; |
| 1108 return ++contexts_disposed_; |
| 1109 } |
1107 | 1110 |
1108 // Utility to invoke the scavenger. This is needed in test code to | 1111 // Utility to invoke the scavenger. This is needed in test code to |
1109 // ensure correct callback for weak global handles. | 1112 // ensure correct callback for weak global handles. |
1110 void PerformScavenge(); | 1113 void PerformScavenge(); |
1111 | 1114 |
1112 inline void increment_scan_on_scavenge_pages() { | 1115 inline void increment_scan_on_scavenge_pages() { |
1113 scan_on_scavenge_pages_++; | 1116 scan_on_scavenge_pages_++; |
1114 if (FLAG_gc_verbose) { | 1117 if (FLAG_gc_verbose) { |
1115 PrintF("Scan-on-scavenge pages: %d\n", scan_on_scavenge_pages_); | 1118 PrintF("Scan-on-scavenge pages: %d\n", scan_on_scavenge_pages_); |
1116 } | 1119 } |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1613 // Global inline caching age: it is incremented on some GCs after context | 1616 // Global inline caching age: it is incremented on some GCs after context |
1614 // disposal. We use it to flush inline caches. | 1617 // disposal. We use it to flush inline caches. |
1615 int global_ic_age() { | 1618 int global_ic_age() { |
1616 return global_ic_age_; | 1619 return global_ic_age_; |
1617 } | 1620 } |
1618 | 1621 |
1619 void AgeInlineCaches() { | 1622 void AgeInlineCaches() { |
1620 global_ic_age_ = (global_ic_age_ + 1) & SharedFunctionInfo::ICAgeBits::kMax; | 1623 global_ic_age_ = (global_ic_age_ + 1) & SharedFunctionInfo::ICAgeBits::kMax; |
1621 } | 1624 } |
1622 | 1625 |
| 1626 bool flush_monomorphic_ics() { return flush_monomorphic_ics_; } |
| 1627 |
1623 intptr_t amount_of_external_allocated_memory() { | 1628 intptr_t amount_of_external_allocated_memory() { |
1624 return amount_of_external_allocated_memory_; | 1629 return amount_of_external_allocated_memory_; |
1625 } | 1630 } |
1626 | 1631 |
1627 // ObjectStats are kept in two arrays, counts and sizes. Related stats are | 1632 // ObjectStats are kept in two arrays, counts and sizes. Related stats are |
1628 // stored in a contiguous linear buffer. Stats groups are stored one after | 1633 // stored in a contiguous linear buffer. Stats groups are stored one after |
1629 // another. | 1634 // another. |
1630 enum { | 1635 enum { |
1631 FIRST_CODE_KIND_SUB_TYPE = LAST_TYPE + 1, | 1636 FIRST_CODE_KIND_SUB_TYPE = LAST_TYPE + 1, |
1632 FIRST_FIXED_ARRAY_SUB_TYPE = | 1637 FIRST_FIXED_ARRAY_SUB_TYPE = |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1698 int sweep_generation_; | 1703 int sweep_generation_; |
1699 | 1704 |
1700 int always_allocate_scope_depth_; | 1705 int always_allocate_scope_depth_; |
1701 int linear_allocation_scope_depth_; | 1706 int linear_allocation_scope_depth_; |
1702 | 1707 |
1703 // For keeping track of context disposals. | 1708 // For keeping track of context disposals. |
1704 int contexts_disposed_; | 1709 int contexts_disposed_; |
1705 | 1710 |
1706 int global_ic_age_; | 1711 int global_ic_age_; |
1707 | 1712 |
| 1713 bool flush_monomorphic_ics_; |
| 1714 |
1708 int scan_on_scavenge_pages_; | 1715 int scan_on_scavenge_pages_; |
1709 | 1716 |
1710 #if defined(V8_TARGET_ARCH_X64) | 1717 #if defined(V8_TARGET_ARCH_X64) |
1711 static const int kMaxObjectSizeInNewSpace = 1024*KB; | 1718 static const int kMaxObjectSizeInNewSpace = 1024*KB; |
1712 #else | 1719 #else |
1713 static const int kMaxObjectSizeInNewSpace = 512*KB; | 1720 static const int kMaxObjectSizeInNewSpace = 512*KB; |
1714 #endif | 1721 #endif |
1715 | 1722 |
1716 NewSpace new_space_; | 1723 NewSpace new_space_; |
1717 OldSpace* old_pointer_space_; | 1724 OldSpace* old_pointer_space_; |
(...skipping 1076 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2794 AssertNoAllocation no_alloc; // i.e. no gc allowed. | 2801 AssertNoAllocation no_alloc; // i.e. no gc allowed. |
2795 | 2802 |
2796 private: | 2803 private: |
2797 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2804 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2798 }; | 2805 }; |
2799 #endif // DEBUG || LIVE_OBJECT_LIST | 2806 #endif // DEBUG || LIVE_OBJECT_LIST |
2800 | 2807 |
2801 } } // namespace v8::internal | 2808 } } // namespace v8::internal |
2802 | 2809 |
2803 #endif // V8_HEAP_H_ | 2810 #endif // V8_HEAP_H_ |
OLD | NEW |