2009-07-13 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mono / mini / mini-generic-sharing.c
index 374c851f985a444dec35b18f589136e4f89f91e7..54c29067a08353149953d642d717d2119e71ede4 100644 (file)
@@ -30,25 +30,10 @@ mono_get_generic_context_from_code (guint8 *code)
        return mono_jit_info_get_generic_sharing_context (jit_info);
 }
 
-/*
- * mini_method_get_context:
- * @method: a method
- *
- * Returns the generic context of a method or NULL if it doesn't have
- * one.  For an inflated method that's the context stored in the
- * method.  Otherwise it's in the method's generic container or in the
- * generic container of the method's class.
- */
 MonoGenericContext*
 mini_method_get_context (MonoMethod *method)
 {
-       if (method->is_inflated)
-               return mono_method_get_context (method);
-       if (method->is_generic)
-               return &(mono_method_get_generic_container (method)->context);
-       if (method->klass->generic_container)
-               return &method->klass->generic_container->context;
-       return NULL;
+       return mono_method_get_context_general (method, TRUE);
 }
 
 /*