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

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

Issue 7044007: Assert that independent handles do not participate in grouping. (Closed)
Patch Set: Created 9 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
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 // 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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 } 612 }
613 } 613 }
614 614
615 #endif 615 #endif
616 616
617 617
618 618
619 void GlobalHandles::AddObjectGroup(Object*** handles, 619 void GlobalHandles::AddObjectGroup(Object*** handles,
620 size_t length, 620 size_t length,
621 v8::RetainedObjectInfo* info) { 621 v8::RetainedObjectInfo* info) {
622 #ifdef DEBUG
623 for (size_t i = 0; i < length; ++i) {
624 ASSERT(!Node::FromLocation(handles[i])->independent_);
625 }
626 #endif
622 if (length == 0) { 627 if (length == 0) {
623 if (info != NULL) info->Dispose(); 628 if (info != NULL) info->Dispose();
624 return; 629 return;
625 } 630 }
626 object_groups_.Add(ObjectGroup::New(handles, length, info)); 631 object_groups_.Add(ObjectGroup::New(handles, length, info));
627 } 632 }
628 633
629 634
630 void GlobalHandles::AddImplicitReferences(HeapObject** parent, 635 void GlobalHandles::AddImplicitReferences(HeapObject** parent,
631 Object*** children, 636 Object*** children,
632 size_t length) { 637 size_t length) {
638 #ifdef DEBUG
639 ASSERT(!Node::FromLocation(BitCast<Object**>(parent))->independent_);
640 for (size_t i = 0; i < length; ++i) {
641 ASSERT(!Node::FromLocation(children[i])->independent_);
642 }
643 #endif
633 if (length == 0) return; 644 if (length == 0) return;
634 implicit_ref_groups_.Add(ImplicitRefGroup::New(parent, children, length)); 645 implicit_ref_groups_.Add(ImplicitRefGroup::New(parent, children, length));
635 } 646 }
636 647
637 648
638 void GlobalHandles::RemoveObjectGroups() { 649 void GlobalHandles::RemoveObjectGroups() {
639 for (int i = 0; i < object_groups_.length(); i++) { 650 for (int i = 0; i < object_groups_.length(); i++) {
640 object_groups_.at(i)->Dispose(); 651 object_groups_.at(i)->Dispose();
641 } 652 }
642 object_groups_.Clear(); 653 object_groups_.Clear();
643 } 654 }
644 655
645 656
646 void GlobalHandles::RemoveImplicitRefGroups() { 657 void GlobalHandles::RemoveImplicitRefGroups() {
647 for (int i = 0; i < implicit_ref_groups_.length(); i++) { 658 for (int i = 0; i < implicit_ref_groups_.length(); i++) {
648 implicit_ref_groups_.at(i)->Dispose(); 659 implicit_ref_groups_.at(i)->Dispose();
649 } 660 }
650 implicit_ref_groups_.Clear(); 661 implicit_ref_groups_.Clear();
651 } 662 }
652 663
653 664
654 } } // namespace v8::internal 665 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698