| 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 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 intptr_t FindFieldIndex(const Field& field) const; | 942 intptr_t FindFieldIndex(const Field& field) const; |
| 943 RawField* FieldFromIndex(intptr_t idx) const; | 943 RawField* FieldFromIndex(intptr_t idx) const; |
| 944 | 944 |
| 945 // Returns an array of all fields of this class and its superclasses indexed | 945 // Returns an array of all fields of this class and its superclasses indexed |
| 946 // by offset in words. | 946 // by offset in words. |
| 947 RawArray* OffsetToFieldMap() const; | 947 RawArray* OffsetToFieldMap() const; |
| 948 | 948 |
| 949 // Returns true if non-static fields are defined. | 949 // Returns true if non-static fields are defined. |
| 950 bool HasInstanceFields() const; | 950 bool HasInstanceFields() const; |
| 951 | 951 |
| 952 // TODO(koda): Avoid VM service indexing into this array; unite w/ hash table. |
| 952 RawArray* functions() const { return raw_ptr()->functions_; } | 953 RawArray* functions() const { return raw_ptr()->functions_; } |
| 953 void SetFunctions(const Array& value) const; | 954 void SetFunctions(const Array& value) const; |
| 954 void AddFunction(const Function& function) const; | 955 void AddFunction(const Function& function) const; |
| 955 intptr_t FindFunctionIndex(const Function& function) const; | 956 intptr_t FindFunctionIndex(const Function& function) const; |
| 956 RawFunction* FunctionFromIndex(intptr_t idx) const; | 957 RawFunction* FunctionFromIndex(intptr_t idx) const; |
| 957 intptr_t FindImplicitClosureFunctionIndex(const Function& needle) const; | 958 intptr_t FindImplicitClosureFunctionIndex(const Function& needle) const; |
| 958 RawFunction* ImplicitClosureFunctionFromIndex(intptr_t idx) const; | 959 RawFunction* ImplicitClosureFunctionFromIndex(intptr_t idx) const; |
| 959 | 960 |
| 960 RawGrowableObjectArray* closures() const { | 961 RawGrowableObjectArray* closures() const { |
| 961 return raw_ptr()->closure_functions_; | 962 return raw_ptr()->closure_functions_; |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1204 RawObject* canonical_types() const; | 1205 RawObject* canonical_types() const; |
| 1205 | 1206 |
| 1206 RawArray* invocation_dispatcher_cache() const; | 1207 RawArray* invocation_dispatcher_cache() const; |
| 1207 void set_invocation_dispatcher_cache(const Array& cache) const; | 1208 void set_invocation_dispatcher_cache(const Array& cache) const; |
| 1208 RawFunction* CreateInvocationDispatcher(const String& target_name, | 1209 RawFunction* CreateInvocationDispatcher(const String& target_name, |
| 1209 const Array& args_desc, | 1210 const Array& args_desc, |
| 1210 RawFunction::Kind kind) const; | 1211 RawFunction::Kind kind) const; |
| 1211 | 1212 |
| 1212 void CalculateFieldOffsets() const; | 1213 void CalculateFieldOffsets() const; |
| 1213 | 1214 |
| 1215 // functions_hash_table is in use iff there are at least this many functions. |
| 1216 static const intptr_t kFunctionLookupHashTreshold = 16; |
| 1217 |
| 1214 // Initial value for the cached number of type arguments. | 1218 // Initial value for the cached number of type arguments. |
| 1215 static const intptr_t kUnknownNumTypeArguments = -1; | 1219 static const intptr_t kUnknownNumTypeArguments = -1; |
| 1216 | 1220 |
| 1217 int16_t num_type_arguments() const { | 1221 int16_t num_type_arguments() const { |
| 1218 return raw_ptr()->num_type_arguments_; | 1222 return raw_ptr()->num_type_arguments_; |
| 1219 } | 1223 } |
| 1220 void set_num_type_arguments(intptr_t value) const; | 1224 void set_num_type_arguments(intptr_t value) const; |
| 1221 | 1225 |
| 1222 int16_t num_own_type_arguments() const { | 1226 int16_t num_own_type_arguments() const { |
| 1223 return raw_ptr()->num_own_type_arguments_; | 1227 return raw_ptr()->num_own_type_arguments_; |
| (...skipping 6089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7313 | 7317 |
| 7314 | 7318 |
| 7315 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 7319 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 7316 intptr_t index) { | 7320 intptr_t index) { |
| 7317 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 7321 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 7318 } | 7322 } |
| 7319 | 7323 |
| 7320 } // namespace dart | 7324 } // namespace dart |
| 7321 | 7325 |
| 7322 #endif // VM_OBJECT_H_ | 7326 #endif // VM_OBJECT_H_ |
| OLD | NEW |