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::IterateNewSpaceWeakRoots(ObjectVisitor* v, | |
691 WeakSlotCallback can_skip) { | |
692 for (int i = 0; i < new_space_nodes_.length(); ++i) { | |
693 Node* node = new_space_nodes_[i]; | |
694 Object* object = node->object(); | |
695 // If node->location is used instead of &object, import-expando-gc.html | |
696 // fails | |
697 if (node->IsWeak() && !can_skip(node->location())) | |
698 v->VisitPointer(&object); // node->location()); | |
699 } | |
700 } | |
701 | |
702 | |
mythria
2015/09/21 09:54:23
Here, I think node->location() is correct. One of
jochen (gone - plz use gerrit)
2015/09/21 11:33:25
that's odd - object and *node->location() should b
rmcilroy
2015/09/21 11:44:15
One difference I can possibly think of is that Vis
jochen (gone - plz use gerrit)
2015/09/21 11:54:19
right, the visitor indeed updates the passed in lo
| |
690 bool GlobalHandles::IterateObjectGroups(ObjectVisitor* v, | 703 bool GlobalHandles::IterateObjectGroups(ObjectVisitor* v, |
691 WeakSlotCallbackWithHeap can_skip) { | 704 WeakSlotCallbackWithHeap can_skip) { |
692 ComputeObjectGroupsAndImplicitReferences(); | 705 ComputeObjectGroupsAndImplicitReferences(); |
693 int last = 0; | 706 int last = 0; |
694 bool any_group_was_visited = false; | 707 bool any_group_was_visited = false; |
695 for (int i = 0; i < object_groups_.length(); i++) { | 708 for (int i = 0; i < object_groups_.length(); i++) { |
696 ObjectGroup* entry = object_groups_.at(i); | 709 ObjectGroup* entry = object_groups_.at(i); |
697 DCHECK(entry != NULL); | 710 DCHECK(entry != NULL); |
698 | 711 |
699 Object*** objects = entry->objects; | 712 Object*** objects = entry->objects; |
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1274 blocks_[block][offset] = object; | 1287 blocks_[block][offset] = object; |
1275 if (isolate->heap()->InNewSpace(object)) { | 1288 if (isolate->heap()->InNewSpace(object)) { |
1276 new_space_indices_.Add(size_); | 1289 new_space_indices_.Add(size_); |
1277 } | 1290 } |
1278 *index = size_++; | 1291 *index = size_++; |
1279 } | 1292 } |
1280 | 1293 |
1281 | 1294 |
1282 } // namespace internal | 1295 } // namespace internal |
1283 } // namespace v8 | 1296 } // namespace v8 |
OLD | NEW |