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 1089 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1100 // by offset in words. | 1100 // by offset in words. |
1101 RawArray* OffsetToFieldMap() const; | 1101 RawArray* OffsetToFieldMap() const; |
1102 | 1102 |
1103 // Returns true if non-static fields are defined. | 1103 // Returns true if non-static fields are defined. |
1104 bool HasInstanceFields() const; | 1104 bool HasInstanceFields() const; |
1105 | 1105 |
1106 // TODO(koda): Unite w/ hash table. | 1106 // TODO(koda): Unite w/ hash table. |
1107 RawArray* functions() const { return raw_ptr()->functions_; } | 1107 RawArray* functions() const { return raw_ptr()->functions_; } |
1108 void SetFunctions(const Array& value) const; | 1108 void SetFunctions(const Array& value) const; |
1109 void AddFunction(const Function& function) const; | 1109 void AddFunction(const Function& function) const; |
| 1110 void RemoveFunction(const Function& function) const; |
1110 intptr_t FindFunctionIndex(const Function& function) const; | 1111 intptr_t FindFunctionIndex(const Function& function) const; |
1111 RawFunction* FunctionFromIndex(intptr_t idx) const; | 1112 RawFunction* FunctionFromIndex(intptr_t idx) const; |
1112 intptr_t FindImplicitClosureFunctionIndex(const Function& needle) const; | 1113 intptr_t FindImplicitClosureFunctionIndex(const Function& needle) const; |
1113 RawFunction* ImplicitClosureFunctionFromIndex(intptr_t idx) const; | 1114 RawFunction* ImplicitClosureFunctionFromIndex(intptr_t idx) const; |
1114 | 1115 |
1115 RawGrowableObjectArray* closures() const { | 1116 RawGrowableObjectArray* closures() const { |
1116 return raw_ptr()->closure_functions_; | 1117 return raw_ptr()->closure_functions_; |
1117 } | 1118 } |
1118 void AddClosureFunction(const Function& function) const; | 1119 void AddClosureFunction(const Function& function) const; |
1119 RawFunction* LookupClosureFunction(intptr_t token_pos) const; | 1120 RawFunction* LookupClosureFunction(intptr_t token_pos) const; |
(...skipping 1147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2267 bool TestParameterType(TypeTestKind test_kind, | 2268 bool TestParameterType(TypeTestKind test_kind, |
2268 intptr_t parameter_position, | 2269 intptr_t parameter_position, |
2269 intptr_t other_parameter_position, | 2270 intptr_t other_parameter_position, |
2270 const TypeArguments& type_arguments, | 2271 const TypeArguments& type_arguments, |
2271 const Function& other, | 2272 const Function& other, |
2272 const TypeArguments& other_type_arguments, | 2273 const TypeArguments& other_type_arguments, |
2273 Error* bound_error) const; | 2274 Error* bound_error) const; |
2274 | 2275 |
2275 FINAL_HEAP_OBJECT_IMPLEMENTATION(Function, Object); | 2276 FINAL_HEAP_OBJECT_IMPLEMENTATION(Function, Object); |
2276 friend class Class; | 2277 friend class Class; |
| 2278 friend class Parser; // For set_eval_script. |
2277 // RawFunction::VisitFunctionPointers accesses the private constructor of | 2279 // RawFunction::VisitFunctionPointers accesses the private constructor of |
2278 // Function. | 2280 // Function. |
2279 friend class RawFunction; | 2281 friend class RawFunction; |
2280 }; | 2282 }; |
2281 | 2283 |
2282 | 2284 |
2283 class ClosureData: public Object { | 2285 class ClosureData: public Object { |
2284 public: | 2286 public: |
2285 static intptr_t InstanceSize() { | 2287 static intptr_t InstanceSize() { |
2286 return RoundedAllocationSize(sizeof(RawClosureData)); | 2288 return RoundedAllocationSize(sizeof(RawClosureData)); |
(...skipping 5303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7590 | 7592 |
7591 | 7593 |
7592 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 7594 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
7593 intptr_t index) { | 7595 intptr_t index) { |
7594 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 7596 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
7595 } | 7597 } |
7596 | 7598 |
7597 } // namespace dart | 7599 } // namespace dart |
7598 | 7600 |
7599 #endif // VM_OBJECT_H_ | 7601 #endif // VM_OBJECT_H_ |
OLD | NEW |