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

Side by Side Diff: runtime/vm/scavenger.cc

Issue 2349023002: Remove assumption from the heap verifier that objects occupy a narrow range of the address space. (Closed)
Patch Set: . Created 4 years, 3 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 (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "vm/scavenger.h" 5 #include "vm/scavenger.h"
6 6
7 #include "vm/dart.h" 7 #include "vm/dart.h"
8 #include "vm/dart_api_state.h" 8 #include "vm/dart_api_state.h"
9 #include "vm/isolate.h" 9 #include "vm/isolate.h"
10 #include "vm/lockers.h" 10 #include "vm/lockers.h"
11 #include "vm/object.h" 11 #include "vm/object.h"
12 #include "vm/object_set.h"
12 #include "vm/object_id_ring.h" 13 #include "vm/object_id_ring.h"
13 #include "vm/safepoint.h" 14 #include "vm/safepoint.h"
14 #include "vm/stack_frame.h" 15 #include "vm/stack_frame.h"
15 #include "vm/store_buffer.h" 16 #include "vm/store_buffer.h"
16 #include "vm/thread_registry.h" 17 #include "vm/thread_registry.h"
17 #include "vm/timeline.h" 18 #include "vm/timeline.h"
18 #include "vm/verifier.h" 19 #include "vm/verifier.h"
19 #include "vm/visitor.h" 20 #include "vm/visitor.h"
20 #include "vm/weak_table.h" 21 #include "vm/weak_table.h"
21 22
(...skipping 716 matching lines...) Expand 10 before | Expand all | Expand 10 after
738 void Scavenger::VisitObjects(ObjectVisitor* visitor) const { 739 void Scavenger::VisitObjects(ObjectVisitor* visitor) const {
739 uword cur = FirstObjectStart(); 740 uword cur = FirstObjectStart();
740 while (cur < top_) { 741 while (cur < top_) {
741 RawObject* raw_obj = RawObject::FromAddr(cur); 742 RawObject* raw_obj = RawObject::FromAddr(cur);
742 visitor->VisitObject(raw_obj); 743 visitor->VisitObject(raw_obj);
743 cur += raw_obj->Size(); 744 cur += raw_obj->Size();
744 } 745 }
745 } 746 }
746 747
747 748
749 void Scavenger::AddRegionsToObjectSet(ObjectSet* set) const {
750 set->AddRegion(to_->start(), to_->end());
751 }
752
753
748 RawObject* Scavenger::FindObject(FindObjectVisitor* visitor) const { 754 RawObject* Scavenger::FindObject(FindObjectVisitor* visitor) const {
749 ASSERT(!scavenging_); 755 ASSERT(!scavenging_);
750 uword cur = FirstObjectStart(); 756 uword cur = FirstObjectStart();
751 if (visitor->VisitRange(cur, top_)) { 757 if (visitor->VisitRange(cur, top_)) {
752 while (cur < top_) { 758 while (cur < top_) {
753 RawObject* raw_obj = RawObject::FromAddr(cur); 759 RawObject* raw_obj = RawObject::FromAddr(cur);
754 uword next = cur + raw_obj->Size(); 760 uword next = cur + raw_obj->Size();
755 if (visitor->VisitRange(cur, next) && raw_obj->FindObject(visitor)) { 761 if (visitor->VisitRange(cur, next) && raw_obj->FindObject(visitor)) {
756 return raw_obj; // Found object, return it. 762 return raw_obj; // Found object, return it.
757 } 763 }
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
897 } 903 }
898 904
899 905
900 void Scavenger::FreeExternal(intptr_t size) { 906 void Scavenger::FreeExternal(intptr_t size) {
901 ASSERT(size >= 0); 907 ASSERT(size >= 0);
902 external_size_ -= size; 908 external_size_ -= size;
903 ASSERT(external_size_ >= 0); 909 ASSERT(external_size_ >= 0);
904 } 910 }
905 911
906 } // namespace dart 912 } // namespace dart
OLDNEW
« runtime/vm/object_set.h ('K') | « runtime/vm/scavenger.h ('k') | runtime/vm/verifier.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698