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

Unified Diff: runtime/vm/flow_graph_compiler_ia32.cc

Issue 10696013: Consider upper bounds of type parameters in type checks. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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
Index: runtime/vm/flow_graph_compiler_ia32.cc
===================================================================
--- runtime/vm/flow_graph_compiler_ia32.cc (revision 9186)
+++ runtime/vm/flow_graph_compiler_ia32.cc (working copy)
@@ -312,7 +312,10 @@
const Immediate raw_null =
Immediate(reinterpret_cast<intptr_t>(Object::null()));
if (type.IsTypeParameter()) {
- // Load instantiator (or null) and instantiator type arguments on stack.
+ // TODO(regis): Introduce and use TypeParameter::Cast().
+ const TypeParameter* type_param =
+ reinterpret_cast<const TypeParameter*>(&type);
+ // Load instantiator (or null) and instantiator type arguments on stack.
__ movl(EDX, Address(ESP, 0)); // Get instantiator type arguments.
// EDX: instantiator type arguments.
// Check if type argument is Dynamic.
@@ -324,7 +327,7 @@
__ CompareClassId(EDX, kTypeArguments, EDI);
__ j(NOT_EQUAL, &fall_through, Assembler::kNearJump);
__ movl(EDI,
- FieldAddress(EDX, TypeArguments::type_at_offset(type.Index())));
+ FieldAddress(EDX, TypeArguments::type_at_offset(type_param->index())));
// EDI: concrete type of type.
// Check if type argument is dynamic.
__ CompareObject(EDI, Type::ZoneHandle(Type::DynamicType()));

Powered by Google App Engine
This is Rietveld 408576698