Chromium Code Reviews| 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 RUNTIME_VM_OBJECT_H_ | 5 #ifndef RUNTIME_VM_OBJECT_H_ |
| 6 #define RUNTIME_VM_OBJECT_H_ | 6 #define RUNTIME_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 5868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5879 RawString* BuildName(NameVisibility visibility) const; | 5879 RawString* BuildName(NameVisibility visibility) const; |
| 5880 | 5880 |
| 5881 protected: | 5881 protected: |
| 5882 HEAP_OBJECT_IMPLEMENTATION(AbstractType, Instance); | 5882 HEAP_OBJECT_IMPLEMENTATION(AbstractType, Instance); |
| 5883 friend class Class; | 5883 friend class Class; |
| 5884 friend class Function; | 5884 friend class Function; |
| 5885 friend class TypeArguments; | 5885 friend class TypeArguments; |
| 5886 }; | 5886 }; |
| 5887 | 5887 |
| 5888 | 5888 |
| 5889 bool simpleInstanceOfType(const AbstractType& type); | |
|
Vyacheslav Egorov (Google)
2017/04/05 10:49:47
We avoid using global functions like this. I sugge
| |
| 5890 | |
| 5891 | |
| 5889 // A Type consists of a class, possibly parameterized with type | 5892 // A Type consists of a class, possibly parameterized with type |
| 5890 // arguments. Example: C<T1, T2>. | 5893 // arguments. Example: C<T1, T2>. |
| 5891 // An unresolved class is a String specifying the class name. | 5894 // An unresolved class is a String specifying the class name. |
| 5892 // | 5895 // |
| 5893 // Caution: 'RawType*' denotes a 'raw' pointer to a VM object of class Type, as | 5896 // Caution: 'RawType*' denotes a 'raw' pointer to a VM object of class Type, as |
| 5894 // opposed to 'Type' denoting a 'handle' to the same object. 'RawType' does not | 5897 // opposed to 'Type' denoting a 'handle' to the same object. 'RawType' does not |
| 5895 // relate to a 'raw type', as opposed to a 'cooked type' or 'rare type'. | 5898 // relate to a 'raw type', as opposed to a 'cooked type' or 'rare type'. |
| 5896 class Type : public AbstractType { | 5899 class Type : public AbstractType { |
| 5897 public: | 5900 public: |
| 5898 static intptr_t type_class_id_offset() { | 5901 static intptr_t type_class_id_offset() { |
| (...skipping 3070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 8969 | 8972 |
| 8970 inline void TypeArguments::SetHash(intptr_t value) const { | 8973 inline void TypeArguments::SetHash(intptr_t value) const { |
| 8971 // This is only safe because we create a new Smi, which does not cause | 8974 // This is only safe because we create a new Smi, which does not cause |
| 8972 // heap allocation. | 8975 // heap allocation. |
| 8973 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); | 8976 StoreSmi(&raw_ptr()->hash_, Smi::New(value)); |
| 8974 } | 8977 } |
| 8975 | 8978 |
| 8976 } // namespace dart | 8979 } // namespace dart |
| 8977 | 8980 |
| 8978 #endif // RUNTIME_VM_OBJECT_H_ | 8981 #endif // RUNTIME_VM_OBJECT_H_ |
| OLD | NEW |