| 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 | 351 |
| 345 intptr_t RawPcDescriptors::VisitPcDescriptorsPointers( | 352 intptr_t RawPcDescriptors::VisitPcDescriptorsPointers( |
| 346 RawPcDescriptors* raw_obj, ObjectPointerVisitor* visitor) { | 353 RawPcDescriptors* raw_obj, ObjectPointerVisitor* visitor) { |
| 347 RawPcDescriptors* obj = raw_obj->ptr(); | 354 RawPcDescriptors* obj = raw_obj->ptr(); |
| 348 intptr_t length = Smi::Value(obj->length_); | 355 intptr_t length = Smi::Value(obj->length_); |
| 349 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->length_)); | 356 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->length_)); |
| 350 return PcDescriptors::InstanceSize(length); | 357 return PcDescriptors::InstanceSize(length); |
| 351 } | 358 } |
| 352 | 359 |
| 353 | 360 |
| 361 intptr_t RawLocalVarDescriptors::VisitLocalVarDescriptorsPointers( |
| 362 RawLocalVarDescriptors* raw_obj, ObjectPointerVisitor* visitor) { |
| 363 RawLocalVarDescriptors* obj = raw_obj->ptr(); |
| 364 intptr_t len = obj->length_; |
| 365 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->names_)); |
| 366 return LocalVarDescriptors::InstanceSize(len); |
| 367 } |
| 368 |
| 369 |
| 354 intptr_t RawExceptionHandlers::VisitExceptionHandlersPointers( | 370 intptr_t RawExceptionHandlers::VisitExceptionHandlersPointers( |
| 355 RawExceptionHandlers* raw_obj, ObjectPointerVisitor* visitor) { | 371 RawExceptionHandlers* raw_obj, ObjectPointerVisitor* visitor) { |
| 356 RawExceptionHandlers* obj = raw_obj->ptr(); | 372 RawExceptionHandlers* obj = raw_obj->ptr(); |
| 357 intptr_t length = Smi::Value(obj->length_); | 373 intptr_t length = Smi::Value(obj->length_); |
| 358 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->length_)); | 374 visitor->VisitPointer(reinterpret_cast<RawObject**>(&obj->length_)); |
| 359 return ExceptionHandlers::InstanceSize(length); | 375 return ExceptionHandlers::InstanceSize(length); |
| 360 } | 376 } |
| 361 | 377 |
| 362 | 378 |
| 363 intptr_t RawContext::VisitContextPointers(RawContext* raw_obj, | 379 intptr_t RawContext::VisitContextPointers(RawContext* raw_obj, |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj, | 584 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj, |
| 569 ObjectPointerVisitor* visitor) { | 585 ObjectPointerVisitor* visitor) { |
| 570 // Make sure that we got here with the tagged pointer as this. | 586 // Make sure that we got here with the tagged pointer as this. |
| 571 ASSERT(raw_obj->IsHeapObject()); | 587 ASSERT(raw_obj->IsHeapObject()); |
| 572 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_); | 588 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_); |
| 573 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 589 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
| 574 return JSRegExp::InstanceSize(length); | 590 return JSRegExp::InstanceSize(length); |
| 575 } | 591 } |
| 576 | 592 |
| 577 } // namespace dart | 593 } // namespace dart |
| OLD | NEW |