Commit 397f674e by Tom Tromey Committed by Tom Tromey

natClass.cc (method_cache_count): Removed.

	* java/lang/natClass.cc (method_cache_count): Removed.
	(_Jv_FindMethodInCache): Don't loop looking for the hash entry.
	(_Jv_AddMethodToCache): Don't loop.

From-SVN: r30397
parent 3442c71c
1999-11-04 Tom Tromey <tromey@cygnus.com>
* java/lang/natClass.cc (method_cache_count): Removed.
(_Jv_FindMethodInCache): Don't loop looking for the hash entry.
(_Jv_AddMethodToCache): Don't loop.
* configure.in: Removed `qt' threads case.
* include/quick-threads.h: Removed.
* quick-threads.cc: Removed.
......
......@@ -86,6 +86,7 @@ LIBTOOL = @LIBTOOL@
LN_S = @LN_S@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
OBJDUMP = @OBJDUMP@
PACKAGE = @PACKAGE@
PERL = @PERL@
RANLIB = @RANLIB@
......@@ -95,7 +96,6 @@ THREADINCS = @THREADINCS@
THREADLIBS = @THREADLIBS@
THREADOBJS = @THREADOBJS@
THREADSPEC = @THREADSPEC@
USE_SYMBOL_UNDERSCORE = @USE_SYMBOL_UNDERSCORE@
VERSION = @VERSION@
ZDEPS = @ZDEPS@
ZINCS = @ZINCS@
......@@ -708,7 +708,8 @@ LINK = $(LIBTOOL) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@
DATA = $(data_DATA) $(toolexeclib_DATA)
DIST_COMMON = README COPYING.LIB ChangeLog Makefile.am Makefile.in NEWS \
THANKS acinclude.m4 aclocal.m4 configure configure.in libgcj.spec.in
THANKS acconfig.h acinclude.m4 aclocal.m4 configure configure.in \
include/config.h.in include/stamp-h.in libgcj.spec.in
DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST)
......@@ -930,6 +931,34 @@ config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
include/config.h: include/stamp-h
@if test ! -f $@; then \
rm -f include/stamp-h; \
$(MAKE) include/stamp-h; \
else :; fi
include/stamp-h: $(srcdir)/include/config.h.in $(top_builddir)/config.status
cd $(top_builddir) \
&& CONFIG_FILES= CONFIG_HEADERS=include/config.h \
$(SHELL) ./config.status
@echo timestamp > include/stamp-h 2> /dev/null
$(srcdir)/include/config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/include/stamp-h.in
@if test ! -f $@; then \
rm -f $(srcdir)/include/stamp-h.in; \
$(MAKE) $(srcdir)/include/stamp-h.in; \
else :; fi
$(srcdir)/include/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h
cd $(top_srcdir) && $(AUTOHEADER)
@echo timestamp > $(srcdir)/include/stamp-h.in 2> /dev/null
mostlyclean-hdr:
clean-hdr:
distclean-hdr:
-rm -f include/config.h
maintainer-clean-hdr:
libgcj.spec: $(top_builddir)/config.status libgcj.spec.in
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
......@@ -1328,29 +1357,32 @@ distclean-generic:
-rm -f config.cache config.log stamp-h stamp-h[0-9]*
maintainer-clean-generic:
mostlyclean-am: mostlyclean-toolexeclibLTLIBRARIES mostlyclean-compile \
mostlyclean-libtool mostlyclean-binPROGRAMS \
mostlyclean-noinstPROGRAMS mostlyclean-tags \
mostlyclean-depend mostlyclean-generic
mostlyclean-am: mostlyclean-hdr mostlyclean-toolexeclibLTLIBRARIES \
mostlyclean-compile mostlyclean-libtool \
mostlyclean-binPROGRAMS mostlyclean-noinstPROGRAMS \
mostlyclean-tags mostlyclean-depend mostlyclean-generic
mostlyclean: mostlyclean-recursive
clean-am: clean-toolexeclibLTLIBRARIES clean-compile clean-libtool \
clean-binPROGRAMS clean-noinstPROGRAMS clean-tags \
clean-depend clean-generic mostlyclean-am clean-local
clean-am: clean-hdr clean-toolexeclibLTLIBRARIES clean-compile \
clean-libtool clean-binPROGRAMS clean-noinstPROGRAMS \
clean-tags clean-depend clean-generic mostlyclean-am \
clean-local
clean: clean-recursive
distclean-am: distclean-toolexeclibLTLIBRARIES distclean-compile \
distclean-libtool distclean-binPROGRAMS \
distclean-noinstPROGRAMS distclean-tags \
distclean-depend distclean-generic clean-am
distclean-am: distclean-hdr distclean-toolexeclibLTLIBRARIES \
distclean-compile distclean-libtool \
distclean-binPROGRAMS distclean-noinstPROGRAMS \
distclean-tags distclean-depend distclean-generic \
clean-am
-rm -f libtool
distclean: distclean-recursive
-rm -f config.status
maintainer-clean-am: maintainer-clean-toolexeclibLTLIBRARIES \
maintainer-clean-am: maintainer-clean-hdr \
maintainer-clean-toolexeclibLTLIBRARIES \
maintainer-clean-compile maintainer-clean-libtool \
maintainer-clean-binPROGRAMS \
maintainer-clean-noinstPROGRAMS maintainer-clean-tags \
......@@ -1362,9 +1394,9 @@ maintainer-clean-am: maintainer-clean-toolexeclibLTLIBRARIES \
maintainer-clean: maintainer-clean-recursive
-rm -f config.status
.PHONY: mostlyclean-toolexeclibLTLIBRARIES \
distclean-toolexeclibLTLIBRARIES clean-toolexeclibLTLIBRARIES \
maintainer-clean-toolexeclibLTLIBRARIES \
.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \
mostlyclean-toolexeclibLTLIBRARIES distclean-toolexeclibLTLIBRARIES \
clean-toolexeclibLTLIBRARIES maintainer-clean-toolexeclibLTLIBRARIES \
uninstall-toolexeclibLTLIBRARIES install-toolexeclibLTLIBRARIES \
mostlyclean-compile distclean-compile clean-compile \
maintainer-clean-compile mostlyclean-libtool distclean-libtool \
......
......@@ -515,28 +515,21 @@ struct _Jv_mcache {
};
static _Jv_mcache method_cache[MCACHE_SIZE];
static int method_cache_count;
static void*
static void *
_Jv_FindMethodInCache (jclass klass,
_Jv_Utf8Const *name,
_Jv_Utf8Const *signature)
{
for (int index = name->hash % MCACHE_SIZE;
method_cache[index].klass != NULL;
index = (index+1) % MCACHE_SIZE)
{
_Jv_mcache *mc = (method_cache+index);
_Jv_Method *m = mc->method;
if (mc->klass == klass
&& m != NULL // thread safe check
&& _Jv_equalUtf8Consts (m->name, name)
&& _Jv_equalUtf8Consts (m->signature, signature))
{
return mc->method->ncode;
}
}
int index = name->hash & MCACHE_SIZE;
_Jv_mcache *mc = method_cache + index;
_Jv_Method *m = mc->method;
if (mc->klass == klass
&& m != NULL // thread safe check
&& _Jv_equalUtf8Consts (m->name, name)
&& _Jv_equalUtf8Consts (m->signature, signature))
return mc->method->ncode;
return NULL;
}
......@@ -546,22 +539,11 @@ _Jv_AddMethodToCache (jclass klass,
{
_Jv_MonitorEnter (&ClassClass);
if (method_cache_count > MCACHE_SIZE*2/3)
{
for (int i = 0; i < MCACHE_SIZE; i++)
method_cache[i].klass = 0;
}
int index = method->name->hash & MCACHE_SIZE;
for (int index = method->name->hash % MCACHE_SIZE;
method_cache[index].klass != NULL;
index = (index+1) % MCACHE_SIZE)
{
method_cache[index].method = method;
method_cache[index].klass = klass;
}
method_cache[index].method = method;
method_cache[index].klass = klass;
method_cache_count += 1;
_Jv_MonitorExit (&ClassClass);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment