OLD | NEW |
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 static void GarbageCollectionEpilogue(); | 625 static void GarbageCollectionEpilogue(); |
626 | 626 |
627 // Performs garbage collection operation. | 627 // Performs garbage collection operation. |
628 // Returns whether required_space bytes are available after the collection. | 628 // Returns whether required_space bytes are available after the collection. |
629 static bool CollectGarbage(int required_space, AllocationSpace space); | 629 static bool CollectGarbage(int required_space, AllocationSpace space); |
630 | 630 |
631 // Performs a full garbage collection. Force compaction if the | 631 // Performs a full garbage collection. Force compaction if the |
632 // parameter is true. | 632 // parameter is true. |
633 static void CollectAllGarbage(bool force_compaction); | 633 static void CollectAllGarbage(bool force_compaction); |
634 | 634 |
| 635 // Performs a full garbage collection if a context has been disposed |
| 636 // since the last time the check was performed. |
| 637 static void CollectAllGarbageIfContextDisposedDeprecated(); |
| 638 |
635 // Notify the heap that a context has been disposed. | 639 // Notify the heap that a context has been disposed. |
636 static void NotifyContextDisposed(); | 640 static void NotifyContextDisposed(); |
| 641 static void NotifyContextDisposedDeprecated(); |
637 | 642 |
638 // Utility to invoke the scavenger. This is needed in test code to | 643 // Utility to invoke the scavenger. This is needed in test code to |
639 // ensure correct callback for weak global handles. | 644 // ensure correct callback for weak global handles. |
640 static void PerformScavenge(); | 645 static void PerformScavenge(); |
641 | 646 |
642 #ifdef DEBUG | 647 #ifdef DEBUG |
643 // Utility used with flag gc-greedy. | 648 // Utility used with flag gc-greedy. |
644 static bool GarbageCollectionGreedyCheck(); | 649 static bool GarbageCollectionGreedyCheck(); |
645 #endif | 650 #endif |
646 | 651 |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
900 | 905 |
901 // For keeping track of how much data has survived | 906 // For keeping track of how much data has survived |
902 // scavenge since last new space expansion. | 907 // scavenge since last new space expansion. |
903 static int survived_since_last_expansion_; | 908 static int survived_since_last_expansion_; |
904 | 909 |
905 static int always_allocate_scope_depth_; | 910 static int always_allocate_scope_depth_; |
906 static int linear_allocation_scope_depth_; | 911 static int linear_allocation_scope_depth_; |
907 | 912 |
908 // For keeping track of context disposals. | 913 // For keeping track of context disposals. |
909 static int contexts_disposed_; | 914 static int contexts_disposed_; |
| 915 static bool context_disposed_use_deprecated_heuristic_; |
| 916 static bool context_disposed_deprecated_pending_; |
910 | 917 |
911 #if defined(V8_TARGET_ARCH_X64) | 918 #if defined(V8_TARGET_ARCH_X64) |
912 static const int kMaxObjectSizeInNewSpace = 512*KB; | 919 static const int kMaxObjectSizeInNewSpace = 512*KB; |
913 #else | 920 #else |
914 static const int kMaxObjectSizeInNewSpace = 256*KB; | 921 static const int kMaxObjectSizeInNewSpace = 256*KB; |
915 #endif | 922 #endif |
916 | 923 |
917 static NewSpace new_space_; | 924 static NewSpace new_space_; |
918 static OldSpace* old_pointer_space_; | 925 static OldSpace* old_pointer_space_; |
919 static OldSpace* old_data_space_; | 926 static OldSpace* old_data_space_; |
(...skipping 772 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1692 | 1699 |
1693 // To speed up scavenge collections new space string are kept | 1700 // To speed up scavenge collections new space string are kept |
1694 // separate from old space strings. | 1701 // separate from old space strings. |
1695 static List<Object*> new_space_strings_; | 1702 static List<Object*> new_space_strings_; |
1696 static List<Object*> old_space_strings_; | 1703 static List<Object*> old_space_strings_; |
1697 }; | 1704 }; |
1698 | 1705 |
1699 } } // namespace v8::internal | 1706 } } // namespace v8::internal |
1700 | 1707 |
1701 #endif // V8_HEAP_H_ | 1708 #endif // V8_HEAP_H_ |
OLD | NEW |