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

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

Issue 10502004: - Add an isolate field to visitors. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 | « runtime/vm/object.h ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/freelist.h" 8 #include "vm/freelist.h"
9 #include "vm/isolate.h" 9 #include "vm/isolate.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after
250 uword tags = ptr()->tags_; 250 uword tags = ptr()->tags_;
251 ASSERT((instance_size == SizeTag::decode(tags)) || 251 ASSERT((instance_size == SizeTag::decode(tags)) ||
252 (SizeTag::decode(tags) == 0) || 252 (SizeTag::decode(tags) == 0) ||
253 FreeBit::decode(tags)); 253 FreeBit::decode(tags));
254 return instance_size; 254 return instance_size;
255 } 255 }
256 256
257 257
258 intptr_t RawObject::VisitPointers(ObjectPointerVisitor* visitor) { 258 intptr_t RawObject::VisitPointers(ObjectPointerVisitor* visitor) {
259 intptr_t size = 0; 259 intptr_t size = 0;
260 NoHandleScope no_handles(Isolate::Current()); 260 NoHandleScope no_handles(visitor->isolate());
261 261
262 // Only reasonable to be called on heap objects. 262 // Only reasonable to be called on heap objects.
263 ASSERT(IsHeapObject()); 263 ASSERT(IsHeapObject());
264 264
265 // Read the necessary data out of the class before visting the class itself. 265 // Read the necessary data out of the class before visting the class itself.
266 RawClass* raw_class = ptr()->class_; 266 RawClass* raw_class = ptr()->class_;
267 ObjectKind kind = raw_class->ptr()->instance_kind_; 267 ObjectKind kind = raw_class->ptr()->instance_kind_;
268 268
269 // Visit the class before visting the fields. 269 // Visit the class before visting the fields.
270 visitor->VisitPointer(reinterpret_cast<RawObject**>(&ptr()->class_)); 270 visitor->VisitPointer(reinterpret_cast<RawObject**>(&ptr()->class_));
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after
935 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj, 935 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj,
936 ObjectPointerVisitor* visitor) { 936 ObjectPointerVisitor* visitor) {
937 // Make sure that we got here with the tagged pointer as this. 937 // Make sure that we got here with the tagged pointer as this.
938 ASSERT(raw_obj->IsHeapObject()); 938 ASSERT(raw_obj->IsHeapObject());
939 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_); 939 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_);
940 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); 940 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
941 return JSRegExp::InstanceSize(length); 941 return JSRegExp::InstanceSize(length);
942 } 942 }
943 943
944 } // namespace dart 944 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.h ('k') | runtime/vm/scavenger.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698