| 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/object.h" | 7 #include "vm/object.h" |
| 8 #include "vm/visitor.h" | 8 #include "vm/visitor.h" |
| 9 | 9 |
| 10 | 10 |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 instance_size = FourByteString::InstanceSize(string_length); | 96 instance_size = FourByteString::InstanceSize(string_length); |
| 97 break; | 97 break; |
| 98 } | 98 } |
| 99 case kArray: | 99 case kArray: |
| 100 case kImmutableArray: { | 100 case kImmutableArray: { |
| 101 const RawArray* raw_array = reinterpret_cast<const RawArray*>(this); | 101 const RawArray* raw_array = reinterpret_cast<const RawArray*>(this); |
| 102 intptr_t array_length = Smi::Value(raw_array->ptr()->length_); | 102 intptr_t array_length = Smi::Value(raw_array->ptr()->length_); |
| 103 instance_size = Array::InstanceSize(array_length); | 103 instance_size = Array::InstanceSize(array_length); |
| 104 break; | 104 break; |
| 105 } | 105 } |
| 106 case kTypeArray: { |
| 107 const RawTypeArray* raw_array = |
| 108 reinterpret_cast<const RawTypeArray*>(this); |
| 109 intptr_t array_length = Smi::Value(raw_array->ptr()->length_); |
| 110 instance_size = TypeArray::InstanceSize(array_length); |
| 111 break; |
| 112 } |
| 106 case kPcDescriptors: { | 113 case kPcDescriptors: { |
| 107 const RawPcDescriptors* raw_descriptors = | 114 const RawPcDescriptors* raw_descriptors = |
| 108 reinterpret_cast<const RawPcDescriptors*>(this); | 115 reinterpret_cast<const RawPcDescriptors*>(this); |
| 109 intptr_t num_descriptors = Smi::Value(raw_descriptors->ptr()->length_); | 116 intptr_t num_descriptors = Smi::Value(raw_descriptors->ptr()->length_); |
| 110 instance_size = PcDescriptors::InstanceSize(num_descriptors); | 117 instance_size = PcDescriptors::InstanceSize(num_descriptors); |
| 111 break; | 118 break; |
| 112 } | 119 } |
| 113 case kExceptionHandlers: { | 120 case kExceptionHandlers: { |
| 114 const RawExceptionHandlers* raw_handlers = | 121 const RawExceptionHandlers* raw_handlers = |
| 115 reinterpret_cast<const RawExceptionHandlers*>(this); | 122 reinterpret_cast<const RawExceptionHandlers*>(this); |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj, | 497 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj, |
| 491 ObjectPointerVisitor* visitor) { | 498 ObjectPointerVisitor* visitor) { |
| 492 // Make sure that we got here with the tagged pointer as this. | 499 // Make sure that we got here with the tagged pointer as this. |
| 493 ASSERT(raw_obj->IsHeapObject()); | 500 ASSERT(raw_obj->IsHeapObject()); |
| 494 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_); | 501 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_); |
| 495 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 502 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
| 496 return JSRegExp::InstanceSize(length); | 503 return JSRegExp::InstanceSize(length); |
| 497 } | 504 } |
| 498 | 505 |
| 499 } // namespace dart | 506 } // namespace dart |
| OLD | NEW |