OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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/global-handles.h" | 5 #include "src/global-handles.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/v8.h" | 8 #include "src/v8.h" |
9 #include "src/vm-state-inl.h" | 9 #include "src/vm-state-inl.h" |
10 | 10 |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 node->CollectPhantomCallbackData(isolate(), | 680 node->CollectPhantomCallbackData(isolate(), |
681 &pending_phantom_callbacks_); | 681 &pending_phantom_callbacks_); |
682 } else { | 682 } else { |
683 v->VisitPointer(node->location()); | 683 v->VisitPointer(node->location()); |
684 } | 684 } |
685 } | 685 } |
686 } | 686 } |
687 } | 687 } |
688 | 688 |
689 | 689 |
| 690 void GlobalHandles::IdentifyWeakUnmodifiedObjects(WeakSlotCallback f) { |
| 691 for (int i = 0; i < new_space_nodes_.length(); ++i) { |
| 692 Node* node = new_space_nodes_[i]; |
| 693 if (node->IsWeak() && f(node->location())) { |
| 694 node->set_partially_dependent(true); |
| 695 } |
| 696 } |
| 697 } |
| 698 |
| 699 |
690 bool GlobalHandles::IterateObjectGroups(ObjectVisitor* v, | 700 bool GlobalHandles::IterateObjectGroups(ObjectVisitor* v, |
691 WeakSlotCallbackWithHeap can_skip) { | 701 WeakSlotCallbackWithHeap can_skip) { |
692 ComputeObjectGroupsAndImplicitReferences(); | 702 ComputeObjectGroupsAndImplicitReferences(); |
693 int last = 0; | 703 int last = 0; |
694 bool any_group_was_visited = false; | 704 bool any_group_was_visited = false; |
695 for (int i = 0; i < object_groups_.length(); i++) { | 705 for (int i = 0; i < object_groups_.length(); i++) { |
696 ObjectGroup* entry = object_groups_.at(i); | 706 ObjectGroup* entry = object_groups_.at(i); |
697 DCHECK(entry != NULL); | 707 DCHECK(entry != NULL); |
698 | 708 |
699 Object*** objects = entry->objects; | 709 Object*** objects = entry->objects; |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1274 blocks_[block][offset] = object; | 1284 blocks_[block][offset] = object; |
1275 if (isolate->heap()->InNewSpace(object)) { | 1285 if (isolate->heap()->InNewSpace(object)) { |
1276 new_space_indices_.Add(size_); | 1286 new_space_indices_.Add(size_); |
1277 } | 1287 } |
1278 *index = size_++; | 1288 *index = size_++; |
1279 } | 1289 } |
1280 | 1290 |
1281 | 1291 |
1282 } // namespace internal | 1292 } // namespace internal |
1283 } // namespace v8 | 1293 } // namespace v8 |
OLD | NEW |