| 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 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 // parameter types of the signature. | 589 // parameter types of the signature. |
| 590 RawFunction* signature_function() const { | 590 RawFunction* signature_function() const { |
| 591 return raw_ptr()->signature_function_; | 591 return raw_ptr()->signature_function_; |
| 592 } | 592 } |
| 593 static intptr_t signature_function_offset() { | 593 static intptr_t signature_function_offset() { |
| 594 return OFFSET_OF(RawClass, signature_function_); | 594 return OFFSET_OF(RawClass, signature_function_); |
| 595 } | 595 } |
| 596 | 596 |
| 597 // Return the signature type of this signature class. | 597 // Return the signature type of this signature class. |
| 598 // For example, if this class represents a signature of the form | 598 // For example, if this class represents a signature of the form |
| 599 // '<T, R>(T, [b: B, c: C]) => R', then its signature type is a parameterized | 599 // 'F<T, R>(T, [b: B, c: C]) => R', then its signature type is a parameterized |
| 600 // type with this class as the type class and type parameters 'T' and 'R' | 600 // type with this class as the type class and type parameters 'T' and 'R' |
| 601 // as its type argument vector. | 601 // as its type argument vector. |
| 602 RawType* SignatureType() const; | 602 RawType* SignatureType() const; |
| 603 | 603 |
| 604 RawLibrary* library() const { return raw_ptr()->library_; } | 604 RawLibrary* library() const { return raw_ptr()->library_; } |
| 605 void set_library(const Library& value) const; | 605 void set_library(const Library& value) const; |
| 606 | 606 |
| 607 // The type parameters (and their bounds) are specified as an array of | 607 // The type parameters (and their bounds) are specified as an array of |
| 608 // TypeParameter. | 608 // TypeParameter. |
| 609 RawTypeArguments* type_parameters() const { | 609 RawTypeArguments* type_parameters() const { |
| (...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 826 | 826 |
| 827 // Allocate the raw string classes. | 827 // Allocate the raw string classes. |
| 828 static RawClass* NewStringClass(intptr_t class_id); | 828 static RawClass* NewStringClass(intptr_t class_id); |
| 829 | 829 |
| 830 // Allocate a class representing a function signature described by | 830 // Allocate a class representing a function signature described by |
| 831 // signature_function, which must be a closure function or a signature | 831 // signature_function, which must be a closure function or a signature |
| 832 // function. | 832 // function. |
| 833 // The class may be type parameterized unless the signature_function is in a | 833 // The class may be type parameterized unless the signature_function is in a |
| 834 // static scope. In that case, the type parameters are copied from the owner | 834 // static scope. In that case, the type parameters are copied from the owner |
| 835 // class of signature_function. | 835 // class of signature_function. |
| 836 // A null signature function may be passed in and patched later. See below. |
| 836 static RawClass* NewSignatureClass(const String& name, | 837 static RawClass* NewSignatureClass(const String& name, |
| 837 const Function& signature_function, | 838 const Function& signature_function, |
| 838 const Script& script); | 839 const Script& script, |
| 840 intptr_t token_pos); |
| 841 |
| 842 // Patch the signature function of a signature class allocated without it. |
| 843 void PatchSignatureFunction(const Function& signature_function); |
| 839 | 844 |
| 840 // Return a class object corresponding to the specified kind. If | 845 // Return a class object corresponding to the specified kind. If |
| 841 // a canonicalized version of it exists then that object is returned | 846 // a canonicalized version of it exists then that object is returned |
| 842 // otherwise a new object is allocated and returned. | 847 // otherwise a new object is allocated and returned. |
| 843 static RawClass* GetClass(intptr_t class_id, bool is_signature_class); | 848 static RawClass* GetClass(intptr_t class_id, bool is_signature_class); |
| 844 | 849 |
| 845 private: | 850 private: |
| 846 enum { | 851 enum { |
| 847 kConstBit = 1, | 852 kConstBit = 1, |
| 848 kImplementedBit = 2, | 853 kImplementedBit = 2, |
| (...skipping 5491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6340 | 6345 |
| 6341 | 6346 |
| 6342 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, | 6347 RawObject* MegamorphicCache::GetTargetFunction(const Array& array, |
| 6343 intptr_t index) { | 6348 intptr_t index) { |
| 6344 return array.At((index * kEntryLength) + kTargetFunctionIndex); | 6349 return array.At((index * kEntryLength) + kTargetFunctionIndex); |
| 6345 } | 6350 } |
| 6346 | 6351 |
| 6347 } // namespace dart | 6352 } // namespace dart |
| 6348 | 6353 |
| 6349 #endif // VM_OBJECT_H_ | 6354 #endif // VM_OBJECT_H_ |
| OLD | NEW |