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

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

Issue 14307013: - Remember the fact that an object has been added to the (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | Annotate | Revision Log
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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 break; 173 break;
174 } 174 }
175 case kJSRegExpCid: { 175 case kJSRegExpCid: {
176 const RawJSRegExp* raw_jsregexp = 176 const RawJSRegExp* raw_jsregexp =
177 reinterpret_cast<const RawJSRegExp*>(this); 177 reinterpret_cast<const RawJSRegExp*>(this);
178 intptr_t data_length = Smi::Value(raw_jsregexp->ptr()->data_length_); 178 intptr_t data_length = Smi::Value(raw_jsregexp->ptr()->data_length_);
179 instance_size = JSRegExp::InstanceSize(data_length); 179 instance_size = JSRegExp::InstanceSize(data_length);
180 break; 180 break;
181 } 181 }
182 case kFreeListElement: { 182 case kFreeListElement: {
183 ASSERT(FreeBit::decode(ptr()->tags_)); 183 // ASSERT(FreeBit::decode(ptr()->tags_));
184 uword addr = RawObject::ToAddr(const_cast<RawObject*>(this)); 184 uword addr = RawObject::ToAddr(const_cast<RawObject*>(this));
185 FreeListElement* element = reinterpret_cast<FreeListElement*>(addr); 185 FreeListElement* element = reinterpret_cast<FreeListElement*>(addr);
186 instance_size = element->Size(); 186 instance_size = element->Size();
187 break; 187 break;
188 } 188 }
189 default: 189 default:
190 UNREACHABLE(); 190 UNREACHABLE();
191 break; 191 break;
192 } 192 }
193 } 193 }
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 #define RAW_VISITPOINTERS(clazz) \ 240 #define RAW_VISITPOINTERS(clazz) \
241 case kTypedData##clazz##ViewCid: 241 case kTypedData##clazz##ViewCid:
242 CLASS_LIST_TYPED_DATA(RAW_VISITPOINTERS) 242 CLASS_LIST_TYPED_DATA(RAW_VISITPOINTERS)
243 case kByteDataViewCid: { 243 case kByteDataViewCid: {
244 RawInstance* raw_obj = reinterpret_cast<RawInstance*>(this); 244 RawInstance* raw_obj = reinterpret_cast<RawInstance*>(this);
245 size = RawInstance::VisitInstancePointers(raw_obj, visitor); 245 size = RawInstance::VisitInstancePointers(raw_obj, visitor);
246 break; 246 break;
247 } 247 }
248 #undef RAW_VISITPOINTERS 248 #undef RAW_VISITPOINTERS
249 case kFreeListElement: { 249 case kFreeListElement: {
250 ASSERT(FreeBit::decode(ptr()->tags_)); 250 // ASSERT(FreeBit::decode(ptr()->tags_));
251 uword addr = RawObject::ToAddr(const_cast<RawObject*>(this)); 251 uword addr = RawObject::ToAddr(const_cast<RawObject*>(this));
252 FreeListElement* element = reinterpret_cast<FreeListElement*>(addr); 252 FreeListElement* element = reinterpret_cast<FreeListElement*>(addr);
253 size = element->Size(); 253 size = element->Size();
254 break; 254 break;
255 } 255 }
256 default: 256 default:
257 OS::Print("Class Id: %"Pd"\n", class_id); 257 OS::Print("Class Id: %"Pd"\n", class_id);
258 UNREACHABLE(); 258 UNREACHABLE();
259 break; 259 break;
260 } 260 }
(...skipping 542 matching lines...) Expand 10 before | Expand all | Expand 10 after
803 803
804 intptr_t RawWeakProperty::VisitWeakPropertyPointers( 804 intptr_t RawWeakProperty::VisitWeakPropertyPointers(
805 RawWeakProperty* raw_obj, ObjectPointerVisitor* visitor) { 805 RawWeakProperty* raw_obj, ObjectPointerVisitor* visitor) {
806 // Make sure that we got here with the tagged pointer as this. 806 // Make sure that we got here with the tagged pointer as this.
807 ASSERT(raw_obj->IsHeapObject()); 807 ASSERT(raw_obj->IsHeapObject());
808 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); 808 visitor->VisitPointers(raw_obj->from(), raw_obj->to());
809 return WeakProperty::InstanceSize(); 809 return WeakProperty::InstanceSize();
810 } 810 }
811 811
812 } // namespace dart 812 } // namespace dart
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698