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

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

Issue 1292063004: Add NoSafepointScope to ObjectPointerVisitor. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Also in Scavenger. Created 5 years, 4 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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/raw_object.h" 5 #include "vm/raw_object.h"
6 6
7 #include "vm/class_table.h" 7 #include "vm/class_table.h"
8 #include "vm/dart.h" 8 #include "vm/dart.h"
9 #include "vm/freelist.h" 9 #include "vm/freelist.h"
10 #include "vm/isolate.h" 10 #include "vm/isolate.h"
(...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 void RawObject::ValidateOverwrittenSmi(RawSmi* raw) { 224 void RawObject::ValidateOverwrittenSmi(RawSmi* raw) {
225 if (FLAG_validate_overwrite && raw->IsHeapObject() && raw != Object::null()) { 225 if (FLAG_validate_overwrite && raw->IsHeapObject() && raw != Object::null()) {
226 FATAL1("Expected smi/null, found: %" Px "\n", reinterpret_cast<uword>(raw)); 226 FATAL1("Expected smi/null, found: %" Px "\n", reinterpret_cast<uword>(raw));
227 } 227 }
228 } 228 }
229 #endif // DEBUG 229 #endif // DEBUG
230 230
231 231
232 intptr_t RawObject::VisitPointers(ObjectPointerVisitor* visitor) { 232 intptr_t RawObject::VisitPointers(ObjectPointerVisitor* visitor) {
233 intptr_t size = 0; 233 intptr_t size = 0;
234 NoHandleScope no_handles(visitor->isolate());
235 234
236 // Only reasonable to be called on heap objects. 235 // Only reasonable to be called on heap objects.
237 ASSERT(IsHeapObject()); 236 ASSERT(IsHeapObject());
238 237
239 // Read the necessary data out of the class before visting the class itself. 238 // Read the necessary data out of the class before visting the class itself.
240 intptr_t class_id = GetClassId(); 239 intptr_t class_id = GetClassId();
241 240
242 if (class_id < kNumPredefinedCids) { 241 if (class_id < kNumPredefinedCids) {
243 switch (class_id) { 242 switch (class_id) {
244 #define RAW_VISITPOINTERS(clazz) \ 243 #define RAW_VISITPOINTERS(clazz) \
(...skipping 688 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 intptr_t RawUserTag::VisitUserTagPointers( 932 intptr_t RawUserTag::VisitUserTagPointers(
934 RawUserTag* raw_obj, ObjectPointerVisitor* visitor) { 933 RawUserTag* raw_obj, ObjectPointerVisitor* visitor) {
935 // Make sure that we got here with the tagged pointer as this. 934 // Make sure that we got here with the tagged pointer as this.
936 ASSERT(raw_obj->IsHeapObject()); 935 ASSERT(raw_obj->IsHeapObject());
937 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); 936 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
938 return UserTag::InstanceSize(); 937 return UserTag::InstanceSize();
939 } 938 }
940 939
941 940
942 } // namespace dart 941 } // namespace dart
OLDNEW
« runtime/vm/allocation.h ('K') | « runtime/vm/pages.cc ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698