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 1047 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1058 void CollectAllAvailableGarbage(const char* gc_reason = NULL); | 1058 void CollectAllAvailableGarbage(const char* gc_reason = NULL); |
1059 | 1059 |
1060 // Check whether the heap is currently iterable. | 1060 // Check whether the heap is currently iterable. |
1061 bool IsHeapIterable(); | 1061 bool IsHeapIterable(); |
1062 | 1062 |
1063 // Ensure that we have swept all spaces in such a way that we can iterate | 1063 // Ensure that we have swept all spaces in such a way that we can iterate |
1064 // over all objects. May cause a GC. | 1064 // over all objects. May cause a GC. |
1065 void EnsureHeapIsIterable(); | 1065 void EnsureHeapIsIterable(); |
1066 | 1066 |
1067 // Notify the heap that a context has been disposed. | 1067 // Notify the heap that a context has been disposed. |
1068 int NotifyContextDisposed() { return ++contexts_disposed_; } | 1068 int NotifyContextDisposed() { |
| 1069 return ++contexts_disposed_; |
| 1070 } |
| 1071 |
| 1072 void NotifyGlobalContextDisposed() { |
| 1073 ++global_context_disposed_count_; |
| 1074 } |
| 1075 |
| 1076 int global_context_disposed_count() { |
| 1077 return global_context_disposed_count_; |
| 1078 } |
1069 | 1079 |
1070 // 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 |
1071 // ensure correct callback for weak global handles. | 1081 // ensure correct callback for weak global handles. |
1072 void PerformScavenge(); | 1082 void PerformScavenge(); |
1073 | 1083 |
1074 inline void increment_scan_on_scavenge_pages() { | 1084 inline void increment_scan_on_scavenge_pages() { |
1075 scan_on_scavenge_pages_++; | 1085 scan_on_scavenge_pages_++; |
1076 if (FLAG_gc_verbose) { | 1086 if (FLAG_gc_verbose) { |
1077 PrintF("Scan-on-scavenge pages: %d\n", scan_on_scavenge_pages_); | 1087 PrintF("Scan-on-scavenge pages: %d\n", scan_on_scavenge_pages_); |
1078 } | 1088 } |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1605 | 1615 |
1606 // For keeping track on when to flush RegExp code. | 1616 // For keeping track on when to flush RegExp code. |
1607 int sweep_generation_; | 1617 int sweep_generation_; |
1608 | 1618 |
1609 int always_allocate_scope_depth_; | 1619 int always_allocate_scope_depth_; |
1610 int linear_allocation_scope_depth_; | 1620 int linear_allocation_scope_depth_; |
1611 | 1621 |
1612 // For keeping track of context disposals. | 1622 // For keeping track of context disposals. |
1613 int contexts_disposed_; | 1623 int contexts_disposed_; |
1614 | 1624 |
| 1625 int global_context_disposed_count_; |
| 1626 |
1615 int scan_on_scavenge_pages_; | 1627 int scan_on_scavenge_pages_; |
1616 | 1628 |
1617 #if defined(V8_TARGET_ARCH_X64) | 1629 #if defined(V8_TARGET_ARCH_X64) |
1618 static const int kMaxObjectSizeInNewSpace = 1024*KB; | 1630 static const int kMaxObjectSizeInNewSpace = 1024*KB; |
1619 #else | 1631 #else |
1620 static const int kMaxObjectSizeInNewSpace = 512*KB; | 1632 static const int kMaxObjectSizeInNewSpace = 512*KB; |
1621 #endif | 1633 #endif |
1622 | 1634 |
1623 NewSpace new_space_; | 1635 NewSpace new_space_; |
1624 OldSpace* old_pointer_space_; | 1636 OldSpace* old_pointer_space_; |
(...skipping 1067 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2692 AssertNoAllocation no_alloc; // i.e. no gc allowed. | 2704 AssertNoAllocation no_alloc; // i.e. no gc allowed. |
2693 | 2705 |
2694 private: | 2706 private: |
2695 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2707 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
2696 }; | 2708 }; |
2697 #endif // DEBUG || LIVE_OBJECT_LIST | 2709 #endif // DEBUG || LIVE_OBJECT_LIST |
2698 | 2710 |
2699 } } // namespace v8::internal | 2711 } } // namespace v8::internal |
2700 | 2712 |
2701 #endif // V8_HEAP_H_ | 2713 #endif // V8_HEAP_H_ |
OLD | NEW |