| Index: runtime/vm/object.cc
|
| ===================================================================
|
| --- runtime/vm/object.cc (revision 1053)
|
| +++ runtime/vm/object.cc (working copy)
|
| @@ -713,9 +713,17 @@
|
|
|
|
|
| RawType* Class::SignatureType() const {
|
| - // Return the cached signature type if any.
|
| - if (raw_ptr()->signature_type_ != Type::null()) {
|
| - return raw_ptr()->signature_type_;
|
| + // Return the only canonical signature type if already computed.
|
| + const Array& signature_types = Array::Handle(canonical_types());
|
| + if (signature_types.Length() > 0) {
|
| + Type& signature_type = Type::Handle();
|
| + signature_type ^= signature_types.At(0);
|
| + if (!signature_type.IsNull()) {
|
| + // A signature class has a unique canonical signature type.
|
| + ASSERT((signature_types.Length() == 1) ||
|
| + signature_types.At(1) == Object::null());
|
| + return signature_type.raw();
|
| + }
|
| }
|
| ASSERT(IsSignatureClass());
|
| TypeArguments& signature_type_arguments = TypeArguments::Handle();
|
| @@ -738,9 +746,8 @@
|
| const ParameterizedType& signature_type = ParameterizedType::Handle(
|
| ParameterizedType::New(*this, signature_type_arguments));
|
|
|
| - // Cache and return the still unfinalized signature type.
|
| + // Return the still unfinalized signature type.
|
| ASSERT(!signature_type.IsFinalized());
|
| - set_signature_type(signature_type);
|
| return signature_type.raw();
|
| }
|
|
|
| @@ -815,11 +822,6 @@
|
| }
|
|
|
|
|
| -void Class::set_signature_type(const Type& value) const {
|
| - StorePointer(&raw_ptr()->signature_type_, value.raw());
|
| -}
|
| -
|
| -
|
| void Class::set_class_state(int8_t state) const {
|
| ASSERT(state == RawClass::kAllocated ||
|
| state == RawClass::kPreFinalized ||
|
|
|