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

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

Issue 390823003: v8: make GCTracer persistent. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « src/global-handles.h ('k') | src/heap.h » ('j') | src/heap.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/global-handles.h" 8 #include "src/global-handles.h"
9 9
10 #include "src/vm-state-inl.h" 10 #include "src/vm-state-inl.h"
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 // group to NULL so it won't be processed again. 605 // group to NULL so it won't be processed again.
606 delete entry; 606 delete entry;
607 object_groups_.at(i) = NULL; 607 object_groups_.at(i) = NULL;
608 } 608 }
609 object_groups_.Rewind(last); 609 object_groups_.Rewind(last);
610 return any_group_was_visited; 610 return any_group_was_visited;
611 } 611 }
612 612
613 613
614 int GlobalHandles::PostGarbageCollectionProcessing( 614 int GlobalHandles::PostGarbageCollectionProcessing(
615 GarbageCollector collector, GCTracer* tracer) { 615 GarbageCollector collector) {
616 // Process weak global handle callbacks. This must be done after the 616 // Process weak global handle callbacks. This must be done after the
617 // GC is completely done, because the callbacks may invoke arbitrary 617 // GC is completely done, because the callbacks may invoke arbitrary
618 // API functions. 618 // API functions.
619 ASSERT(isolate_->heap()->gc_state() == Heap::NOT_IN_GC); 619 ASSERT(isolate_->heap()->gc_state() == Heap::NOT_IN_GC);
620 const int initial_post_gc_processing_count = ++post_gc_processing_count_; 620 const int initial_post_gc_processing_count = ++post_gc_processing_count_;
621 int freed_nodes = 0; 621 int freed_nodes = 0;
622 if (collector == SCAVENGER) { 622 if (collector == SCAVENGER) {
623 for (int i = 0; i < new_space_nodes_.length(); ++i) { 623 for (int i = 0; i < new_space_nodes_.length(); ++i) {
624 Node* node = new_space_nodes_[i]; 624 Node* node = new_space_nodes_[i];
625 ASSERT(node->is_in_new_space_list()); 625 ASSERT(node->is_in_new_space_list());
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
668 } 668 }
669 } 669 }
670 // Update the list of new space nodes. 670 // Update the list of new space nodes.
671 int last = 0; 671 int last = 0;
672 for (int i = 0; i < new_space_nodes_.length(); ++i) { 672 for (int i = 0; i < new_space_nodes_.length(); ++i) {
673 Node* node = new_space_nodes_[i]; 673 Node* node = new_space_nodes_[i];
674 ASSERT(node->is_in_new_space_list()); 674 ASSERT(node->is_in_new_space_list());
675 if (node->IsRetainer()) { 675 if (node->IsRetainer()) {
676 if (isolate_->heap()->InNewSpace(node->object())) { 676 if (isolate_->heap()->InNewSpace(node->object())) {
677 new_space_nodes_[last++] = node; 677 new_space_nodes_[last++] = node;
678 tracer->increment_nodes_copied_in_new_space(); 678 isolate_->heap()->tracer()->increment_nodes_copied_in_new_space();
679 } else { 679 } else {
680 node->set_in_new_space_list(false); 680 node->set_in_new_space_list(false);
681 tracer->increment_nodes_promoted(); 681 isolate_->heap()->tracer()->increment_nodes_promoted();
682 } 682 }
683 } else { 683 } else {
684 node->set_in_new_space_list(false); 684 node->set_in_new_space_list(false);
685 tracer->increment_nodes_died_in_new_space(); 685 isolate_->heap()->tracer()->increment_nodes_died_in_new_space();
686 } 686 }
687 } 687 }
688 new_space_nodes_.Rewind(last); 688 new_space_nodes_.Rewind(last);
689 return freed_nodes; 689 return freed_nodes;
690 } 690 }
691 691
692 692
693 void GlobalHandles::IterateStrongRoots(ObjectVisitor* v) { 693 void GlobalHandles::IterateStrongRoots(ObjectVisitor* v) {
694 for (NodeIterator it(this); !it.done(); it.Advance()) { 694 for (NodeIterator it(this); !it.done(); it.Advance()) {
695 if (it.node()->IsStrongRetainer()) { 695 if (it.node()->IsStrongRetainer()) {
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
1064 ASSERT_EQ(isolate->heap()->the_hole_value(), blocks_[block][offset]); 1064 ASSERT_EQ(isolate->heap()->the_hole_value(), blocks_[block][offset]);
1065 blocks_[block][offset] = object; 1065 blocks_[block][offset] = object;
1066 if (isolate->heap()->InNewSpace(object)) { 1066 if (isolate->heap()->InNewSpace(object)) {
1067 new_space_indices_.Add(size_); 1067 new_space_indices_.Add(size_);
1068 } 1068 }
1069 *index = size_++; 1069 *index = size_++;
1070 } 1070 }
1071 1071
1072 1072
1073 } } // namespace v8::internal 1073 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/global-handles.h ('k') | src/heap.h » ('j') | src/heap.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698