OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/api.h" | 8 #include "src/api.h" |
9 #include "src/base/bits.h" | 9 #include "src/base/bits.h" |
10 #include "src/base/once.h" | 10 #include "src/base/once.h" |
(...skipping 1215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1226 | 1226 |
1227 // This should be updated before PostGarbageCollectionProcessing, which can | 1227 // This should be updated before PostGarbageCollectionProcessing, which can |
1228 // cause another GC. | 1228 // cause another GC. |
1229 old_generation_size_at_last_gc_ = PromotedSpaceSizeOfObjects(); | 1229 old_generation_size_at_last_gc_ = PromotedSpaceSizeOfObjects(); |
1230 | 1230 |
1231 UpdateSurvivalStatistics(start_new_space_size); | 1231 UpdateSurvivalStatistics(start_new_space_size); |
1232 ConfigureInitialOldGenerationSize(); | 1232 ConfigureInitialOldGenerationSize(); |
1233 | 1233 |
1234 isolate_->counters()->objs_since_last_young()->Set(0); | 1234 isolate_->counters()->objs_since_last_young()->Set(0); |
1235 | 1235 |
1236 // Callbacks that fire after this point might trigger nested GCs and | 1236 if (collector != SCAVENGER) { |
1237 // restart incremental marking, the assertion can't be moved down. | 1237 // Callbacks that fire after this point might trigger nested GCs and |
1238 DCHECK(collector == SCAVENGER || incremental_marking()->IsStopped()); | 1238 // restart incremental marking, the assertion can't be moved down. |
| 1239 DCHECK(incremental_marking()->IsStopped()); |
| 1240 |
| 1241 // We finished a marking cycle. We can uncommit the marking deque until |
| 1242 // we start marking again. |
| 1243 mark_compact_collector_.marking_deque()->Uninitialize(); |
| 1244 mark_compact_collector_.EnsureMarkingDequeIsCommitted( |
| 1245 MarkCompactCollector::kMinMarkingDequeSize); |
| 1246 } |
1239 | 1247 |
1240 gc_post_processing_depth_++; | 1248 gc_post_processing_depth_++; |
1241 { | 1249 { |
1242 AllowHeapAllocation allow_allocation; | 1250 AllowHeapAllocation allow_allocation; |
1243 GCTracer::Scope scope(tracer(), GCTracer::Scope::EXTERNAL); | 1251 GCTracer::Scope scope(tracer(), GCTracer::Scope::EXTERNAL); |
1244 freed_global_handles = | 1252 freed_global_handles = |
1245 isolate_->global_handles()->PostGarbageCollectionProcessing(collector); | 1253 isolate_->global_handles()->PostGarbageCollectionProcessing(collector); |
1246 } | 1254 } |
1247 gc_post_processing_depth_--; | 1255 gc_post_processing_depth_--; |
1248 | 1256 |
1249 isolate_->eternal_handles()->PostGarbageCollectionProcessing(this); | 1257 isolate_->eternal_handles()->PostGarbageCollectionProcessing(this); |
1250 | 1258 |
1251 // Update relocatables. | 1259 // Update relocatables. |
1252 Relocatable::PostGarbageCollectionProcessing(isolate_); | 1260 Relocatable::PostGarbageCollectionProcessing(isolate_); |
1253 | 1261 |
1254 if (collector == MARK_COMPACTOR) { | 1262 if (collector == MARK_COMPACTOR) { |
1255 // Register the amount of external allocated memory. | 1263 // Register the amount of external allocated memory. |
1256 amount_of_external_allocated_memory_at_last_global_gc_ = | 1264 amount_of_external_allocated_memory_at_last_global_gc_ = |
1257 amount_of_external_allocated_memory_; | 1265 amount_of_external_allocated_memory_; |
1258 SetOldGenerationAllocationLimit( | 1266 SetOldGenerationAllocationLimit( |
1259 PromotedSpaceSizeOfObjects(), | 1267 PromotedSpaceSizeOfObjects(), |
1260 tracer()->CurrentAllocationThroughputInBytesPerMillisecond()); | 1268 tracer()->CurrentAllocationThroughputInBytesPerMillisecond()); |
1261 // We finished a marking cycle. We can uncommit the marking deque until | |
1262 // we start marking again. | |
1263 mark_compact_collector_.UncommitMarkingDeque(); | |
1264 } | 1269 } |
1265 | 1270 |
1266 { | 1271 { |
1267 GCCallbacksScope scope(this); | 1272 GCCallbacksScope scope(this); |
1268 if (scope.CheckReenter()) { | 1273 if (scope.CheckReenter()) { |
1269 AllowHeapAllocation allow_allocation; | 1274 AllowHeapAllocation allow_allocation; |
1270 GCTracer::Scope scope(tracer(), GCTracer::Scope::EXTERNAL); | 1275 GCTracer::Scope scope(tracer(), GCTracer::Scope::EXTERNAL); |
1271 VMState<EXTERNAL> state(isolate_); | 1276 VMState<EXTERNAL> state(isolate_); |
1272 HandleScope handle_scope(isolate_); | 1277 HandleScope handle_scope(isolate_); |
1273 CallGCEpilogueCallbacks(gc_type, gc_callback_flags); | 1278 CallGCEpilogueCallbacks(gc_type, gc_callback_flags); |
(...skipping 5294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6568 *object_type = "CODE_TYPE"; \ | 6573 *object_type = "CODE_TYPE"; \ |
6569 *object_sub_type = "CODE_AGE/" #name; \ | 6574 *object_sub_type = "CODE_AGE/" #name; \ |
6570 return true; | 6575 return true; |
6571 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) | 6576 CODE_AGE_LIST_COMPLETE(COMPARE_AND_RETURN_NAME) |
6572 #undef COMPARE_AND_RETURN_NAME | 6577 #undef COMPARE_AND_RETURN_NAME |
6573 } | 6578 } |
6574 return false; | 6579 return false; |
6575 } | 6580 } |
6576 } // namespace internal | 6581 } // namespace internal |
6577 } // namespace v8 | 6582 } // namespace v8 |
OLD | NEW |