Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(263)

Side by Side Diff: src/heap.h

Issue 7737024: Speed up incremental marking if the heap size doubled (Closed) Base URL: http://v8.googlecode.com/svn/branches/experimental/gc/
Patch Set: Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | src/incremental-marking.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after
1202 1202
1203 // Adjusts the amount of registered external memory. 1203 // Adjusts the amount of registered external memory.
1204 // Returns the adjusted value. 1204 // Returns the adjusted value.
1205 inline int AdjustAmountOfExternalAllocatedMemory(int change_in_bytes); 1205 inline int AdjustAmountOfExternalAllocatedMemory(int change_in_bytes);
1206 1206
1207 // Allocate uninitialized fixed array. 1207 // Allocate uninitialized fixed array.
1208 MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(int length); 1208 MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(int length);
1209 MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(int length, 1209 MUST_USE_RESULT MaybeObject* AllocateRawFixedArray(int length,
1210 PretenureFlag pretenure); 1210 PretenureFlag pretenure);
1211 1211
1212 inline intptr_t PromotedTotalSize() {
1213 return PromotedSpaceSize() + PromotedExternalMemorySize();
1214 }
1215
1212 // True if we have reached the allocation limit in the old generation that 1216 // True if we have reached the allocation limit in the old generation that
1213 // should force the next GC (caused normally) to be a full one. 1217 // should force the next GC (caused normally) to be a full one.
1214 inline bool OldGenerationPromotionLimitReached() { 1218 inline bool OldGenerationPromotionLimitReached() {
1215 return (PromotedSpaceSize() + PromotedExternalMemorySize()) 1219 return PromotedTotalSize() > old_gen_promotion_limit_;
1216 > old_gen_promotion_limit_;
1217 } 1220 }
1218 1221
1219 inline intptr_t OldGenerationSpaceAvailable() { 1222 inline intptr_t OldGenerationSpaceAvailable() {
1220 return old_gen_allocation_limit_ - 1223 return old_gen_allocation_limit_ - PromotedTotalSize();
1221 (PromotedSpaceSize() + PromotedExternalMemorySize());
1222 } 1224 }
1223 1225
1224 static const intptr_t kMinimumPromotionLimit = 5 * Page::kPageSize; 1226 static const intptr_t kMinimumPromotionLimit = 5 * Page::kPageSize;
1225 static const intptr_t kMinimumAllocationLimit = 1227 static const intptr_t kMinimumAllocationLimit =
1226 8 * (Page::kPageSize > MB ? Page::kPageSize : MB); 1228 8 * (Page::kPageSize > MB ? Page::kPageSize : MB);
1227 1229
1228 // When we sweep lazily we initially guess that there is no garbage on the 1230 // When we sweep lazily we initially guess that there is no garbage on the
1229 // heap and set the limits for the next GC accordingly. As we sweep we find 1231 // heap and set the limits for the next GC accordingly. As we sweep we find
1230 // out that some of the pages contained garbage and we have to adjust 1232 // out that some of the pages contained garbage and we have to adjust
1231 // downwards the size of the heap. This means the limits that control the 1233 // downwards the size of the heap. This means the limits that control the
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
1298 void CheckNewSpaceExpansionCriteria(); 1300 void CheckNewSpaceExpansionCriteria();
1299 1301
1300 inline void IncrementYoungSurvivorsCounter(int survived) { 1302 inline void IncrementYoungSurvivorsCounter(int survived) {
1301 young_survivors_after_last_gc_ = survived; 1303 young_survivors_after_last_gc_ = survived;
1302 survived_since_last_expansion_ += survived; 1304 survived_since_last_expansion_ += survived;
1303 } 1305 }
1304 1306
1305 inline bool NextGCIsLikelyToBeFull() { 1307 inline bool NextGCIsLikelyToBeFull() {
1306 if (FLAG_gc_global) return true; 1308 if (FLAG_gc_global) return true;
1307 1309
1308 intptr_t total_promoted = 1310 intptr_t total_promoted = PromotedTotalSize();
1309 PromotedSpaceSize() + PromotedExternalMemorySize();
1310 1311
1311 intptr_t adjusted_promotion_limit = 1312 intptr_t adjusted_promotion_limit =
1312 old_gen_promotion_limit_ - new_space_.Capacity(); 1313 old_gen_promotion_limit_ - new_space_.Capacity();
1313 1314
1314 if (total_promoted >= adjusted_promotion_limit) return true; 1315 if (total_promoted >= adjusted_promotion_limit) return true;
1315 1316
1316 intptr_t adjusted_allocation_limit = 1317 intptr_t adjusted_allocation_limit =
1317 old_gen_allocation_limit_ - new_space_.Capacity() / 5; 1318 old_gen_allocation_limit_ - new_space_.Capacity() / 5;
1318 1319
1319 if (PromotedSpaceSize() >= adjusted_allocation_limit) return true; 1320 if (PromotedSpaceSize() >= adjusted_allocation_limit) return true;
(...skipping 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after
2445 2446
2446 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer); 2447 DISALLOW_IMPLICIT_CONSTRUCTORS(PathTracer);
2447 }; 2448 };
2448 #endif // DEBUG || LIVE_OBJECT_LIST 2449 #endif // DEBUG || LIVE_OBJECT_LIST
2449 2450
2450 } } // namespace v8::internal 2451 } } // namespace v8::internal
2451 2452
2452 #undef HEAP 2453 #undef HEAP
2453 2454
2454 #endif // V8_HEAP_H_ 2455 #endif // V8_HEAP_H_
OLDNEW
« no previous file with comments | « no previous file | src/incremental-marking.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698