Permalink
Browse files

In metadata:

	Fix tests/find-method.2.il
	* loader.c (find_method, find_method_in_class): Remove is_inflated
	argument.  Revert 2006-01-18 change.
	(method_from_memberref) [MONO_MEMBERREF_PARENT_TYPESPEC]: If type
	is generic, search for method in its generic definition.
	* class.c (mono_class_setup_vtable_general): Print generic
	arguments of generic types in debugging printf.

In tests:
	* Makefile.am (TEST_PROG_RUN, JITTEST_PROG_RUN): Don't set MONO_PATH.
	(with_mono_path2, RUNTIME2, GMCS, ILASM2): New.
	(TEST_CS2_SRC, TEST_IL2_SRC): New.
	(EXTRA_DIST): Add them.
	(testjit-default, testjit-net_2_0): New.  Copies of old testjit,
	updated to use appropriate runtimes.
	(testjit): Depend on them.

svn path=/trunk/mono/; revision=56160
  • Loading branch information...
1 parent e2fb6bd commit ffc06adc221ed008bd72536889792944cf252a3c @harinath harinath committed Jan 27, 2006
Showing with 207 additions and 41 deletions.
  1. +10 −0 mono/metadata/ChangeLog
  2. +2 −2 mono/metadata/class.c
  3. +18 −23 mono/metadata/loader.c
  4. +10 −0 mono/tests/ChangeLog
  5. +51 −16 mono/tests/Makefile.am
  6. +116 −0 mono/tests/find-method.2.il
