| 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 #ifndef VM_OBJECT_H_ | 5 #ifndef VM_OBJECT_H_ |
| 6 #define VM_OBJECT_H_ | 6 #define VM_OBJECT_H_ |
| 7 | 7 |
| 8 #include "include/dart_api.h" | 8 #include "include/dart_api.h" |
| 9 #include "platform/assert.h" | 9 #include "platform/assert.h" |
| 10 #include "platform/utils.h" | 10 #include "platform/utils.h" |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 VMHandles::AllocateZoneHandle(isolate)); \ | 85 VMHandles::AllocateZoneHandle(isolate)); \ |
| 86 initializeHandle(obj, raw_ptr); \ | 86 initializeHandle(obj, raw_ptr); \ |
| 87 if (!obj->Is##object()) { \ | 87 if (!obj->Is##object()) { \ |
| 88 FATAL("Handle check failed."); \ | 88 FATAL("Handle check failed."); \ |
| 89 } \ | 89 } \ |
| 90 return *obj; \ | 90 return *obj; \ |
| 91 } \ | 91 } \ |
| 92 static object& CheckedZoneHandle(RawObject* raw_ptr) { \ | 92 static object& CheckedZoneHandle(RawObject* raw_ptr) { \ |
| 93 return CheckedZoneHandle(Isolate::Current(), raw_ptr); \ | 93 return CheckedZoneHandle(Isolate::Current(), raw_ptr); \ |
| 94 } \ | 94 } \ |
| 95 static const object& Cast(const Object& obj) { \ |
| 96 ASSERT(obj.Is##object()); \ |
| 97 return reinterpret_cast<const object&>(obj); \ |
| 98 } \ |
| 95 static Raw##object* null() { \ | 99 static Raw##object* null() { \ |
| 96 return reinterpret_cast<Raw##object*>(Object::null()); \ | 100 return reinterpret_cast<Raw##object*>(Object::null()); \ |
| 97 } \ | 101 } \ |
| 98 virtual const char* ToCString() const; \ | 102 virtual const char* ToCString() const; \ |
| 99 static const ObjectKind kInstanceKind = k##object; \ | 103 static const ObjectKind kInstanceKind = k##object; \ |
| 100 protected: /* NOLINT */ \ | 104 protected: /* NOLINT */ \ |
| 101 object() : super() {} \ | 105 object() : super() {} \ |
| 102 private: /* NOLINT */ \ | 106 private: /* NOLINT */ \ |
| 103 /* Initialize the handle based on the raw_ptr in the presence of null. */ \ | 107 /* Initialize the handle based on the raw_ptr in the presence of null. */ \ |
| 104 static void initializeHandle(object* obj, RawObject* raw_ptr) { \ | 108 static void initializeHandle(object* obj, RawObject* raw_ptr) { \ |
| (...skipping 4982 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5087 } | 5091 } |
| 5088 | 5092 |
| 5089 | 5093 |
| 5090 intptr_t Stackmap::SizeInBits() const { | 5094 intptr_t Stackmap::SizeInBits() const { |
| 5091 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte); | 5095 return (Smi::Value(raw_ptr()->bitmap_size_in_bytes_) * kBitsPerByte); |
| 5092 } | 5096 } |
| 5093 | 5097 |
| 5094 } // namespace dart | 5098 } // namespace dart |
| 5095 | 5099 |
| 5096 #endif // VM_OBJECT_H_ | 5100 #endif // VM_OBJECT_H_ |
| OLD | NEW |