Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(422)

Side by Side Diff: src/global-handles.cc

Issue 11365131: Implement VisitHandlesInNewSpaceWithClassIds() (Closed) Base URL: git://github.com/v8/v8.git@master
Patch Set: Fixed format Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« src/api.cc ('K') | « src/global-handles.h ('k') | test/cctest/test-api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698