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 1043 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1054 }; | 1054 }; |
1055 | 1055 |
1056 | 1056 |
1057 class Function : public Object { | 1057 class Function : public Object { |
1058 public: | 1058 public: |
1059 RawString* name() const { return raw_ptr()->name_; } | 1059 RawString* name() const { return raw_ptr()->name_; } |
1060 RawString* UserVisibleName() const; | 1060 RawString* UserVisibleName() const; |
1061 RawString* QualifiedUserVisibleName() const; | 1061 RawString* QualifiedUserVisibleName() const; |
1062 virtual RawString* DictionaryName() const { return name(); } | 1062 virtual RawString* DictionaryName() const { return name(); } |
1063 | 1063 |
1064 // Build a string of the form '<T, R>(T, [b: B, c: C]) => R' representing the | 1064 // Build a string of the form 'C<T, R>(T, {b: B, c: C}) => R' representing the |
1065 // internal signature of the given function. | 1065 // internal signature of the given function. In this example, T and R are |
| 1066 // type parameters of class C, the owner of the function. |
1066 RawString* Signature() const { | 1067 RawString* Signature() const { |
1067 const bool instantiate = false; | 1068 const bool instantiate = false; |
1068 return BuildSignature(instantiate, kInternalName, TypeArguments::Handle()); | 1069 return BuildSignature(instantiate, kInternalName, TypeArguments::Handle()); |
1069 } | 1070 } |
1070 | 1071 |
1071 // Build a string of the form '(A, [b: B, c: C]) => D' representing the | 1072 // Build a string of the form '(A, {b: B, c: C}) => D' representing the |
1072 // signature of the given function, where all generic types (e.g. '<T, R>' in | 1073 // signature of the given function, where all generic types (e.g. '<T, R>' in |
1073 // '<T, R>(T, [b: B, c: C]) => R') are instantiated using the given | 1074 // 'C<T, R>(T, {b: B, c: C}) => R') are instantiated using the given |
1074 // instantiator type argument vector (e.g. '<A, D>'). | 1075 // instantiator type argument vector of a C instance (e.g. '<A, D>'). |
1075 RawString* InstantiatedSignatureFrom( | 1076 RawString* InstantiatedSignatureFrom( |
1076 const AbstractTypeArguments& instantiator, | 1077 const AbstractTypeArguments& instantiator, |
1077 NameVisibility name_visibility) const { | 1078 NameVisibility name_visibility) const { |
1078 const bool instantiate = true; | 1079 const bool instantiate = true; |
1079 return BuildSignature(instantiate, name_visibility, instantiator); | 1080 return BuildSignature(instantiate, name_visibility, instantiator); |
1080 } | 1081 } |
1081 | 1082 |
1082 // Returns true if the signature of this function is instantiated, i.e. if it | 1083 // Returns true if the signature of this function is instantiated, i.e. if it |
1083 // does not involve generic parameter types or generic result type. | 1084 // does not involve generic parameter types or generic result type. |
1084 bool HasInstantiatedSignature() const; | 1085 bool HasInstantiatedSignature() const; |
(...skipping 4692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5777 if (this->CharAt(i) != str.CharAt(begin_index + i)) { | 5778 if (this->CharAt(i) != str.CharAt(begin_index + i)) { |
5778 return false; | 5779 return false; |
5779 } | 5780 } |
5780 } | 5781 } |
5781 return true; | 5782 return true; |
5782 } | 5783 } |
5783 | 5784 |
5784 } // namespace dart | 5785 } // namespace dart |
5785 | 5786 |
5786 #endif // VM_OBJECT_H_ | 5787 #endif // VM_OBJECT_H_ |
OLD | NEW |