| 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 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 void GlobalHandles::IterateAllRootsWithClassIds(ObjectVisitor* v) { | 634 void GlobalHandles::IterateAllRootsWithClassIds(ObjectVisitor* v) { |
| 635 for (NodeIterator it(this); !it.done(); it.Advance()) { | 635 for (NodeIterator it(this); !it.done(); it.Advance()) { |
| 636 if (it.node()->has_wrapper_class_id() && it.node()->IsRetainer()) { | 636 if (it.node()->has_wrapper_class_id() && it.node()->IsRetainer()) { |
| 637 v->VisitEmbedderReference(it.node()->location(), | 637 v->VisitEmbedderReference(it.node()->location(), |
| 638 it.node()->wrapper_class_id()); | 638 it.node()->wrapper_class_id()); |
| 639 } | 639 } |
| 640 } | 640 } |
| 641 } | 641 } |
| 642 | 642 |
| 643 | 643 |
| 644 void GlobalHandles::IterateAllRootsInNewSpaceWithClassIds(ObjectVisitor* v) { |
| 645 for (int i = 0; i < new_space_nodes_.length(); ++i) { |
| 646 Node* node = new_space_nodes_[i]; |
| 647 if (node->has_wrapper_class_id() && node->IsRetainer()) { |
| 648 v->VisitEmbedderReference(node->location(), |
| 649 node->wrapper_class_id()); |
| 650 } |
| 651 } |
| 652 } |
| 653 |
| 654 |
| 644 void GlobalHandles::RecordStats(HeapStats* stats) { | 655 void GlobalHandles::RecordStats(HeapStats* stats) { |
| 645 *stats->global_handle_count = 0; | 656 *stats->global_handle_count = 0; |
| 646 *stats->weak_global_handle_count = 0; | 657 *stats->weak_global_handle_count = 0; |
| 647 *stats->pending_global_handle_count = 0; | 658 *stats->pending_global_handle_count = 0; |
| 648 *stats->near_death_global_handle_count = 0; | 659 *stats->near_death_global_handle_count = 0; |
| 649 *stats->free_global_handle_count = 0; | 660 *stats->free_global_handle_count = 0; |
| 650 for (NodeIterator it(this); !it.done(); it.Advance()) { | 661 for (NodeIterator it(this); !it.done(); it.Advance()) { |
| 651 *stats->global_handle_count += 1; | 662 *stats->global_handle_count += 1; |
| 652 if (it.node()->state() == Node::WEAK) { | 663 if (it.node()->state() == Node::WEAK) { |
| 653 *stats->weak_global_handle_count += 1; | 664 *stats->weak_global_handle_count += 1; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 implicit_ref_groups_.Clear(); | 757 implicit_ref_groups_.Clear(); |
| 747 } | 758 } |
| 748 | 759 |
| 749 | 760 |
| 750 void GlobalHandles::TearDown() { | 761 void GlobalHandles::TearDown() { |
| 751 // TODO(1428): invoke weak callbacks. | 762 // TODO(1428): invoke weak callbacks. |
| 752 } | 763 } |
| 753 | 764 |
| 754 | 765 |
| 755 } } // namespace v8::internal | 766 } } // namespace v8::internal |
| OLD | NEW |