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 // Performs a full garbage collection if a context has been disposed |
| 610 // since the last time the check was performed. |
| 611 static void CollectAllGarbageIfContextDisposed(); |
| 612 |
| 613 // Notify the heap that a context has been disposed. |
| 614 static void NotifyContextDisposed(); |
| 615 |
609 // 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 |
610 // ensure correct callback for weak global handles. | 617 // ensure correct callback for weak global handles. |
611 static void PerformScavenge(); | 618 static void PerformScavenge(); |
612 | 619 |
613 #ifdef DEBUG | 620 #ifdef DEBUG |
614 // Utility used with flag gc-greedy. | 621 // Utility used with flag gc-greedy. |
615 static bool GarbageCollectionGreedyCheck(); | 622 static bool GarbageCollectionGreedyCheck(); |
616 #endif | 623 #endif |
617 | 624 |
618 static void SetGlobalGCPrologueCallback(GCCallback callback) { | 625 static void SetGlobalGCPrologueCallback(GCCallback callback) { |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
801 private: | 808 private: |
802 static int semispace_size_; | 809 static int semispace_size_; |
803 static int initial_semispace_size_; | 810 static int initial_semispace_size_; |
804 static int young_generation_size_; | 811 static int young_generation_size_; |
805 static int old_generation_size_; | 812 static int old_generation_size_; |
806 | 813 |
807 static int new_space_growth_limit_; | 814 static int new_space_growth_limit_; |
808 static int scavenge_count_; | 815 static int scavenge_count_; |
809 | 816 |
810 static int always_allocate_scope_depth_; | 817 static int always_allocate_scope_depth_; |
| 818 static bool context_disposed_pending_; |
811 | 819 |
812 static const int kMaxMapSpaceSize = 8*MB; | 820 static const int kMaxMapSpaceSize = 8*MB; |
813 | 821 |
814 static NewSpace new_space_; | 822 static NewSpace new_space_; |
815 static OldSpace* old_pointer_space_; | 823 static OldSpace* old_pointer_space_; |
816 static OldSpace* old_data_space_; | 824 static OldSpace* old_data_space_; |
817 static OldSpace* code_space_; | 825 static OldSpace* code_space_; |
818 static MapSpace* map_space_; | 826 static MapSpace* map_space_; |
819 static LargeObjectSpace* lo_space_; | 827 static LargeObjectSpace* lo_space_; |
820 static HeapState gc_state_; | 828 static HeapState gc_state_; |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1280 int marked_count_; | 1288 int marked_count_; |
1281 | 1289 |
1282 // The count from the end of the previous full GC. Will be zero if there | 1290 // The count from the end of the previous full GC. Will be zero if there |
1283 // was no previous full GC. | 1291 // was no previous full GC. |
1284 int previous_marked_count_; | 1292 int previous_marked_count_; |
1285 }; | 1293 }; |
1286 | 1294 |
1287 } } // namespace v8::internal | 1295 } } // namespace v8::internal |
1288 | 1296 |
1289 #endif // V8_HEAP_H_ | 1297 #endif // V8_HEAP_H_ |
OLD | NEW |