Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1752)

Unified Diff: runtime/vm/flow_graph_compiler_mips.cc

Issue 18054022: Fix 11574: Smi is a subtype of parametrizable Compare. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/flow_graph_compiler_mips.cc
===================================================================
--- runtime/vm/flow_graph_compiler_mips.cc (revision 24599)
+++ runtime/vm/flow_graph_compiler_mips.cc (working copy)
@@ -225,9 +225,17 @@
const Class& type_class = Class::ZoneHandle(type.type_class());
ASSERT(type_class.HasTypeArguments());
const Register kInstanceReg = A0;
- // A Smi object cannot be the instance of a parameterized class.
+ 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.
+ ASSERT(smi_is_ok || malformed_error.IsNull());
__ andi(CMPRES, kInstanceReg, Immediate(kSmiTagMask));
- __ beq(CMPRES, ZR, is_not_instance_lbl);
+ if (smi_is_ok) {
+ __ beq(CMPRES, ZR, is_not_instance_lbl);
regis 2013/06/28 22:07:09 is_instance_lbl
srdjan 2013/06/28 22:11:34 Done.
+ } else {
+ __ beq(CMPRES, ZR, is_not_instance_lbl);
+ }
const AbstractTypeArguments& type_arguments =
AbstractTypeArguments::ZoneHandle(type.arguments());
const bool is_raw_type = type_arguments.IsNull() ||
@@ -499,7 +507,6 @@
}
if (type.IsInstantiated()) {
const Class& type_class = Class::ZoneHandle(type.type_class());
- // A Smi object cannot be the instance of a parameterized 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.
if (type_class.HasTypeArguments()) {
« no previous file with comments | « runtime/vm/flow_graph_compiler_ia32.cc ('k') | runtime/vm/flow_graph_compiler_x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698