OLD | NEW |
1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 1101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1112 static inline void MoveBlock(Address dst, Address src, int byte_size); | 1112 static inline void MoveBlock(Address dst, Address src, int byte_size); |
1113 | 1113 |
1114 // Check new space expansion criteria and expand semispaces if it was hit. | 1114 // Check new space expansion criteria and expand semispaces if it was hit. |
1115 static void CheckNewSpaceExpansionCriteria(); | 1115 static void CheckNewSpaceExpansionCriteria(); |
1116 | 1116 |
1117 static inline void IncrementYoungSurvivorsCounter(int survived) { | 1117 static inline void IncrementYoungSurvivorsCounter(int survived) { |
1118 young_survivors_after_last_gc_ = survived; | 1118 young_survivors_after_last_gc_ = survived; |
1119 survived_since_last_expansion_ += survived; | 1119 survived_since_last_expansion_ += survived; |
1120 } | 1120 } |
1121 | 1121 |
| 1122 static inline bool NextGCIsLikelyToBeFull() { |
| 1123 intptr_t total_promoted = |
| 1124 PromotedSpaceSize() + PromotedExternalMemorySize(); |
| 1125 |
| 1126 intptr_t adjusted_promotion_limit = |
| 1127 old_gen_promotion_limit_ - new_space_.Capacity(); |
| 1128 |
| 1129 if (total_promoted >= adjusted_promotion_limit) return true; |
| 1130 |
| 1131 intptr_t adjusted_allocation_limit = |
| 1132 old_gen_allocation_limit_ - new_space_.Capacity() / 5; |
| 1133 |
| 1134 if (PromotedSpaceSize() >= adjusted_allocation_limit) return true; |
| 1135 |
| 1136 return false; |
| 1137 } |
| 1138 |
| 1139 |
1122 static void UpdateNewSpaceReferencesInExternalStringTable( | 1140 static void UpdateNewSpaceReferencesInExternalStringTable( |
1123 ExternalStringTableUpdaterCallback updater_func); | 1141 ExternalStringTableUpdaterCallback updater_func); |
1124 | 1142 |
1125 static void ProcessWeakReferences(WeakObjectRetainer* retainer); | 1143 static void ProcessWeakReferences(WeakObjectRetainer* retainer); |
1126 | 1144 |
1127 // Helper function that governs the promotion policy from new space to | 1145 // Helper function that governs the promotion policy from new space to |
1128 // old. If the object's old address lies below the new space's age | 1146 // old. If the object's old address lies below the new space's age |
1129 // mark or if we've already filled the bottom 1/16th of the to space, | 1147 // mark or if we've already filled the bottom 1/16th of the to space, |
1130 // we try to promote this object. | 1148 // we try to promote this object. |
1131 static inline bool ShouldBePromoted(Address old_address, int object_size); | 1149 static inline bool ShouldBePromoted(Address old_address, int object_size); |
(...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2155 | 2173 |
2156 private: | 2174 private: |
2157 static const uintptr_t kNotMarkedBit = 0x1; | 2175 static const uintptr_t kNotMarkedBit = 0x1; |
2158 STATIC_ASSERT((kHeapObjectTag & kNotMarkedBit) != 0); | 2176 STATIC_ASSERT((kHeapObjectTag & kNotMarkedBit) != 0); |
2159 }; | 2177 }; |
2160 | 2178 |
2161 | 2179 |
2162 } } // namespace v8::internal | 2180 } } // namespace v8::internal |
2163 | 2181 |
2164 #endif // V8_HEAP_H_ | 2182 #endif // V8_HEAP_H_ |
OLD | NEW |