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 681 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
692 bool IsTopLevel() const; | 692 bool IsTopLevel() const; |
693 | 693 |
694 RawArray* fields() const { return raw_ptr()->fields_; } | 694 RawArray* fields() const { return raw_ptr()->fields_; } |
695 void SetFields(const Array& value) const; | 695 void SetFields(const Array& value) const; |
696 | 696 |
697 // Returns true if non-static fields are defined. | 697 // Returns true if non-static fields are defined. |
698 bool HasInstanceFields() const; | 698 bool HasInstanceFields() const; |
699 | 699 |
700 RawArray* functions() const { return raw_ptr()->functions_; } | 700 RawArray* functions() const { return raw_ptr()->functions_; } |
701 void SetFunctions(const Array& value) const; | 701 void SetFunctions(const Array& value) const; |
| 702 void AddFunction(const Function& function) const; |
702 | 703 |
703 void AddClosureFunction(const Function& function) const; | 704 void AddClosureFunction(const Function& function) const; |
704 RawFunction* LookupClosureFunction(intptr_t token_pos) const; | 705 RawFunction* LookupClosureFunction(intptr_t token_pos) const; |
705 | 706 |
706 RawFunction* LookupDynamicFunction(const String& name) const; | 707 RawFunction* LookupDynamicFunction(const String& name) const; |
707 RawFunction* LookupStaticFunction(const String& name) const; | 708 RawFunction* LookupStaticFunction(const String& name) const; |
708 RawFunction* LookupConstructor(const String& name) const; | 709 RawFunction* LookupConstructor(const String& name) const; |
709 RawFunction* LookupFactory(const String& name) const; | 710 RawFunction* LookupFactory(const String& name) const; |
710 RawFunction* LookupFunction(const String& name) const; | 711 RawFunction* LookupFunction(const String& name) const; |
711 RawFunction* LookupGetterFunction(const String& name) const; | 712 RawFunction* LookupGetterFunction(const String& name) const; |
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1188 // Signature class of this closure function or signature function. | 1189 // Signature class of this closure function or signature function. |
1189 RawClass* signature_class() const; | 1190 RawClass* signature_class() const; |
1190 void set_signature_class(const Class& value) const; | 1191 void set_signature_class(const Class& value) const; |
1191 | 1192 |
1192 RawInstance* implicit_static_closure() const; | 1193 RawInstance* implicit_static_closure() const; |
1193 void set_implicit_static_closure(const Instance& closure) const; | 1194 void set_implicit_static_closure(const Instance& closure) const; |
1194 | 1195 |
1195 RawCode* closure_allocation_stub() const; | 1196 RawCode* closure_allocation_stub() const; |
1196 void set_closure_allocation_stub(const Code& value) const; | 1197 void set_closure_allocation_stub(const Code& value) const; |
1197 | 1198 |
| 1199 void set_extracted_method_closure(const Function& function) const; |
| 1200 RawFunction* extracted_method_closure() const; |
| 1201 |
| 1202 bool IsMethodExtractor() const { |
| 1203 return kind() == RawFunction::kMethodExtractor; |
| 1204 } |
| 1205 |
1198 // Returns true iff an implicit closure function has been created | 1206 // Returns true iff an implicit closure function has been created |
1199 // for this function. | 1207 // for this function. |
1200 bool HasImplicitClosureFunction() const { | 1208 bool HasImplicitClosureFunction() const { |
1201 return implicit_closure_function() != null(); | 1209 return implicit_closure_function() != null(); |
1202 } | 1210 } |
1203 | 1211 |
1204 // Return the closure function implicitly created for this function. | 1212 // Return the closure function implicitly created for this function. |
1205 // If none exists yet, create one and remember it. | 1213 // If none exists yet, create one and remember it. |
1206 RawFunction* ImplicitClosureFunction() const; | 1214 RawFunction* ImplicitClosureFunction() const; |
1207 | 1215 |
(...skipping 22 matching lines...) Expand all Loading... |
1230 bool IsDynamicFunction() const { | 1238 bool IsDynamicFunction() const { |
1231 if (is_static() || is_abstract()) { | 1239 if (is_static() || is_abstract()) { |
1232 return false; | 1240 return false; |
1233 } | 1241 } |
1234 switch (kind()) { | 1242 switch (kind()) { |
1235 case RawFunction::kRegularFunction: | 1243 case RawFunction::kRegularFunction: |
1236 case RawFunction::kGetterFunction: | 1244 case RawFunction::kGetterFunction: |
1237 case RawFunction::kSetterFunction: | 1245 case RawFunction::kSetterFunction: |
1238 case RawFunction::kImplicitGetter: | 1246 case RawFunction::kImplicitGetter: |
1239 case RawFunction::kImplicitSetter: | 1247 case RawFunction::kImplicitSetter: |
| 1248 case RawFunction::kMethodExtractor: |
1240 return true; | 1249 return true; |
1241 case RawFunction::kClosureFunction: | 1250 case RawFunction::kClosureFunction: |
1242 case RawFunction::kConstructor: | 1251 case RawFunction::kConstructor: |
1243 case RawFunction::kConstImplicitGetter: | 1252 case RawFunction::kConstImplicitGetter: |
1244 return false; | 1253 return false; |
1245 default: | 1254 default: |
1246 UNREACHABLE(); | 1255 UNREACHABLE(); |
1247 return false; | 1256 return false; |
1248 } | 1257 } |
1249 } | 1258 } |
(...skipping 5003 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6253 | 6262 |
6254 | 6263 |
6255 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6264 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
6256 intptr_t index) { | 6265 intptr_t index) { |
6257 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6266 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
6258 } | 6267 } |
6259 | 6268 |
6260 } // namespace dart | 6269 } // namespace dart |
6261 | 6270 |
6262 #endif // VM_OBJECT_H_ | 6271 #endif // VM_OBJECT_H_ |
OLD | NEW |