| OLD | NEW |
| 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/raw_object.h" | 5 #include "vm/raw_object.h" |
| 6 | 6 |
| 7 #include "vm/freelist.h" | 7 #include "vm/freelist.h" |
| 8 #include "vm/isolate.h" | 8 #include "vm/isolate.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 #include "vm/visitor.h" | 10 #include "vm/visitor.h" |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 121 instance_size = TypeArguments::InstanceSize(array_length); | 121 instance_size = TypeArguments::InstanceSize(array_length); |
| 122 break; | 122 break; |
| 123 } | 123 } |
| 124 case kPcDescriptors: { | 124 case kPcDescriptors: { |
| 125 const RawPcDescriptors* raw_descriptors = | 125 const RawPcDescriptors* raw_descriptors = |
| 126 reinterpret_cast<const RawPcDescriptors*>(this); | 126 reinterpret_cast<const RawPcDescriptors*>(this); |
| 127 intptr_t num_descriptors = Smi::Value(raw_descriptors->ptr()->length_); | 127 intptr_t num_descriptors = Smi::Value(raw_descriptors->ptr()->length_); |
| 128 instance_size = PcDescriptors::InstanceSize(num_descriptors); | 128 instance_size = PcDescriptors::InstanceSize(num_descriptors); |
| 129 break; | 129 break; |
| 130 } | 130 } |
| 131 case kLocalVarDescriptors: { |
| 132 const RawLocalVarDescriptors* raw_descriptors = |
| 133 reinterpret_cast<const RawLocalVarDescriptors*>(this); |
| 134 intptr_t num_descriptors = raw_descriptors->ptr()->length_; |
| 135 instance_size = LocalVarDescriptors::InstanceSize(num_descriptors); |
| 136 break; |
| 137 } |
| 131 case kExceptionHandlers: { | 138 case kExceptionHandlers: { |
| 132 const RawExceptionHandlers* raw_handlers = | 139 const RawExceptionHandlers* raw_handlers = |
| 133 reinterpret_cast<const RawExceptionHandlers*>(this); | 140 reinterpret_cast<const RawExceptionHandlers*>(this); |
| 134 intptr_t num_handlers = Smi::Value(raw_handlers->ptr()->length_); | 141 intptr_t num_handlers = Smi::Value(raw_handlers->ptr()->length_); |
| 135 instance_size = ExceptionHandlers::InstanceSize(num_handlers); | 142 instance_size = ExceptionHandlers::InstanceSize(num_handlers); |
| 136 break; | 143 break; |
| 137 } | 144 } |
| 138 case kJSRegExp: { | 145 case kJSRegExp: { |
| 139 const RawJSRegExp* raw_jsregexp = | 146 const RawJSRegExp* raw_jsregexp = |
| 140 reinterpret_cast<const RawJSRegExp*>(this); | 147 reinterpret_cast<const RawJSRegExp*>(this); |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 338 | 345 |
| 339 intptr_t RawPcDescriptors::VisitPcDescriptorsPointers( | 346 intptr_t RawPcDescriptors::VisitPcDescriptorsPointers( |
| 340 RawPcDescriptors* raw_obj, ObjectPointerVisitor* visitor) { | 347 RawPcDescriptors* raw_obj, ObjectPointerVisitor* visitor) { |
| 341 RawPcDescriptors* obj = raw_obj->ptr(); | 348 RawPcDescriptors* obj = raw_obj->ptr(); |
| 342 intptr_t length = Smi::Value(obj->length_); | 349 intptr_t length = Smi::Value(obj->length_); |
| 343 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->length_)); | 350 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->length_)); |
| 344 return PcDescriptors::InstanceSize(length); | 351 return PcDescriptors::InstanceSize(length); |
| 345 } | 352 } |
| 346 | 353 |
| 347 | 354 |
| 355 intptr_t RawLocalVarDescriptors::VisitLocalVarDescriptorsPointers( |
| 356 RawLocalVarDescriptors* raw_obj, ObjectPointerVisitor* visitor) { |
| 357 RawLocalVarDescriptors* obj = raw_obj->ptr(); |
| 358 intptr_t len = obj->length_; |
| 359 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->names_)); |
| 360 return LocalVarDescriptors::InstanceSize(len); |
| 361 } |
| 362 |
| 363 |
| 348 intptr_t RawExceptionHandlers::VisitExceptionHandlersPointers( | 364 intptr_t RawExceptionHandlers::VisitExceptionHandlersPointers( |
| 349 RawExceptionHandlers* raw_obj, ObjectPointerVisitor* visitor) { | 365 RawExceptionHandlers* raw_obj, ObjectPointerVisitor* visitor) { |
| 350 RawExceptionHandlers* obj = raw_obj->ptr(); | 366 RawExceptionHandlers* obj = raw_obj->ptr(); |
| 351 intptr_t length = Smi::Value(obj->length_); | 367 intptr_t length = Smi::Value(obj->length_); |
| 352 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->length_)); | 368 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->length_)); |
| 353 return ExceptionHandlers::InstanceSize(length); | 369 return ExceptionHandlers::InstanceSize(length); |
| 354 } | 370 } |
| 355 | 371 |
| 356 | 372 |
| 357 intptr_t RawContext::VisitContextPointers(RawContext* raw_obj, | 373 intptr_t RawContext::VisitContextPointers(RawContext* raw_obj, |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj, | 578 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj, |
| 563 ObjectPointerVisitor* visitor) { | 579 ObjectPointerVisitor* visitor) { |
| 564 // Make sure that we got here with the tagged pointer as this. | 580 // Make sure that we got here with the tagged pointer as this. |
| 565 ASSERT(raw_obj->IsHeapObject()); | 581 ASSERT(raw_obj->IsHeapObject()); |
| 566 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_); | 582 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_); |
| 567 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 583 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
| 568 return JSRegExp::InstanceSize(length); | 584 return JSRegExp::InstanceSize(length); |
| 569 } | 585 } |
| 570 | 586 |
| 571 } // namespace dart | 587 } // namespace dart |
| OLD | NEW |