| 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 #ifndef VM_OBJECT_H_ | 5 #ifndef VM_OBJECT_H_ |
| 6 #define VM_OBJECT_H_ | 6 #define VM_OBJECT_H_ |
| 7 | 7 |
| 8 #include "vm/assert.h" | 8 #include "vm/assert.h" |
| 9 #include "vm/dart.h" | 9 #include "vm/dart.h" |
| 10 #include "vm/globals.h" | 10 #include "vm/globals.h" |
| (...skipping 2121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2132 | 2132 |
| 2133 void SetField(const Field& field, const Object& value) const { | 2133 void SetField(const Field& field, const Object& value) const { |
| 2134 *FieldAddr(field) = value.raw(); | 2134 *FieldAddr(field) = value.raw(); |
| 2135 } | 2135 } |
| 2136 | 2136 |
| 2137 RawType* GetType() const; | 2137 RawType* GetType() const; |
| 2138 | 2138 |
| 2139 virtual RawTypeArguments* GetTypeArguments() const; | 2139 virtual RawTypeArguments* GetTypeArguments() const; |
| 2140 virtual void SetTypeArguments(const TypeArguments& value) const; | 2140 virtual void SetTypeArguments(const TypeArguments& value) const; |
| 2141 | 2141 |
| 2142 // Short version of IsInstanceOf with an instantiated type. | |
| 2143 bool Is(const Type& type) const { | |
| 2144 ASSERT(type.IsInstantiated()); | |
| 2145 const TypeArguments& no_instantiator = TypeArguments::Handle(); | |
| 2146 return TestType(kIsSubtypeOf, type, no_instantiator); | |
| 2147 } | |
| 2148 | |
| 2149 // Check if this instance is an instance of the given type. | 2142 // Check if this instance is an instance of the given type. |
| 2150 bool IsInstanceOf(const Type& type, | 2143 bool IsInstanceOf(const Type& type, |
| 2151 const TypeArguments& type_instantiator) const { | 2144 const TypeArguments& type_instantiator) const { |
| 2152 return TestType(kIsSubtypeOf, type, type_instantiator); | 2145 return TestType(kIsSubtypeOf, type, type_instantiator); |
| 2153 } | 2146 } |
| 2154 | 2147 |
| 2155 // Check if this instance is assignable to the given type. | 2148 // Check if this instance is assignable to the given type. |
| 2156 bool IsAssignableTo(const Type& type, | 2149 bool IsAssignableTo(const Type& type, |
| 2157 const TypeArguments& type_instantiator) const { | 2150 const TypeArguments& type_instantiator) const { |
| 2158 return TestType(kIsAssignableTo, type, type_instantiator); | 2151 return TestType(kIsAssignableTo, type, type_instantiator); |
| (...skipping 1077 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3236 } | 3229 } |
| 3237 | 3230 |
| 3238 | 3231 |
| 3239 void Context::SetAt(intptr_t index, const Instance& value) const { | 3232 void Context::SetAt(intptr_t index, const Instance& value) const { |
| 3240 StorePointer(InstanceAddr(index), value.raw()); | 3233 StorePointer(InstanceAddr(index), value.raw()); |
| 3241 } | 3234 } |
| 3242 | 3235 |
| 3243 } // namespace dart | 3236 } // namespace dart |
| 3244 | 3237 |
| 3245 #endif // VM_OBJECT_H_ | 3238 #endif // VM_OBJECT_H_ |
| OLD | NEW |