| 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 616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 627 static void GarbageCollectionEpilogue(); | 627 static void GarbageCollectionEpilogue(); |
| 628 | 628 |
| 629 // Performs garbage collection operation. | 629 // Performs garbage collection operation. |
| 630 // Returns whether required_space bytes are available after the collection. | 630 // Returns whether required_space bytes are available after the collection. |
| 631 static bool CollectGarbage(int required_space, AllocationSpace space); | 631 static bool CollectGarbage(int required_space, AllocationSpace space); |
| 632 | 632 |
| 633 // Performs a full garbage collection. Force compaction if the | 633 // Performs a full garbage collection. Force compaction if the |
| 634 // parameter is true. | 634 // parameter is true. |
| 635 static void CollectAllGarbage(bool force_compaction); | 635 static void CollectAllGarbage(bool force_compaction); |
| 636 | 636 |
| 637 // Performs a full garbage collection if a context has been disposed | |
| 638 // since the last time the check was performed. | |
| 639 static void CollectAllGarbageIfContextDisposedDeprecated(); | |
| 640 | |
| 641 // Notify the heap that a context has been disposed. | 637 // Notify the heap that a context has been disposed. |
| 642 static void NotifyContextDisposed(); | 638 static void NotifyContextDisposed(); |
| 643 static void NotifyContextDisposedDeprecated(); | |
| 644 | 639 |
| 645 // Utility to invoke the scavenger. This is needed in test code to | 640 // Utility to invoke the scavenger. This is needed in test code to |
| 646 // ensure correct callback for weak global handles. | 641 // ensure correct callback for weak global handles. |
| 647 static void PerformScavenge(); | 642 static void PerformScavenge(); |
| 648 | 643 |
| 649 #ifdef DEBUG | 644 #ifdef DEBUG |
| 650 // Utility used with flag gc-greedy. | 645 // Utility used with flag gc-greedy. |
| 651 static bool GarbageCollectionGreedyCheck(); | 646 static bool GarbageCollectionGreedyCheck(); |
| 652 #endif | 647 #endif |
| 653 | 648 |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 910 | 905 |
| 911 // For keeping track of how much data has survived | 906 // For keeping track of how much data has survived |
| 912 // scavenge since last new space expansion. | 907 // scavenge since last new space expansion. |
| 913 static int survived_since_last_expansion_; | 908 static int survived_since_last_expansion_; |
| 914 | 909 |
| 915 static int always_allocate_scope_depth_; | 910 static int always_allocate_scope_depth_; |
| 916 static int linear_allocation_scope_depth_; | 911 static int linear_allocation_scope_depth_; |
| 917 | 912 |
| 918 // For keeping track of context disposals. | 913 // For keeping track of context disposals. |
| 919 static int contexts_disposed_; | 914 static int contexts_disposed_; |
| 920 static bool context_disposed_use_deprecated_heuristic_; | |
| 921 static bool context_disposed_deprecated_pending_; | |
| 922 | 915 |
| 923 #if defined(V8_TARGET_ARCH_X64) | 916 #if defined(V8_TARGET_ARCH_X64) |
| 924 static const int kMaxObjectSizeInNewSpace = 512*KB; | 917 static const int kMaxObjectSizeInNewSpace = 512*KB; |
| 925 #else | 918 #else |
| 926 static const int kMaxObjectSizeInNewSpace = 256*KB; | 919 static const int kMaxObjectSizeInNewSpace = 256*KB; |
| 927 #endif | 920 #endif |
| 928 | 921 |
| 929 static NewSpace new_space_; | 922 static NewSpace new_space_; |
| 930 static OldSpace* old_pointer_space_; | 923 static OldSpace* old_pointer_space_; |
| 931 static OldSpace* old_data_space_; | 924 static OldSpace* old_data_space_; |
| (...skipping 803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1735 | 1728 |
| 1736 // To speed up scavenge collections new space string are kept | 1729 // To speed up scavenge collections new space string are kept |
| 1737 // separate from old space strings. | 1730 // separate from old space strings. |
| 1738 static List<Object*> new_space_strings_; | 1731 static List<Object*> new_space_strings_; |
| 1739 static List<Object*> old_space_strings_; | 1732 static List<Object*> old_space_strings_; |
| 1740 }; | 1733 }; |
| 1741 | 1734 |
| 1742 } } // namespace v8::internal | 1735 } } // namespace v8::internal |
| 1743 | 1736 |
| 1744 #endif // V8_HEAP_H_ | 1737 #endif // V8_HEAP_H_ |
| OLD | NEW |