| 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/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 13 matching lines...) Expand all Loading... |
| 24 } | 24 } |
| 25 // Validate that the class_ field is sensible. | 25 // Validate that the class_ field is sensible. |
| 26 RawClass* raw_class = ptr()->class_; | 26 RawClass* raw_class = ptr()->class_; |
| 27 ASSERT(raw_class->IsHeapObject()); | 27 ASSERT(raw_class->IsHeapObject()); |
| 28 RawClass* raw_class_class = raw_class->ptr()->class_; | 28 RawClass* raw_class_class = raw_class->ptr()->class_; |
| 29 ASSERT(raw_class_class->IsHeapObject()); | 29 ASSERT(raw_class_class->IsHeapObject()); |
| 30 ASSERT(raw_class_class->ptr()->instance_kind_ == kClass); | 30 ASSERT(raw_class_class->ptr()->instance_kind_ == kClass); |
| 31 | 31 |
| 32 // Validate that the tags_ field is sensible. | 32 // Validate that the tags_ field is sensible. |
| 33 intptr_t tags = ptr()->tags_; | 33 intptr_t tags = ptr()->tags_; |
| 34 ASSERT((tags & 0xffff00f0) == 0); | 34 ASSERT((tags & 0x000000f0) == 0); |
| 35 } | 35 } |
| 36 | 36 |
| 37 | 37 |
| 38 intptr_t RawObject::SizeFromClass() const { | 38 intptr_t RawObject::SizeFromClass() const { |
| 39 NoHandleScope no_handles(Isolate::Current()); | 39 NoHandleScope no_handles(Isolate::Current()); |
| 40 | 40 |
| 41 // Only reasonable to be called on heap objects. | 41 // Only reasonable to be called on heap objects. |
| 42 ASSERT(IsHeapObject()); | 42 ASSERT(IsHeapObject()); |
| 43 | 43 |
| 44 RawClass* raw_class = ptr()->class_; | 44 RawClass* raw_class = ptr()->class_; |
| (...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj, | 670 intptr_t RawJSRegExp::VisitJSRegExpPointers(RawJSRegExp* raw_obj, |
| 671 ObjectPointerVisitor* visitor) { | 671 ObjectPointerVisitor* visitor) { |
| 672 // Make sure that we got here with the tagged pointer as this. | 672 // Make sure that we got here with the tagged pointer as this. |
| 673 ASSERT(raw_obj->IsHeapObject()); | 673 ASSERT(raw_obj->IsHeapObject()); |
| 674 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_); | 674 intptr_t length = Smi::Value(raw_obj->ptr()->data_length_); |
| 675 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); | 675 visitor->VisitPointers(raw_obj->from(), raw_obj->to()); |
| 676 return JSRegExp::InstanceSize(length); | 676 return JSRegExp::InstanceSize(length); |
| 677 } | 677 } |
| 678 | 678 |
| 679 } // namespace dart | 679 } // namespace dart |
| OLD | NEW |