| 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 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1237 | 1237 |
| 1238 // Once the entire group has been colored gray, set the object group | 1238 // Once the entire group has been colored gray, set the object group |
| 1239 // to NULL so it won't be processed again. | 1239 // to NULL so it won't be processed again. |
| 1240 delete entry; | 1240 delete entry; |
| 1241 object_groups->at(i) = NULL; | 1241 object_groups->at(i) = NULL; |
| 1242 } | 1242 } |
| 1243 } | 1243 } |
| 1244 | 1244 |
| 1245 | 1245 |
| 1246 void MarkCompactCollector::MarkImplicitRefGroups() { | 1246 void MarkCompactCollector::MarkImplicitRefGroups() { |
| 1247 List<ImplicitRefGroup*>* ref_groups = GlobalHandles::ImplicitRefGroups(); | 1247 List<ImplicitRefGroup*>* ref_groups = |
| 1248 heap_->isolate()->global_handles()->implicit_ref_groups(); |
| 1248 | 1249 |
| 1249 for (int i = 0; i < ref_groups->length(); i++) { | 1250 for (int i = 0; i < ref_groups->length(); i++) { |
| 1250 ImplicitRefGroup* entry = ref_groups->at(i); | 1251 ImplicitRefGroup* entry = ref_groups->at(i); |
| 1251 if (entry == NULL) continue; | 1252 if (entry == NULL) continue; |
| 1252 | 1253 |
| 1253 if (!entry->parent_->IsMarked()) continue; | 1254 if (!entry->parent_->IsMarked()) continue; |
| 1254 | 1255 |
| 1255 List<Object**>& children = entry->children_; | 1256 List<Object**>& children = entry->children_; |
| 1256 // A parent object is marked, so mark as gray all child white heap | 1257 // A parent object is marked, so mark as gray all child white heap |
| 1257 // objects. | 1258 // objects. |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1415 symbol_table->ElementsRemoved(v.PointersRemoved()); | 1416 symbol_table->ElementsRemoved(v.PointersRemoved()); |
| 1416 heap_->external_string_table_.Iterate(&v); | 1417 heap_->external_string_table_.Iterate(&v); |
| 1417 heap_->external_string_table_.CleanUp(); | 1418 heap_->external_string_table_.CleanUp(); |
| 1418 | 1419 |
| 1419 // Process the weak references. | 1420 // Process the weak references. |
| 1420 MarkCompactWeakObjectRetainer mark_compact_object_retainer; | 1421 MarkCompactWeakObjectRetainer mark_compact_object_retainer; |
| 1421 heap_->ProcessWeakReferences(&mark_compact_object_retainer); | 1422 heap_->ProcessWeakReferences(&mark_compact_object_retainer); |
| 1422 | 1423 |
| 1423 // Remove object groups after marking phase. | 1424 // Remove object groups after marking phase. |
| 1424 heap_->isolate()->global_handles()->RemoveObjectGroups(); | 1425 heap_->isolate()->global_handles()->RemoveObjectGroups(); |
| 1425 GlobalHandles::RemoveImplicitRefGroups(); | 1426 heap_->isolate()->global_handles()->RemoveImplicitRefGroups(); |
| 1426 | 1427 |
| 1427 // Flush code from collected candidates. | 1428 // Flush code from collected candidates. |
| 1428 if (is_code_flushing_enabled()) { | 1429 if (is_code_flushing_enabled()) { |
| 1429 code_flusher_->ProcessCandidates(); | 1430 code_flusher_->ProcessCandidates(); |
| 1430 } | 1431 } |
| 1431 | 1432 |
| 1432 // Clean up dead objects from the runtime profiler. | 1433 // Clean up dead objects from the runtime profiler. |
| 1433 heap_->isolate()->runtime_profiler()->RemoveDeadSamples(); | 1434 heap_->isolate()->runtime_profiler()->RemoveDeadSamples(); |
| 1434 } | 1435 } |
| 1435 | 1436 |
| (...skipping 1629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3065 } | 3066 } |
| 3066 | 3067 |
| 3067 | 3068 |
| 3068 void MarkCompactCollector::Initialize() { | 3069 void MarkCompactCollector::Initialize() { |
| 3069 StaticPointersToNewGenUpdatingVisitor::Initialize(); | 3070 StaticPointersToNewGenUpdatingVisitor::Initialize(); |
| 3070 StaticMarkingVisitor::Initialize(); | 3071 StaticMarkingVisitor::Initialize(); |
| 3071 } | 3072 } |
| 3072 | 3073 |
| 3073 | 3074 |
| 3074 } } // namespace v8::internal | 3075 } } // namespace v8::internal |
| OLD | NEW |