Chromium Code Reviews| 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 703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 714 void GlobalHandles::IterateAllRootsWithClassIds(ObjectVisitor* v) { | 714 void GlobalHandles::IterateAllRootsWithClassIds(ObjectVisitor* v) { |
| 715 for (NodeIterator it(this); !it.done(); it.Advance()) { | 715 for (NodeIterator it(this); !it.done(); it.Advance()) { |
| 716 if (it.node()->IsRetainer() && it.node()->has_wrapper_class_id()) { | 716 if (it.node()->IsRetainer() && it.node()->has_wrapper_class_id()) { |
| 717 v->VisitEmbedderReference(it.node()->location(), | 717 v->VisitEmbedderReference(it.node()->location(), |
| 718 it.node()->wrapper_class_id()); | 718 it.node()->wrapper_class_id()); |
| 719 } | 719 } |
| 720 } | 720 } |
| 721 } | 721 } |
| 722 | 722 |
| 723 | 723 |
| 724 void GlobalHandles::IterateAllRootsInNewSpaceWithClassIds(ObjectVisitor* v) { | |
| 725 for (int i = 0; i < new_space_nodes_.length(); ++i) { | |
| 726 Node* node = new_space_nodes_[i]; | |
| 727 if (node->has_wrapper_class_id() && node->IsRetainer()) { | |
|
Michael Starzinger
2013/01/24 15:06:56
Flip the two operands of the conjunction, otherwis
| |
| 728 v->VisitEmbedderReference(node->location(), | |
| 729 node->wrapper_class_id()); | |
| 730 } | |
| 731 } | |
| 732 } | |
| 733 | |
| 734 | |
| 724 void GlobalHandles::RecordStats(HeapStats* stats) { | 735 void GlobalHandles::RecordStats(HeapStats* stats) { |
| 725 *stats->global_handle_count = 0; | 736 *stats->global_handle_count = 0; |
| 726 *stats->weak_global_handle_count = 0; | 737 *stats->weak_global_handle_count = 0; |
| 727 *stats->pending_global_handle_count = 0; | 738 *stats->pending_global_handle_count = 0; |
| 728 *stats->near_death_global_handle_count = 0; | 739 *stats->near_death_global_handle_count = 0; |
| 729 *stats->free_global_handle_count = 0; | 740 *stats->free_global_handle_count = 0; |
| 730 for (NodeIterator it(this); !it.done(); it.Advance()) { | 741 for (NodeIterator it(this); !it.done(); it.Advance()) { |
| 731 *stats->global_handle_count += 1; | 742 *stats->global_handle_count += 1; |
| 732 if (it.node()->state() == Node::WEAK) { | 743 if (it.node()->state() == Node::WEAK) { |
| 733 *stats->weak_global_handle_count += 1; | 744 *stats->weak_global_handle_count += 1; |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 826 implicit_ref_groups_.Clear(); | 837 implicit_ref_groups_.Clear(); |
| 827 } | 838 } |
| 828 | 839 |
| 829 | 840 |
| 830 void GlobalHandles::TearDown() { | 841 void GlobalHandles::TearDown() { |
| 831 // TODO(1428): invoke weak callbacks. | 842 // TODO(1428): invoke weak callbacks. |
| 832 } | 843 } |
| 833 | 844 |
| 834 | 845 |
| 835 } } // namespace v8::internal | 846 } } // namespace v8::internal |
| OLD | NEW |