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

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

Issue 6800003: Make object groups and implicit references a bit more lightweight. (Closed)
Patch Set: Created 9 years, 8 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 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
551 } 551 }
552 } 552 }
553 553
554 #endif 554 #endif
555 555
556 556
557 557
558 void GlobalHandles::AddObjectGroup(Object*** handles, 558 void GlobalHandles::AddObjectGroup(Object*** handles,
559 size_t length, 559 size_t length,
560 v8::RetainedObjectInfo* info) { 560 v8::RetainedObjectInfo* info) {
561 ObjectGroup* new_entry = new ObjectGroup(length, info); 561 object_groups_.Add(ObjectGroup::New(handles, length, info));
562 for (size_t i = 0; i < length; ++i) {
563 new_entry->objects_.Add(handles[i]);
564 }
565 object_groups_.Add(new_entry);
566 } 562 }
567 563
568 564
569 void GlobalHandles::AddImplicitReferences(HeapObject* parent, 565 void GlobalHandles::AddImplicitReferences(HeapObject** parent,
570 Object*** children, 566 Object*** children,
571 size_t length) { 567 size_t length) {
572 ImplicitRefGroup* new_entry = new ImplicitRefGroup(parent, length); 568 implicit_ref_groups_.Add(ImplicitRefGroup::New(parent, children, length));
573 for (size_t i = 0; i < length; ++i) {
574 new_entry->children_.Add(children[i]);
575 }
576 implicit_ref_groups_.Add(new_entry);
577 } 569 }
578 570
579 571
580 void GlobalHandles::RemoveObjectGroups() { 572 void GlobalHandles::RemoveObjectGroups() {
581 for (int i = 0; i < object_groups_.length(); i++) { 573 for (int i = 0; i < object_groups_.length(); i++) {
582 delete object_groups_.at(i); 574 object_groups_.at(i)->Dispose();
583 } 575 }
584 object_groups_.Clear(); 576 object_groups_.Clear();
585 } 577 }
586 578
587 579
588 void GlobalHandles::RemoveImplicitRefGroups() { 580 void GlobalHandles::RemoveImplicitRefGroups() {
589 for (int i = 0; i < implicit_ref_groups_.length(); i++) { 581 for (int i = 0; i < implicit_ref_groups_.length(); i++) {
590 delete implicit_ref_groups_.at(i); 582 implicit_ref_groups_.at(i)->Dispose();
591 } 583 }
592 implicit_ref_groups_.Clear(); 584 implicit_ref_groups_.Clear();
593 } 585 }
594 586
595 587
596 } } // namespace v8::internal 588 } } // namespace v8::internal
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698