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 726 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
737 amount_of_external_allocated_memory_ = amount; | 737 amount_of_external_allocated_memory_ = amount; |
738 } | 738 } |
739 } | 739 } |
740 ASSERT(amount_of_external_allocated_memory_ >= 0); | 740 ASSERT(amount_of_external_allocated_memory_ >= 0); |
741 return amount_of_external_allocated_memory_; | 741 return amount_of_external_allocated_memory_; |
742 } | 742 } |
743 | 743 |
744 // Allocate unitialized fixed array (pretenure == NON_TENURE). | 744 // Allocate unitialized fixed array (pretenure == NON_TENURE). |
745 static Object* AllocateRawFixedArray(int length); | 745 static Object* AllocateRawFixedArray(int length); |
746 | 746 |
| 747 // True if we have reached the allocation limit in the old generation that |
| 748 // should force the next GC (caused normally) to be a full one. |
| 749 static bool OldGenerationPromotionLimitReached() { |
| 750 return (PromotedSpaceSize() + PromotedExternalMemorySize()) |
| 751 > old_gen_promotion_limit_; |
| 752 } |
| 753 |
| 754 // True if we have reached the allocation limit in the old generation that |
| 755 // should artificially cause a GC right now. |
| 756 static bool OldGenerationAllocationLimitReached() { |
| 757 return (PromotedSpaceSize() + PromotedExternalMemorySize()) |
| 758 > old_gen_allocation_limit_; |
| 759 } |
| 760 |
747 private: | 761 private: |
748 static int semispace_size_; | 762 static int semispace_size_; |
749 static int initial_semispace_size_; | 763 static int initial_semispace_size_; |
750 static int young_generation_size_; | 764 static int young_generation_size_; |
751 static int old_generation_size_; | 765 static int old_generation_size_; |
752 | 766 |
753 static int new_space_growth_limit_; | 767 static int new_space_growth_limit_; |
754 static int scavenge_count_; | 768 static int scavenge_count_; |
755 | 769 |
756 static const int kMaxMapSpaceSize = 8*MB; | 770 static const int kMaxMapSpaceSize = 8*MB; |
(...skipping 21 matching lines...) Expand all Loading... |
778 // If the --gc-interval flag is set to a positive value, this | 792 // If the --gc-interval flag is set to a positive value, this |
779 // variable holds the value indicating the number of allocations | 793 // variable holds the value indicating the number of allocations |
780 // remain until the next failure and garbage collection. | 794 // remain until the next failure and garbage collection. |
781 static int allocation_timeout_; | 795 static int allocation_timeout_; |
782 | 796 |
783 // Do we expect to be able to handle allocation failure at this | 797 // Do we expect to be able to handle allocation failure at this |
784 // time? | 798 // time? |
785 static bool disallow_allocation_failure_; | 799 static bool disallow_allocation_failure_; |
786 #endif // DEBUG | 800 #endif // DEBUG |
787 | 801 |
788 // Promotion limit that trigger a global GC | 802 // Limit that triggers a global GC on the next (normally caused) GC. This |
789 static int promoted_space_limit_; | 803 // is checked when we have already decided to do a GC to help determine |
| 804 // which collector to invoke. |
| 805 static int old_gen_promotion_limit_; |
| 806 |
| 807 // Limit that triggers a global GC as soon as is reasonable. This is |
| 808 // checked before expanding a paged space in the old generation and on |
| 809 // every allocation in large object space. |
| 810 static int old_gen_allocation_limit_; |
790 | 811 |
791 // The amount of external memory registered through the API kept alive | 812 // The amount of external memory registered through the API kept alive |
792 // by global handles | 813 // by global handles |
793 static int amount_of_external_allocated_memory_; | 814 static int amount_of_external_allocated_memory_; |
794 | 815 |
795 // Caches the amount of external memory registered at the last global gc. | 816 // Caches the amount of external memory registered at the last global gc. |
796 static int amount_of_external_allocated_memory_at_last_global_gc_; | 817 static int amount_of_external_allocated_memory_at_last_global_gc_; |
797 | 818 |
798 // Indicates that an allocation has failed in the old generation since the | 819 // Indicates that an allocation has failed in the old generation since the |
799 // last GC. | 820 // last GC. |
(...skipping 398 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1198 int marked_count_; | 1219 int marked_count_; |
1199 | 1220 |
1200 // The count from the end of the previous full GC. Will be zero if there | 1221 // The count from the end of the previous full GC. Will be zero if there |
1201 // was no previous full GC. | 1222 // was no previous full GC. |
1202 int previous_marked_count_; | 1223 int previous_marked_count_; |
1203 }; | 1224 }; |
1204 | 1225 |
1205 } } // namespace v8::internal | 1226 } } // namespace v8::internal |
1206 | 1227 |
1207 #endif // V8_HEAP_H_ | 1228 #endif // V8_HEAP_H_ |
OLD | NEW |