| OLD | NEW |
| 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 17 matching lines...) Expand all Loading... |
| 28 // Validate that the class_ field is sensible. | 28 // Validate that the class_ field is sensible. |
| 29 RawClass* raw_class = ptr()->class_; | 29 RawClass* raw_class = ptr()->class_; |
| 30 ASSERT(raw_class->IsHeapObject()); | 30 ASSERT(raw_class->IsHeapObject()); |
| 31 RawClass* raw_class_class = raw_class->ptr()->class_; | 31 RawClass* raw_class_class = raw_class->ptr()->class_; |
| 32 ASSERT(raw_class_class->IsHeapObject()); | 32 ASSERT(raw_class_class->IsHeapObject()); |
| 33 ASSERT(raw_class_class->ptr()->instance_kind_ == kClass); | 33 ASSERT(raw_class_class->ptr()->instance_kind_ == kClass); |
| 34 | 34 |
| 35 // Validate that the tags_ field is sensible. | 35 // Validate that the tags_ field is sensible. |
| 36 uword tags = ptr()->tags_; | 36 uword tags = ptr()->tags_; |
| 37 ASSERT((tags & 0x000000f0) == 0); | 37 ASSERT((tags & 0x000000f0) == 0); |
| 38 intptr_t cid = ClassTag::decode(tags); | 38 intptr_t cid = ClassIdTag::decode(tags); |
| 39 RawClass* tag_class = isolate->class_table()->At(cid); | 39 RawClass* tag_class = isolate->class_table()->At(cid); |
| 40 ASSERT(tag_class == raw_class); | 40 ASSERT(tag_class == raw_class); |
| 41 #endif | 41 #endif |
| 42 } | 42 } |
| 43 | 43 |
| 44 | 44 |
| 45 intptr_t RawObject::SizeFromClass() const { | 45 intptr_t RawObject::SizeFromClass() const { |
| 46 NoHandleScope no_handles(Isolate::Current()); | 46 NoHandleScope no_handles(Isolate::Current()); |
| 47 | 47 |
| 48 // Only reasonable to be called on heap objects. | 48 // Only reasonable to be called on heap objects. |
| (...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 935 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj, | 935 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj, |
| 936 ObjectPointerVisitor* visitor) { | 936 ObjectPointerVisitor* visitor) { |
| 937 // Make sure that we got here with the tagged pointer as this. | 937 // Make sure that we got here with the tagged pointer as this. |
| 938 ASSERT(raw_obj->IsHeapObject()); | 938 ASSERT(raw_obj->IsHeapObject()); |
| 939 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_); | 939 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_); |
| 940 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 940 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
| 941 return JSRegExp::InstanceSize(length); | 941 return JSRegExp::InstanceSize(length); |
| 942 } | 942 } |
| 943 | 943 |
| 944 } // namespace dart | 944 } // namespace dart |
| OLD | NEW |