Re: [Jamvm-general] Error initialising VM (initialiseAccess) --with-java-runtime-library=openjdk7
Brought to you by:
rlougher
From: Xerxes R. <xe...@za...> - 2013-04-13 00:58:18
|
Xerxes Rånby wrote: > > > Xerxes Rånby wrote: >> >> The attached patch fix Error initialising VM (initialiseAccess) >> when using JamVM in combination with OpenJDK 6 or 7 >> that do not provide JSR 292 Lambda access >> > > I tealised i made a mistake with the first patch.. > posting a fixed patch below that still use the openjdk > classlibAccessCheck. > Third attempt... I only want to put the JSR292 ifdef's around magic_lambda while keeping magic_accessor. How to place the ifdefs in access.c to make it still look good is questionable. At least I believe its functionally correct now for OpenJDK 6 and 7 users. Xerxes diff --git a/src/classlib/openjdk/access.c b/src/classlib/openjdk/access.c index 1326efe..f49784e 100644 --- a/src/classlib/openjdk/access.c +++ b/src/classlib/openjdk/access.c @@ -21,24 +21,36 @@ #include "jam.h" #include "symbol.h" +#ifdef JSR292 static Class *magic_lambda; +#endif static Class *magic_accessor; int classlibInitialiseAccess() { magic_accessor = findSystemClass0(SYMBOL(sun_reflect_MagicAccessorImpl)); +#ifdef JSR292 magic_lambda = findSystemClass0(SYMBOL(java_lang_invoke_MagicLambdaImpl)); if(magic_accessor == NULL || magic_lambda == NULL) +#else + if(magic_accessor == NULL) +#endif return FALSE; +#ifdef JSR292 registerStaticClassRef(&magic_lambda); +#endif registerStaticClassRef(&magic_accessor); return TRUE; } int classlibAccessCheck(Class *class, Class *referrer) { +#ifdef JSR292 return isSubClassOf(magic_accessor, referrer) || isSubClassOf(magic_lambda, referrer); +#else + return isSubClassOf(magic_accessor, referrer); +#endif } -- View this message in context: http://old.nabble.com/Error-initialising-VM-%28initialiseAccess%29---with-java-runtime-library%3Dopenjdk7-tp35289028p35289079.html Sent from the JamVM mailing list archive at Nabble.com. |