OLD | NEW |
1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 return Node::FromLocation(location)->wrapper_class_id(); | 516 return Node::FromLocation(location)->wrapper_class_id(); |
517 } | 517 } |
518 | 518 |
519 void GlobalHandles::IterateWeakRoots(ObjectVisitor* v) { | 519 void GlobalHandles::IterateWeakRoots(ObjectVisitor* v) { |
520 for (NodeIterator it(this); !it.done(); it.Advance()) { | 520 for (NodeIterator it(this); !it.done(); it.Advance()) { |
521 if (it.node()->IsWeakRetainer()) v->VisitPointer(it.node()->location()); | 521 if (it.node()->IsWeakRetainer()) v->VisitPointer(it.node()->location()); |
522 } | 522 } |
523 } | 523 } |
524 | 524 |
525 | 525 |
526 void GlobalHandles::IterateWeakRoots(WeakReferenceGuest f, | |
527 WeakReferenceCallback callback) { | |
528 for (NodeIterator it(this); !it.done(); it.Advance()) { | |
529 if (it.node()->IsWeak() && it.node()->callback() == callback) { | |
530 f(it.node()->object(), it.node()->parameter()); | |
531 } | |
532 } | |
533 } | |
534 | |
535 | |
536 void GlobalHandles::IdentifyWeakHandles(WeakSlotCallback f) { | 526 void GlobalHandles::IdentifyWeakHandles(WeakSlotCallback f) { |
537 for (NodeIterator it(this); !it.done(); it.Advance()) { | 527 for (NodeIterator it(this); !it.done(); it.Advance()) { |
538 if (it.node()->IsWeak() && f(it.node()->location())) { | 528 if (it.node()->IsWeak() && f(it.node()->location())) { |
539 it.node()->MarkPending(); | 529 it.node()->MarkPending(); |
540 } | 530 } |
541 } | 531 } |
542 } | 532 } |
543 | 533 |
544 | 534 |
545 void GlobalHandles::IterateNewSpaceStrongAndDependentRoots(ObjectVisitor* v) { | 535 void GlobalHandles::IterateNewSpaceStrongAndDependentRoots(ObjectVisitor* v) { |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 implicit_ref_groups_.Clear(); | 816 implicit_ref_groups_.Clear(); |
827 } | 817 } |
828 | 818 |
829 | 819 |
830 void GlobalHandles::TearDown() { | 820 void GlobalHandles::TearDown() { |
831 // TODO(1428): invoke weak callbacks. | 821 // TODO(1428): invoke weak callbacks. |
832 } | 822 } |
833 | 823 |
834 | 824 |
835 } } // namespace v8::internal | 825 } } // namespace v8::internal |
OLD | NEW |