Chromium Code Reviews| Index: runtime/vm/flow_graph_compiler_arm.cc |
| =================================================================== |
| --- runtime/vm/flow_graph_compiler_arm.cc (revision 24922) |
| +++ runtime/vm/flow_graph_compiler_arm.cc (working copy) |
| @@ -224,12 +224,12 @@ |
| __ Comment("InstantiatedTypeWithArgumentsTest"); |
| ASSERT(type.IsInstantiated()); |
| const Class& type_class = Class::ZoneHandle(type.type_class()); |
| - ASSERT(type_class.HasTypeArguments()); |
| + ASSERT(type_class.HasTypeArguments() || type_class.IsSignatureClass()); |
| const Register kInstanceReg = R0; |
| Error& malformed_error = Error::Handle(); |
| const Type& int_type = Type::Handle(Type::IntType()); |
| const bool smi_is_ok = int_type.IsSubtypeOf(type, &malformed_error); |
| - // Malforrmed type should have been handled at graph construction time. |
| + // Malformed type should have been handled at graph construction time. |
| ASSERT(smi_is_ok || malformed_error.IsNull()); |
| __ tst(kInstanceReg, ShifterOperand(kSmiTagMask)); |
| if (smi_is_ok) { |
| @@ -241,32 +241,34 @@ |
| AbstractTypeArguments::ZoneHandle(type.arguments()); |
| const bool is_raw_type = type_arguments.IsNull() || |
| type_arguments.IsRaw(type_arguments.Length()); |
| - if (is_raw_type) { |
| - const Register kClassIdReg = R2; |
| - // dynamic type argument, check only classes. |
| - __ LoadClassId(kClassIdReg, kInstanceReg); |
| - __ CompareImmediate(kClassIdReg, type_class.id()); |
| - __ b(is_instance_lbl, EQ); |
| - // List is a very common case. |
| - if (IsListClass(type_class)) { |
| - GenerateListTypeCheck(kClassIdReg, is_instance_lbl); |
| + if (!type_class.IsSignatureClass()) { |
|
regis
2013/07/12 00:29:31
A comment explaining why we do not do a class chec
srdjan
2013/07/12 16:56:11
Added comment:
Signature class is an instantiated
|
| + if (is_raw_type) { |
| + const Register kClassIdReg = R2; |
| + // dynamic type argument, check only classes. |
| + __ LoadClassId(kClassIdReg, kInstanceReg); |
| + __ CompareImmediate(kClassIdReg, type_class.id()); |
| + __ b(is_instance_lbl, EQ); |
| + // List is a very common case. |
| + if (IsListClass(type_class)) { |
| + GenerateListTypeCheck(kClassIdReg, is_instance_lbl); |
| + } |
| + return GenerateSubtype1TestCacheLookup( |
| + token_pos, type_class, is_instance_lbl, is_not_instance_lbl); |
| } |
| - return GenerateSubtype1TestCacheLookup( |
| - token_pos, type_class, is_instance_lbl, is_not_instance_lbl); |
| - } |
| - // If one type argument only, check if type argument is Object or dynamic. |
| - if (type_arguments.Length() == 1) { |
| - const AbstractType& tp_argument = AbstractType::ZoneHandle( |
| - type_arguments.TypeAt(0)); |
| - ASSERT(!tp_argument.IsMalformed()); |
| - if (tp_argument.IsType()) { |
| - ASSERT(tp_argument.HasResolvedTypeClass()); |
| - // Check if type argument is dynamic or Object. |
| - const Type& object_type = Type::Handle(Type::ObjectType()); |
| - if (object_type.IsSubtypeOf(tp_argument, NULL)) { |
| - // Instance class test only necessary. |
| - return GenerateSubtype1TestCacheLookup( |
| - token_pos, type_class, is_instance_lbl, is_not_instance_lbl); |
| + // If one type argument only, check if type argument is Object or dynamic. |
| + if (type_arguments.Length() == 1) { |
| + const AbstractType& tp_argument = AbstractType::ZoneHandle( |
| + type_arguments.TypeAt(0)); |
| + ASSERT(!tp_argument.IsMalformed()); |
| + if (tp_argument.IsType()) { |
| + ASSERT(tp_argument.HasResolvedTypeClass()); |
| + // Check if type argument is dynamic or Object. |
| + const Type& object_type = Type::Handle(Type::ObjectType()); |
| + if (object_type.IsSubtypeOf(tp_argument, NULL)) { |
| + // Instance class test only necessary. |
| + return GenerateSubtype1TestCacheLookup( |
| + token_pos, type_class, is_instance_lbl, is_not_instance_lbl); |
| + } |
| } |
| } |
| } |
| @@ -513,7 +515,7 @@ |
| const Class& type_class = Class::ZoneHandle(type.type_class()); |
| // A class equality check is only applicable with a dst type of a |
| // non-parameterized class or with a raw dst type of a parameterized class. |
|
regis
2013/07/12 00:29:31
Should this comment be updated?
srdjan
2013/07/12 16:56:11
Added:
non-signature class
|
| - if (type_class.HasTypeArguments()) { |
| + if (type_class.IsSignatureClass() || type_class.HasTypeArguments()) { |
| return GenerateInstantiatedTypeWithArgumentsTest(token_pos, |
| type, |
| is_instance_lbl, |