| OLD | NEW |
| 1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1247 old_gen_allocation_limit_ = | 1247 old_gen_allocation_limit_ = |
| 1248 OldGenAllocationLimit(size_of_old_gen_at_last_old_space_gc_); | 1248 OldGenAllocationLimit(size_of_old_gen_at_last_old_space_gc_); |
| 1249 } | 1249 } |
| 1250 | 1250 |
| 1251 intptr_t OldGenPromotionLimit(intptr_t old_gen_size) { | 1251 intptr_t OldGenPromotionLimit(intptr_t old_gen_size) { |
| 1252 const int divisor = FLAG_stress_compaction ? 10 : 3; | 1252 const int divisor = FLAG_stress_compaction ? 10 : 3; |
| 1253 intptr_t limit = | 1253 intptr_t limit = |
| 1254 Max(old_gen_size + old_gen_size / divisor, kMinimumPromotionLimit); | 1254 Max(old_gen_size + old_gen_size / divisor, kMinimumPromotionLimit); |
| 1255 limit += new_space_.Capacity(); | 1255 limit += new_space_.Capacity(); |
| 1256 limit *= old_gen_limit_factor_; | 1256 limit *= old_gen_limit_factor_; |
| 1257 return limit; | 1257 intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2; |
| 1258 return Min(limit, halfway_to_the_max); |
| 1258 } | 1259 } |
| 1259 | 1260 |
| 1260 intptr_t OldGenAllocationLimit(intptr_t old_gen_size) { | 1261 intptr_t OldGenAllocationLimit(intptr_t old_gen_size) { |
| 1261 const int divisor = FLAG_stress_compaction ? 8 : 2; | 1262 const int divisor = FLAG_stress_compaction ? 8 : 2; |
| 1262 intptr_t limit = | 1263 intptr_t limit = |
| 1263 Max(old_gen_size + old_gen_size / divisor, kMinimumAllocationLimit); | 1264 Max(old_gen_size + old_gen_size / divisor, kMinimumAllocationLimit); |
| 1264 limit += new_space_.Capacity(); | 1265 limit += new_space_.Capacity(); |
| 1265 limit *= old_gen_limit_factor_; | 1266 limit *= old_gen_limit_factor_; |
| 1266 return limit; | 1267 intptr_t halfway_to_the_max = (old_gen_size + max_old_generation_size_) / 2; |
| 1268 return Min(limit, halfway_to_the_max); |
| 1267 } | 1269 } |
| 1268 | 1270 |
| 1269 // Can be called when the embedding application is idle. | 1271 // Can be called when the embedding application is idle. |
| 1270 bool IdleNotification(); | 1272 bool IdleNotification(); |
| 1271 | 1273 |
| 1272 // Declare all the root indices. | 1274 // Declare all the root indices. |
| 1273 enum RootListIndex { | 1275 enum RootListIndex { |
| 1274 #define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex, | 1276 #define ROOT_INDEX_DECLARATION(type, name, camel_name) k##camel_name##RootIndex, |
| 1275 STRONG_ROOT_LIST(ROOT_INDEX_DECLARATION) | 1277 STRONG_ROOT_LIST(ROOT_INDEX_DECLARATION) |
| 1276 #undef ROOT_INDEX_DECLARATION | 1278 #undef ROOT_INDEX_DECLARATION |
| (...skipping 1199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2476 | 2478 |
| 2477 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); | 2479 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); |
| 2478 }; | 2480 }; |
| 2479 #endif // DEBUG || LIVE_OBJECT_LIST | 2481 #endif // DEBUG || LIVE_OBJECT_LIST |
| 2480 | 2482 |
| 2481 } } // namespace v8::internal | 2483 } } // namespace v8::internal |
| 2482 | 2484 |
| 2483 #undef HEAP | 2485 #undef HEAP |
| 2484 | 2486 |
| 2485 #endif // V8_HEAP_H_ | 2487 #endif // V8_HEAP_H_ |
| OLD | NEW |