@@ -1,3 +1,13 @@
+2006-01-27 Raja R Harinath <rharinath@novell.com>
+
+ Fix tests/find-method.2.il
+ * loader.c (find_method, find_method_in_class): Remove is_inflated
+ argument. Revert 2006-01-18 change.
+ (method_from_memberref) [MONO_MEMBERREF_PARENT_TYPESPEC]: If type
+ is generic, search for method in its generic definition.
+ * class.c (mono_class_setup_vtable_general): Print generic
+ arguments of generic types in debugging printf.
+
2006-01-26 Zoltan Varga <vargaz@gmail.com>
* object-internals.h (MonoThread): Add 'thread_dump_requested' field.
@@ -1907,8 +1907,8 @@ mono_class_setup_vtable_general (MonoClass *class, MonoMethod **overrides, int o
overrides [j*2+1]->slot, overrides [j*2]->name, overrides [j*2]->slot);
}
msig = mono_signature_get_desc (mono_method_signature (im), FALSE);
- printf ("no implementation for interface method %s.%s::%s(%s) in class %s.%s\n",
- ic->name_space, ic->name, im->name, msig, class->name_space, class->name);
+ printf ("no implementation for interface method %s::%s(%s) in class %s.%s\n",
+ mono_type_get_name (&ic->byval_arg), im->name, msig, class->name_space, class->name);
g_free (msig);
for (j = 0; j < class->method.count; ++j) {
MonoMethod *cm = class->methods [j];
@@ -327,38 +327,32 @@ mono_metadata_signature_vararg_match (MonoMethodSignature *sig1, MonoMethodSigna
static MonoMethod *
find_method_in_class (MonoClass *klass, const char *name, const char *qname, const char *fqname,
- gboolean is_inflated, MonoMethodSignature *sig)
+ MonoMethodSignature *sig)
{
int i;
mono_class_setup_methods (klass);
for (i = 0; i < klass->method.count; ++i) {
- MonoMethod *m, *orig_m;
-
- m = orig_m = klass->methods [i];
- if (!is_inflated && m->is_inflated)
- m = ((MonoMethodInflated *) m)->declaring;
+ MonoMethod *m = klass->methods [i];
if (!((fqname && !strcmp (m->name, fqname)) ||
(qname && !strcmp (m->name, qname)) || !strcmp (m->name, name)))
continue;
if (sig->call_convention == MONO_CALL_VARARG) {
if (mono_metadata_signature_vararg_match (sig, mono_method_signature (m)))
- return orig_m;
+ return m;
} else {
- MonoMethodSignature *msig = mono_method_signature (m);
- if (mono_metadata_signature_equal (sig, msig))
- return orig_m;
+ if (mono_metadata_signature_equal (sig, mono_method_signature (m)))
+ return m;
}
}
return NULL;
}
static MonoMethod *
-find_method (MonoClass *klass, MonoClass *ic, const char* name, gboolean is_inflated,
- MonoMethodSignature *sig)
+find_method (MonoClass *klass, MonoClass *ic, const char* name, MonoMethodSignature *sig)
{
int i;
char *qname, *fqname, *class_name;
@@ -379,7 +373,7 @@ find_method (MonoClass *klass, MonoClass *ic, const char* name, gboolean is_infl
class_name = qname = fqname = NULL;
while (klass) {
- result = find_method_in_class (klass, name, qname, fqname, is_inflated, sig);
+ result = find_method_in_class (klass, name, qname, fqname, sig);
if (result)
goto out;
@@ -389,7 +383,7 @@ find_method (MonoClass *klass, MonoClass *ic, const char* name, gboolean is_infl
for (i = 0; i < klass->interface_count; i++) {
MonoClass *ic = klass->interfaces [i];
- result = find_method_in_class (ic, name, qname, fqname, is_inflated, sig);
+ result = find_method_in_class (ic, name, qname, fqname, sig);
if (result)
goto out;
}
@@ -398,8 +392,7 @@ find_method (MonoClass *klass, MonoClass *ic, const char* name, gboolean is_infl
}
if (is_interface)
- result = find_method_in_class (
- mono_defaults.object_class, name, qname, fqname, is_inflated, sig);
+ result = find_method_in_class (mono_defaults.object_class, name, qname, fqname, sig);
out:
g_free (class_name);
@@ -542,7 +535,7 @@ method_from_memberref (MonoImage *image, guint32 idx, MonoGenericContext *typesp
switch (class) {
case MONO_MEMBERREF_PARENT_TYPEREF:
- method = find_method (klass, NULL, mname, FALSE, sig);
+ method = find_method (klass, NULL, mname, sig);
if (!method)
mono_loader_set_error_method_load (klass, mname);
mono_metadata_free_method_signature (sig);
@@ -554,12 +547,14 @@ method_from_memberref (MonoImage *image, guint32 idx, MonoGenericContext *typesp
type = &klass->byval_arg;
if (type->type != MONO_TYPE_ARRAY && type->type != MONO_TYPE_SZARRAY) {
- method = find_method (klass, NULL, mname, FALSE, sig);
+ MonoClass *in_class = klass->generic_class ? klass->generic_class->container_class : klass;
+ method = find_method (in_class, NULL, mname, sig);
if (!method)
g_warning ("Missing method %s in assembly %s, type %s", mname, image->name, mono_class_get_name (klass));
- else if (klass->generic_class && (klass != method->klass))
- method = mono_class_inflate_generic_method (
- method, klass->generic_class->context);
+ else if (klass->generic_class) {
+ method = mono_class_inflate_generic_method (method, klass->generic_class->context);
+ method = mono_get_inflated_method (method);
+ }
mono_metadata_free_method_signature (sig);
break;
}
@@ -600,7 +595,7 @@ method_from_memberref (MonoImage *image, guint32 idx, MonoGenericContext *typesp
break;
}
case MONO_MEMBERREF_PARENT_TYPEDEF:
- method = find_method (klass, NULL, mname, FALSE, sig);
+ method = find_method (klass, NULL, mname, sig);
if (!method)
g_warning (
"Missing method %s::%s(%s) in assembly %s",
@@ -1252,7 +1247,7 @@ mono_get_method_constrained (MonoImage *image, guint32 token, MonoClass *constra
if (constrained_class->generic_class)
gclass = constrained_class->generic_class;
- result = find_method (constrained_class, ic, method->name, TRUE, mono_method_signature (method));
+ result = find_method (constrained_class, ic, method->name, mono_method_signature (method));
if (!result)
g_warning ("Missing method %s in assembly %s token %x", method->name,
image->name, token);
View
@@ -1,3 +1,13 @@
+2006-01-27 Raja R Harinath <rharinath@novell.com>
+
+ * Makefile.am (TEST_PROG_RUN, JITTEST_PROG_RUN): Don't set MONO_PATH.
+ (with_mono_path2, RUNTIME2, GMCS, ILASM2): New.
+ (TEST_CS2_SRC, TEST_IL2_SRC): New.
+ (EXTRA_DIST): Add them.
+ (testjit-default, testjit-net_2_0): New. Copies of old testjit,
+ updated to use appropriate runtimes.
+ (testjit): Depend on them.
+
2006-01-26 Zoltan Varga <vargaz@gmail.com>
* thread-dump.cs: New file.
@@ -3,21 +3,25 @@ check-local: test
TEST_PROG = ../interpreter/mint
JITTEST_PROG = ../mini/mono
-TEST_PROG_RUN = MONO_PATH=$(mcs_topdir)/class/lib/default MONO_SHARED_DIR=$(mono_build_root)/runtime $(LIBTOOL) --mode=execute $(TEST_PROG)
-JITTEST_PROG_RUN = MONO_PATH=$(mcs_topdir)/class/lib/default MONO_SHARED_DIR=$(mono_build_root)/runtime $(LIBTOOL) --mode=execute $(JITTEST_PROG)
+TEST_PROG_RUN = MONO_SHARED_DIR=$(mono_build_root)/runtime $(LIBTOOL) --mode=execute $(TEST_PROG)
+JITTEST_PROG_RUN = MONO_SHARED_DIR=$(mono_build_root)/runtime $(LIBTOOL) --mode=execute $(JITTEST_PROG)
RUNTIME_ARGS=--config tests-config --optimize=all
with_mono_path = MONO_PATH=$(mcs_topdir)/class/lib/default
+with_mono_path2 = MONO_PATH=$(mcs_topdir)/class/lib/net_2_0
RUNTIME = $(with_mono_path) $(top_builddir)/runtime/mono-wrapper
+RUNTIME2 = $(with_mono_path2) $(top_builddir)/runtime/mono-wrapper
MKBUNDLE = \
PKG_CONFIG_PATH=$(top_builddir):$(PKG_CONFIG_PATH) \
$(RUNTIME) $(mcs_topdir)/tools/mkbundle/mkbundle.exe
-CSC = $(RUNTIME) $(mcs_topdir)/class/lib/default/mcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219
+MCS = $(RUNTIME) $(mcs_topdir)/class/lib/default/mcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219
+GMCS = $(RUNTIME2) $(mcs_topdir)/class/lib/net_2_0/gmcs.exe -unsafe -nowarn:0162 -nowarn:0168 -nowarn:0219
ILASM = $(RUNTIME) $(mcs_topdir)/class/lib/default/ilasm.exe
+ILASM2 = $(RUNTIME2) $(mcs_topdir)/class/lib/net_2_0/ilasm.exe
BENCHSRC=fib.cs random.cs nested-loops.cs ackermann.cs tight-loop.cs sieve.cs
@@ -242,19 +246,29 @@ TEST_IL_SRC= \
reload-at-bb-end.il \
even-odd.il
+TEST_CS2_SRC =
+TEST_IL2_SRC = find-method.2.il
TESTSI_CS=$(TEST_CS_SRC:.cs=.exe)
TESTSI_IL=$(TEST_IL_SRC:.il=.exe)
+TESTSI_CS2=$(TEST_CS2_SRC:.2.il=.exe)
+TESTSI_IL2=$(TEST_IL2_SRC:.2.il=.exe)
TESTBS=$(BENCHSRC:.cs=.exe)
STRESS_TESTS=$(STRESS_TESTS_SRC:.cs=.exe)
-EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_IL_SRC) $(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl
+EXTRA_DIST=test-driver $(TEST_CS_SRC) $(TEST_CS2_SRC) $(TEST_IL_SRC) $(TEST_IL2_SRC) $(BENCHSRC) $(STRESS_TESTS_SRC) stress-runner.pl
+
+%.exe: %.2.il
+ $(ILASM2) -out:$@ $<
%.exe: %.il
$(ILASM) -out:$@ $<
+%.exe: %.2.cs TestDriver.dll
+ $(GMCS) -r:TestDriver.dll -out:$@ $<
+
%.exe: %.cs TestDriver.dll
- $(CSC) -r:TestDriver.dll -out:$@ $<
+ $(MCS) -r:TestDriver.dll -out:$@ $<
# mkbundle works on ppc, but the pkg-config POC doesn't when run with make test
if POWERPC
@@ -264,14 +278,14 @@ test: testjit testbundle test-type-load
endif
TestDriver.dll:
- $(CSC) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs
+ $(MCS) -target:library -out:$@ $(srcdir)/../mini/TestDriver.cs
test_cs: $(TEST_PROG) $(TESTSI_CS) libtest.la
@failed=0; \
passed=0; \
export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
for i in $(TESTSI_CS); do \
- if $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
+ if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
then \
passed=`expr $${passed} + 1`; \
else \
@@ -286,7 +300,7 @@ test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
passed=0; \
export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
for i in $(TESTSI_IL); do \
- if $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
+ if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
then \
passed=`expr $${passed} + 1`; \
else \
@@ -298,16 +312,37 @@ test_il: $(TEST_PROG) $(TESTSI_IL) libtest.la
testb: $(TEST_PROG) $(TESTBS)
for i in $(TESTBS); do \
- $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
+ $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
done
-testjit: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la
+testjit: testjit-default testjit-net_2_0
+
+testjit-default: $(TESTSI_CS) $(TESTSI_IL) $(TESTBS) libtest.la
@failed=0; \
passed=0; \
failed_tests="";\
for i in $(TESTSI_CS) $(TESTBS) $(TESTSI_IL); do \
rm -f $${i}.so; \
- if $(srcdir)/test-driver '$(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
+ if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
+ then \
+ passed=`expr $${passed} + 1`; \
+ else \
+ if [ $$? = 2 ]; then break; fi; \
+ failed=`expr $${failed} + 1`; \
+ failed_tests="$${failed_tests} $$i"; \
+ fi \
+ done; \
+ echo "$${passed} test(s) passed. $${failed} test(s) did not pass."; \
+ if [ $${failed} != 0 ]; then echo -e "\nFailed tests:\n"; \
+ for i in $${failed_tests}; do echo $${i}; done; exit 1; fi
+
+testjit-net_2_0: $(TESTSI_CS2) $(TESTSI_IL2) libtest.la
+ @failed=0; \
+ passed=0; \
+ failed_tests="";\
+ for i in $(TESTSI_IL2); do \
+ rm -f $${i}.so; \
+ if $(srcdir)/test-driver '$(with_mono_path2) $(JITTEST_PROG_RUN)' $$i '$(DISABLED_TESTS)' $(RUNTIME_ARGS); \
then \
passed=`expr $${passed} + 1`; \
else \
@@ -328,7 +363,7 @@ testaot: $(TESTSI_CS) $(TESTBS) libtest.la
for i in $(TESTSI_CS) $(TESTBS); do \
rm -f $${i}.so; \
$(JITTEST_PROG_RUN) --aot $${i} > /dev/null; \
- if $(srcdir)/test-driver '$(JITTEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
+ if $(srcdir)/test-driver '$(with_mono_path) $(JITTEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
then \
passed=`expr $${passed} + 1`; \
else \
@@ -350,7 +385,7 @@ testinterp: $(TESTSI_CS) $(TESTSI_IL) libtest.la
failed_tests="";\
export LD_LIBRARY_PATH="`pwd`/.libs:$${LD_LIBRARY_PATH}"; \
for i in $(TESTSI_CS) $(TESTSI_IL); do \
- if $(srcdir)/test-driver '$(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
+ if $(srcdir)/test-driver '$(with_mono_path) $(TEST_PROG_RUN)' $$i "$(DISABLED_TESTS)" $(RUNTIME_ARGS); \
then \
passed=`expr $${passed} + 1`; \
else \
@@ -395,9 +430,9 @@ testbundle: console.exe
EXTRA_DIST += load-missing.il t-missing.cs load-exceptions.cs
test-type-load: TestDriver.dll
$(ILASM) /dll /output:load-missing.dll $(srcdir)/load-missing.il
- $(CSC) /target:library /out:t.dll /d:FOUND $(srcdir)/t-missing.cs
- $(CSC) /r:TestDriver.dll /r:load-missing.dll /r:t.dll /out:load-exceptions.exe $(srcdir)/load-exceptions.cs
- $(CSC) /target:library /out:t.dll $(srcdir)/t-missing.cs
+ $(MCS) -t:library -out:t.dll -d:FOUND $(srcdir)/t-missing.cs
+ $(MCS) -r:TestDriver.dll -r:load-missing.dll -r:t.dll -out:load-exceptions.exe $(srcdir)/load-exceptions.cs
+ $(MCS) -t:library -out:t.dll $(srcdir)/t-missing.cs
$(RUNTIME) load-exceptions.exe
noinst_LTLIBRARIES = libtest.la
Oops, something went wrong.

0 comments on commit ffc06ad

Please sign in to comment.