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