Chromium Code Reviews| Index: runtime/vm/object.h |
| diff --git a/runtime/vm/object.h b/runtime/vm/object.h |
| index bdfab97cd5745c957ab6ab8ed107a36b363f1301..e39c855b2cc64f33c1406ad39643e55d644f9ffa 100644 |
| --- a/runtime/vm/object.h |
| +++ b/runtime/vm/object.h |
| @@ -1034,12 +1034,12 @@ class Class : public Object { |
| return OFFSET_OF(RawClass, type_arguments_field_offset_in_words_); |
| } |
| - RawType* CanonicalType() const { |
| - if ((NumTypeArguments() == 0) && !IsSignatureClass()) { |
| - return reinterpret_cast<RawType*>(raw_ptr()->canonical_types_); |
| - } |
| - return reinterpret_cast<RawType*>(Object::null()); |
| - } |
| + // Returns the canonical type of this class, i.e. the canonical type whose |
| + // type class is this class and whose type arguments are the uninstantiated |
| + // type parameters declared by this class if it is generic, e.g. Map<K, V>. |
|
srdjan
2015/08/21 05:02:21
Add comment: returns Type::null() if ...
regis
2015/08/21 15:38:22
Done.
|
| + RawType* CanonicalType() const; |
| + void SetCanonicalType(const Type& type) const; |
| + |
| static intptr_t canonical_types_offset() { |
| return OFFSET_OF(RawClass, canonical_types_); |
| } |
| @@ -1193,7 +1193,6 @@ class Class : public Object { |
| void InsertCanonicalConstant(intptr_t index, const Instance& constant) const; |
| - intptr_t NumCanonicalTypes() const; |
| intptr_t FindCanonicalTypeIndex(const Type& needle) const; |
| RawType* CanonicalTypeFromIndex(intptr_t idx) const; |