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 921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
932 void set_allocation_stub(const Code& value) const; | 932 void set_allocation_stub(const Code& value) const; |
933 | 933 |
934 RawArray* constants() const; | 934 RawArray* constants() const; |
935 | 935 |
936 RawFunction* GetInvocationDispatcher(const String& target_name, | 936 RawFunction* GetInvocationDispatcher(const String& target_name, |
937 const Array& args_desc, | 937 const Array& args_desc, |
938 RawFunction::Kind kind) const; | 938 RawFunction::Kind kind) const; |
939 | 939 |
940 void Finalize() const; | 940 void Finalize() const; |
941 | 941 |
942 const char* ApplyPatch(const Class& patch) const; | 942 // Apply given patch class to this class. |
| 943 // Return true on success, or false and error otherwise. |
| 944 bool ApplyPatch(const Class& patch, Error* error) const; |
943 | 945 |
944 RawError* EnsureIsFinalized(Isolate* isolate) const; | 946 RawError* EnsureIsFinalized(Isolate* isolate) const; |
945 | 947 |
946 // Allocate a class used for VM internal objects. | 948 // Allocate a class used for VM internal objects. |
947 template <class FakeObject> static RawClass* New(); | 949 template <class FakeObject> static RawClass* New(); |
948 | 950 |
949 // Allocate instance classes. | 951 // Allocate instance classes. |
950 static RawClass* New(const String& name, | 952 static RawClass* New(const String& name, |
951 const Script& script, | 953 const Script& script, |
952 intptr_t token_pos); | 954 intptr_t token_pos); |
(...skipping 702 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1655 String* error_message) const; | 1657 String* error_message) const; |
1656 bool AreValidArguments(const ArgumentsDescriptor& args_desc, | 1658 bool AreValidArguments(const ArgumentsDescriptor& args_desc, |
1657 String* error_message) const; | 1659 String* error_message) const; |
1658 | 1660 |
1659 // Fully qualified name uniquely identifying the function under gdb and during | 1661 // Fully qualified name uniquely identifying the function under gdb and during |
1660 // ast printing. The special ':' character, if present, is replaced by '_'. | 1662 // ast printing. The special ':' character, if present, is replaced by '_'. |
1661 const char* ToFullyQualifiedCString() const; | 1663 const char* ToFullyQualifiedCString() const; |
1662 | 1664 |
1663 // Returns true if this function has parameters that are compatible with the | 1665 // Returns true if this function has parameters that are compatible with the |
1664 // parameters of the other function in order for this function to override the | 1666 // parameters of the other function in order for this function to override the |
1665 // other function. Parameter types are ignored. | 1667 // other function. |
1666 bool HasCompatibleParametersWith(const Function& other) const; | 1668 bool HasCompatibleParametersWith(const Function& other, |
| 1669 Error* malformed_error) const; |
1667 | 1670 |
1668 // Returns true if the type of this function is a subtype of the type of | 1671 // Returns true if the type of this function is a subtype of the type of |
1669 // the other function. | 1672 // the other function. |
1670 bool IsSubtypeOf(const AbstractTypeArguments& type_arguments, | 1673 bool IsSubtypeOf(const AbstractTypeArguments& type_arguments, |
1671 const Function& other, | 1674 const Function& other, |
1672 const AbstractTypeArguments& other_type_arguments, | 1675 const AbstractTypeArguments& other_type_arguments, |
1673 Error* malformed_error) const { | 1676 Error* malformed_error) const { |
1674 return TypeTest(kIsSubtypeOf, | 1677 return TypeTest(kIsSubtypeOf, |
1675 type_arguments, | 1678 type_arguments, |
1676 other, | 1679 other, |
(...skipping 4372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6049 | 6052 |
6050 | 6053 |
6051 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6054 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
6052 intptr_t index) { | 6055 intptr_t index) { |
6053 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6056 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
6054 } | 6057 } |
6055 | 6058 |
6056 } // namespace dart | 6059 } // namespace dart |
6057 | 6060 |
6058 #endif // VM_OBJECT_H_ | 6061 #endif // VM_OBJECT_H_ |
OLD | NEW |