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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 instance_size = ExceptionHandlers::InstanceSize(num_handlers); | 135 instance_size = ExceptionHandlers::InstanceSize(num_handlers); |
136 break; | 136 break; |
137 } | 137 } |
138 case kJSRegExp: { | 138 case kJSRegExp: { |
139 const RawJSRegExp* raw_jsregexp = | 139 const RawJSRegExp* raw_jsregexp = |
140 reinterpret_cast<const RawJSRegExp*>(this); | 140 reinterpret_cast<const RawJSRegExp*>(this); |
141 intptr_t data_length = Smi::Value(raw_jsregexp->ptr()->data_length_); | 141 intptr_t data_length = Smi::Value(raw_jsregexp->ptr()->data_length_); |
142 instance_size = JSRegExp::InstanceSize(data_length); | 142 instance_size = JSRegExp::InstanceSize(data_length); |
143 break; | 143 break; |
144 } | 144 } |
| 145 case kFreeListElement: { |
| 146 uword addr = RawObject::ToAddr(const_cast<RawObject*>(this)); |
| 147 FreeListElement* element = reinterpret_cast<FreeListElement*>(addr); |
| 148 instance_size = element->Size(); |
| 149 break; |
| 150 } |
145 default: | 151 default: |
146 UNREACHABLE(); | 152 UNREACHABLE(); |
147 break; | 153 break; |
148 } | 154 } |
149 } | 155 } |
150 ASSERT(instance_size != 0); | 156 ASSERT(instance_size != 0); |
151 return instance_size; | 157 return instance_size; |
152 } | 158 } |
153 | 159 |
154 | 160 |
(...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj, | 568 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj, |
563 ObjectPointerVisitor* visitor) { | 569 ObjectPointerVisitor* visitor) { |
564 // Make sure that we got here with the tagged pointer as this. | 570 // Make sure that we got here with the tagged pointer as this. |
565 ASSERT(raw_obj->IsHeapObject()); | 571 ASSERT(raw_obj->IsHeapObject()); |
566 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_); | 572 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_); |
567 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 573 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
568 return JSRegExp::InstanceSize(length); | 574 return JSRegExp::InstanceSize(length); |
569 } | 575 } |
570 | 576 |
571 } // namespace dart | 577 } // namespace dart |
OLD | NEW |