From 72066a87afd35a5082048ad0fd82ffce51cca0de Mon Sep 17 00:00:00 2001 From: edwin Date: Tue, 25 Apr 2006 12:00:58 +0000 Subject: [PATCH] * src/vm/options.h (opt_verify): Only declare for ENABLE_VERIFIER. (opt_liberalutf): Removed. * src/vm/options.c (opt_verify): Only declare for ENABLE_VERIFIER. (opt_liberalutf): Removed. * src/vm/jit/inline/inline.c (test_inlining): Only verify if ENABLE_VERIFIER. * src/vm/jit/parse.c (parse): Only check opt_verify if ENABLE_VERIFIER. * src/vm/global.h (ENABLE_VERIFIER): Removed. This is now defined in config.h. * src/vm/vm.c (OPT_NOVERIFY): Only define this option if ENABLE_VERIFIER. (OPT_LIBERALUTF): Removed. * configure.ac (--disable-verifier): Added configure option. * src/vm/jit/stacktrace.c (stacktrace_getStack): Gather a wider range for the cycle count statistics. --- configure.ac | 17 +++++++++++++++++ src/vm/global.h | 7 +------ src/vm/jit/inline/inline.c | 4 +++- src/vm/jit/parse.c | 10 +++++++++- src/vm/jit/stacktrace.c | 4 ++-- src/vm/options.c | 6 +++--- src/vm/options.h | 6 +++--- src/vm/vm.c | 15 ++++++++------- 8 files changed, 46 insertions(+), 23 deletions(-) diff --git a/configure.ac b/configure.ac index 115a76931..e985c4691 100644 --- a/configure.ac +++ b/configure.ac @@ -373,6 +373,23 @@ if test x"${ENABLE_STATISTICS}" = "xyes"; then fi +dnl check for verifier +AC_MSG_CHECKING(whether classfile verification should be enabled) +AC_ARG_ENABLE([verifier], + [AS_HELP_STRING(--disable-verifier,disable classfile verification [[default=yes]])], + [case "${enableval}" in + no) ENABLE_VERIFIER=no;; + *) ENABLE_VERIFIER=yes;; + esac], + [ENABLE_VERIFIER=yes]) +AC_MSG_RESULT(${ENABLE_VERIFIER}) +AM_CONDITIONAL([ENABLE_VERIFIER], test x"${ENABLE_VERIFIER}" = "xyes") + +if test x"${ENABLE_VERIFIER}" = "xyes"; then + AC_DEFINE([ENABLE_VERIFIER], 1, [enable classfile verification]) +fi + + dnl check for compiler timing AC_MSG_CHECKING(whether real-time timing should be enabled) AC_ARG_ENABLE([rt-timing], diff --git a/src/vm/global.h b/src/vm/global.h index ecfa4e55b..f2eaa901e 100644 --- a/src/vm/global.h +++ b/src/vm/global.h @@ -33,7 +33,7 @@ Joseph Wenninger Christian Thalinger - $Id: global.h 4829 2006-04-24 17:16:45Z edwin $ + $Id: global.h 4833 2006-04-25 12:00:58Z edwin $ */ @@ -88,11 +88,6 @@ typedef struct java_objectarray java_objectarray; #define CLASSPATH_LIBRARY_PATH CLASSPATH_LIBDIR "/classpath" -/* - * ENABLE_VERIFIER activates bytecode verification and other checks - */ -#define ENABLE_VERIFIER - /* if we have threads disabled this one is not defined ************************/ #if !defined(USE_THREADS) diff --git a/src/vm/jit/inline/inline.c b/src/vm/jit/inline/inline.c index c385c2f25..3de92f74c 100644 --- a/src/vm/jit/inline/inline.c +++ b/src/vm/jit/inline/inline.c @@ -28,7 +28,7 @@ Changes: - $Id: inline.c 4736 2006-04-05 11:32:52Z edwin $ + $Id: inline.c 4833 2006-04-25 12:00:58Z edwin $ */ @@ -1670,6 +1670,7 @@ static bool test_inlining(inline_node *iln,jitdata *jd, DOLOG( printf("INLINING STACK INTERFACES FOR "); method_println(iln->m) ); inline_stack_interfaces(iln,n_rd); +#if defined(ENABLE_VERIFIER) if (debug_verify_inlined_code) { debug_verify_inlined_code = 0; DOLOG( printf("VERIFYING INLINED RESULT...\n") ); @@ -1683,6 +1684,7 @@ static bool test_inlining(inline_node *iln,jitdata *jd, } debug_verify_inlined_code = 1; } +#endif /* defined(ENABLE_VERIFIER) */ #ifndef NDEBUG #if 1 diff --git a/src/vm/jit/parse.c b/src/vm/jit/parse.c index 3e2e9e193..d0e91c7ee 100644 --- a/src/vm/jit/parse.c +++ b/src/vm/jit/parse.c @@ -31,7 +31,7 @@ Joseph Wenninger Christian Thalinger - $Id: parse.c 4778 2006-04-14 23:48:26Z edwin $ + $Id: parse.c 4833 2006-04-25 12:00:58Z edwin $ */ @@ -826,7 +826,9 @@ fetch_opcode: /* only with -noverify, otherwise the typechecker does this */ +#if defined(ENABLE_VERIFIER) if (!opt_verify) { +#endif result = resolve_field_lazy(iptr,NULL,m); if (result == resolveFailed) return false; @@ -847,10 +849,12 @@ fetch_opcode: else { iptr->target = NULL; } +#if defined(ENABLE_VERIFIER) } else { iptr->target = NULL; } +#endif PINC; } break; @@ -904,7 +908,9 @@ invoke_method: /* only with -noverify, otherwise the typechecker does this */ +#if defined(ENABLE_VERIFIER) if (!opt_verify) { +#endif result = resolve_method_lazy(iptr,NULL,m); if (result == resolveFailed) return false; @@ -925,10 +931,12 @@ invoke_method: else { iptr->target = NULL; } +#if defined(ENABLE_VERIFIER) } else { iptr->target = NULL; } +#endif PINC; break; diff --git a/src/vm/jit/stacktrace.c b/src/vm/jit/stacktrace.c index 0d6634ee4..0d64b7def 100644 --- a/src/vm/jit/stacktrace.c +++ b/src/vm/jit/stacktrace.c @@ -29,7 +29,7 @@ Changes: Christian Thalinger Edwin Steiner - $Id: stacktrace.c 4825 2006-04-24 15:43:36Z edwin $ + $Id: stacktrace.c 4833 2006-04-25 12:00:58Z edwin $ */ @@ -97,7 +97,7 @@ CYCLES_STATS_DECLARE(stacktrace_overhead ,100,1) CYCLES_STATS_DECLARE(stacktrace_fillInStackTrace,40,5000) CYCLES_STATS_DECLARE(stacktrace_getClassContext ,40,5000) CYCLES_STATS_DECLARE(stacktrace_getCurrentClass ,40,5000) -CYCLES_STATS_DECLARE(stacktrace_getStack ,40,5000) +CYCLES_STATS_DECLARE(stacktrace_getStack ,40,10000) /* stacktrace_create_stackframeinfo ******************************************** diff --git a/src/vm/options.c b/src/vm/options.c index 970d8a490..273b736e9 100644 --- a/src/vm/options.c +++ b/src/vm/options.c @@ -28,7 +28,7 @@ Changes: - $Id: options.c 4796 2006-04-20 18:04:18Z edwin $ + $Id: options.c 4833 2006-04-25 12:00:58Z edwin $ */ @@ -76,8 +76,6 @@ bool opt_verbosejni = false; bool opt_verbosecall = false; /* trace all method invocation */ bool opt_verboseexception = false; -bool opt_liberalutf = false; /* Don't check overlong UTF-8 sequences */ - bool showmethods = false; bool showconstantpool = false; bool showutf = false; @@ -113,7 +111,9 @@ bool getloadingtime = false; /* to measure the runtime */ bool getcompilingtime = false; /* compute compile time */ bool opt_stat = false; +#if defined(ENABLE_VERIFIER) bool opt_verify = true; /* true if classfiles should be verified */ +#endif bool opt_eager = false; bool opt_prof = false; diff --git a/src/vm/options.h b/src/vm/options.h index 0700f9783..f9782403c 100644 --- a/src/vm/options.h +++ b/src/vm/options.h @@ -28,7 +28,7 @@ Changes: - $Id: options.h 4796 2006-04-20 18:04:18Z edwin $ + $Id: options.h 4833 2006-04-25 12:00:58Z edwin $ */ @@ -87,8 +87,6 @@ extern bool opt_verbosejni; extern bool opt_verbosecall; extern bool opt_verboseexception; -extern bool opt_liberalutf; /* Don't check overlong UTF-8 sequences */ - extern bool showmethods; extern bool showconstantpool; extern bool showutf; @@ -124,7 +122,9 @@ extern bool getloadingtime; extern bool getcompilingtime; extern bool opt_stat; +#if defined(ENABLE_VERIFIER) extern bool opt_verify; +#endif extern bool opt_eager; extern bool opt_prof; diff --git a/src/vm/vm.c b/src/vm/vm.c index db9e52555..34c0ffac2 100644 --- a/src/vm/vm.c +++ b/src/vm/vm.c @@ -166,8 +166,9 @@ enum { OPT_ALL, OPT_VERBOSETC, +#if defined(ENABLE_VERIFIER) OPT_NOVERIFY, - OPT_LIBERALUTF, +#endif OPT_EAGER, /* optimization options */ @@ -234,8 +235,9 @@ opt_struct opts[] = { { "X", false, OPT_X }, { "noasyncgc", false, OPT_IGNORE }, +#if defined(ENABLE_VERIFIER) { "noverify", false, OPT_NOVERIFY }, - { "liberalutf", false, OPT_LIBERALUTF }, +#endif { "v", false, OPT_VERBOSE1 }, { "verbose:", true, OPT_VERBOSE }, @@ -359,8 +361,9 @@ void usage(void) #if defined(__ALPHA__) puts(" -noieee don't use ieee compliant arithmetic"); #endif +#if defined(ENABLE_VERIFIER) puts(" -noverify don't verify classfiles"); - puts(" -liberalutf don't warn about overlong UTF-8 sequences"); +#endif puts(" -softnull use software nullpointer check"); puts(" -time measure the runtime"); #if defined(ENABLE_STATISTICS) @@ -791,13 +794,11 @@ bool vm_create(JavaVMInitArgs *vm_args) opt_noieee = true; break; +#if defined(ENABLE_VERIFIER) case OPT_NOVERIFY: opt_verify = false; break; - - case OPT_LIBERALUTF: - opt_liberalutf = true; - break; +#endif case OPT_SOFTNULL: checknull = true; -- 2.25.1