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 1054 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1065 void CollectAllAvailableGarbage(const char* gc_reason = NULL); | 1065 void CollectAllAvailableGarbage(const char* gc_reason = NULL); |
1066 | 1066 |
1067 // Check whether the heap is currently iterable. | 1067 // Check whether the heap is currently iterable. |
1068 bool IsHeapIterable(); | 1068 bool IsHeapIterable(); |
1069 | 1069 |
1070 // Ensure that we have swept all spaces in such a way that we can iterate | 1070 // Ensure that we have swept all spaces in such a way that we can iterate |
1071 // over all objects. May cause a GC. | 1071 // over all objects. May cause a GC. |
1072 void EnsureHeapIsIterable(); | 1072 void EnsureHeapIsIterable(); |
1073 | 1073 |
1074 // Notify the heap that a context has been disposed. | 1074 // Notify the heap that a context has been disposed. |
1075 int NotifyContextDisposed() { return ++contexts_disposed_; } | 1075 int NotifyContextDisposed() { |
| 1076 flush_monomorphic_ics_ = true; |
| 1077 return ++contexts_disposed_; |
| 1078 } |
1076 | 1079 |
1077 // Utility to invoke the scavenger. This is needed in test code to | 1080 // Utility to invoke the scavenger. This is needed in test code to |
1078 // ensure correct callback for weak global handles. | 1081 // ensure correct callback for weak global handles. |
1079 void PerformScavenge(); | 1082 void PerformScavenge(); |
1080 | 1083 |
1081 inline void increment_scan_on_scavenge_pages() { | 1084 inline void increment_scan_on_scavenge_pages() { |
1082 scan_on_scavenge_pages_++; | 1085 scan_on_scavenge_pages_++; |
1083 if (FLAG_gc_verbose) { | 1086 if (FLAG_gc_verbose) { |
1084 PrintF("Scan-on-scavenge pages: %d\n", scan_on_scavenge_pages_); | 1087 PrintF("Scan-on-scavenge pages: %d\n", scan_on_scavenge_pages_); |
1085 } | 1088 } |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1590 // 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 |
1591 // disposal. We use it to flush inline caches. | 1594 // disposal. We use it to flush inline caches. |
1592 int global_ic_age() { | 1595 int global_ic_age() { |
1593 return global_ic_age_; | 1596 return global_ic_age_; |
1594 } | 1597 } |
1595 | 1598 |
1596 void AgeInlineCaches() { | 1599 void AgeInlineCaches() { |
1597 global_ic_age_ = (global_ic_age_ + 1) & SharedFunctionInfo::ICAgeBits::kMax; | 1600 global_ic_age_ = (global_ic_age_ + 1) & SharedFunctionInfo::ICAgeBits::kMax; |
1598 } | 1601 } |
1599 | 1602 |
| 1603 bool flush_monomorphic_ics() { return flush_monomorphic_ics_; } |
| 1604 |
1600 intptr_t amount_of_external_allocated_memory() { | 1605 intptr_t amount_of_external_allocated_memory() { |
1601 return amount_of_external_allocated_memory_; | 1606 return amount_of_external_allocated_memory_; |
1602 } | 1607 } |
1603 | 1608 |
1604 // ObjectStats are kept in two arrays, counts and sizes. Related stats are | 1609 // ObjectStats are kept in two arrays, counts and sizes. Related stats are |
1605 // stored in a contiguous linear buffer. Stats groups are stored one after | 1610 // stored in a contiguous linear buffer. Stats groups are stored one after |
1606 // another. | 1611 // another. |
1607 enum { | 1612 enum { |
1608 FIRST_CODE_KIND_SUB_TYPE = LAST_TYPE + 1, | 1613 FIRST_CODE_KIND_SUB_TYPE = LAST_TYPE + 1, |
1609 FIRST_FIXED_ARRAY_SUB_TYPE = | 1614 FIRST_FIXED_ARRAY_SUB_TYPE = |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1675 int sweep_generation_; | 1680 int sweep_generation_; |
1676 | 1681 |
1677 int always_allocate_scope_depth_; | 1682 int always_allocate_scope_depth_; |
1678 int linear_allocation_scope_depth_; | 1683 int linear_allocation_scope_depth_; |
1679 | 1684 |
1680 // For keeping track of context disposals. | 1685 // For keeping track of context disposals. |
1681 int contexts_disposed_; | 1686 int contexts_disposed_; |
1682 | 1687 |
1683 int global_ic_age_; | 1688 int global_ic_age_; |
1684 | 1689 |
| 1690 bool flush_monomorphic_ics_; |
| 1691 |
1685 int scan_on_scavenge_pages_; | 1692 int scan_on_scavenge_pages_; |
1686 | 1693 |
1687 #if defined(V8_TARGET_ARCH_X64) | 1694 #if defined(V8_TARGET_ARCH_X64) |
1688 static const int kMaxObjectSizeInNewSpace = 1024*KB; | 1695 static const int kMaxObjectSizeInNewSpace = 1024*KB; |
1689 #else | 1696 #else |
1690 static const int kMaxObjectSizeInNewSpace = 512*KB; | 1697 static const int kMaxObjectSizeInNewSpace = 512*KB; |
1691 #endif | 1698 #endif |
1692 | 1699 |
1693 NewSpace new_space_; | 1700 NewSpace new_space_; |
1694 OldSpace* old_pointer_space_; | 1701 OldSpace* old_pointer_space_; |
(...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2772 AssertNoAllocation no_alloc; // i.e. no gc allowed. | 2779 AssertNoAllocation no_alloc; // i.e. no gc allowed. |
2773 | 2780 |
2774 private: | 2781 private: |
2775 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2782 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2776 }; | 2783 }; |
2777 #endif // DEBUG || LIVE_OBJECT_LIST | 2784 #endif // DEBUG || LIVE_OBJECT_LIST |
2778 | 2785 |
2779 } } // namespace v8::internal | 2786 } } // namespace v8::internal |
2780 | 2787 |
2781 #endif // V8_HEAP_H_ | 2788 #endif // V8_HEAP_H_ |
OLD | NEW |