| 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 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 // Code that should be executed after the garbage collection proper. | 599 // Code that should be executed after the garbage collection proper. |
| 600 static void PostGarbageCollectionProcessing(); | 600 static void PostGarbageCollectionProcessing(); |
| 601 | 601 |
| 602 // Performs garbage collection operation. | 602 // Performs garbage collection operation. |
| 603 // Returns whether required_space bytes are available after the collection. | 603 // Returns whether required_space bytes are available after the collection. |
| 604 static bool CollectGarbage(int required_space, AllocationSpace space); | 604 static bool CollectGarbage(int required_space, AllocationSpace space); |
| 605 | 605 |
| 606 // Performs a full garbage collection. | 606 // Performs a full garbage collection. |
| 607 static void CollectAllGarbage(); | 607 static void CollectAllGarbage(); |
| 608 | 608 |
| 609 // Clears all inline caches by forcing a global garbage collection. | |
| 610 static void ClearStoreICs(); | |
| 611 | |
| 612 // Performs a full garbage collection if a context has been disposed | 609 // Performs a full garbage collection if a context has been disposed |
| 613 // since the last time the check was performed. | 610 // since the last time the check was performed. |
| 614 static void CollectAllGarbageIfContextDisposed(); | 611 static void CollectAllGarbageIfContextDisposed(); |
| 615 | 612 |
| 616 // Notify the heap that a context has been disposed. | 613 // Notify the heap that a context has been disposed. |
| 617 static void NotifyContextDisposed(); | 614 static void NotifyContextDisposed(); |
| 618 | 615 |
| 619 // Utility to invoke the scavenger. This is needed in test code to | 616 // Utility to invoke the scavenger. This is needed in test code to |
| 620 // ensure correct callback for weak global handles. | 617 // ensure correct callback for weak global handles. |
| 621 static void PerformScavenge(); | 618 static void PerformScavenge(); |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 804 > old_gen_promotion_limit_; | 801 > old_gen_promotion_limit_; |
| 805 } | 802 } |
| 806 | 803 |
| 807 // True if we have reached the allocation limit in the old generation that | 804 // True if we have reached the allocation limit in the old generation that |
| 808 // should artificially cause a GC right now. | 805 // should artificially cause a GC right now. |
| 809 static bool OldGenerationAllocationLimitReached() { | 806 static bool OldGenerationAllocationLimitReached() { |
| 810 return (PromotedSpaceSize() + PromotedExternalMemorySize()) | 807 return (PromotedSpaceSize() + PromotedExternalMemorySize()) |
| 811 > old_gen_allocation_limit_; | 808 > old_gen_allocation_limit_; |
| 812 } | 809 } |
| 813 | 810 |
| 814 static bool has_store_ics() { | |
| 815 return has_store_ics_; | |
| 816 } | |
| 817 | |
| 818 static void store_ic_created() { | |
| 819 has_store_ics_ = true; | |
| 820 } | |
| 821 | |
| 822 private: | 811 private: |
| 823 static int semispace_size_; | 812 static int semispace_size_; |
| 824 static int initial_semispace_size_; | 813 static int initial_semispace_size_; |
| 825 static int young_generation_size_; | 814 static int young_generation_size_; |
| 826 static int old_generation_size_; | 815 static int old_generation_size_; |
| 827 | 816 |
| 828 static int new_space_growth_limit_; | 817 static int new_space_growth_limit_; |
| 829 static int scavenge_count_; | 818 static int scavenge_count_; |
| 830 | 819 |
| 831 static int always_allocate_scope_depth_; | 820 static int always_allocate_scope_depth_; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 877 // by global handles | 866 // by global handles |
| 878 static int amount_of_external_allocated_memory_; | 867 static int amount_of_external_allocated_memory_; |
| 879 | 868 |
| 880 // Caches the amount of external memory registered at the last global gc. | 869 // Caches the amount of external memory registered at the last global gc. |
| 881 static int amount_of_external_allocated_memory_at_last_global_gc_; | 870 static int amount_of_external_allocated_memory_at_last_global_gc_; |
| 882 | 871 |
| 883 // Indicates that an allocation has failed in the old generation since the | 872 // Indicates that an allocation has failed in the old generation since the |
| 884 // last GC. | 873 // last GC. |
| 885 static int old_gen_exhausted_; | 874 static int old_gen_exhausted_; |
| 886 | 875 |
| 887 static bool has_store_ics_; | |
| 888 | |
| 889 // Declare all the roots | 876 // Declare all the roots |
| 890 #define ROOT_DECLARATION(type, name) static type* name##_; | 877 #define ROOT_DECLARATION(type, name) static type* name##_; |
| 891 ROOT_LIST(ROOT_DECLARATION) | 878 ROOT_LIST(ROOT_DECLARATION) |
| 892 #undef ROOT_DECLARATION | 879 #undef ROOT_DECLARATION |
| 893 | 880 |
| 894 // Utility type maps | 881 // Utility type maps |
| 895 #define DECLARE_STRUCT_MAP(NAME, Name, name) static Map* name##_map_; | 882 #define DECLARE_STRUCT_MAP(NAME, Name, name) static Map* name##_map_; |
| 896 STRUCT_LIST(DECLARE_STRUCT_MAP) | 883 STRUCT_LIST(DECLARE_STRUCT_MAP) |
| 897 #undef DECLARE_STRUCT_MAP | 884 #undef DECLARE_STRUCT_MAP |
| 898 | 885 |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1304 int marked_count_; | 1291 int marked_count_; |
| 1305 | 1292 |
| 1306 // The count from the end of the previous full GC. Will be zero if there | 1293 // The count from the end of the previous full GC. Will be zero if there |
| 1307 // was no previous full GC. | 1294 // was no previous full GC. |
| 1308 int previous_marked_count_; | 1295 int previous_marked_count_; |
| 1309 }; | 1296 }; |
| 1310 | 1297 |
| 1311 } } // namespace v8::internal | 1298 } } // namespace v8::internal |
| 1312 | 1299 |
| 1313 #endif // V8_HEAP_H_ | 1300 #endif // V8_HEAP_H_ |
| OLD | NEW |