Thread: [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:21:59
|
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 diff --git a/src/classlib/openjdk/classlib.h b/src/classlib/openjdk/classlib.h index ca671c4..ed3cfd3 100644 --- a/src/classlib/openjdk/classlib.h +++ b/src/classlib/openjdk/classlib.h @@ -114,8 +114,15 @@ extern char *classlibDefaultJavaHome(); /* Access */ +#ifdef JSR292 extern int classlibInitialiseAccess(); extern int classlibAccessCheck(Class *class1, Class *class2); +#else +#define classlibInitialiseAccess() \ + /* NOTHING TO DO */ TRUE + +#define classlibAccessCheck(class1, class2) FALSE +#endif /* Natives */ -- View this message in context: http://old.nabble.com/Error-initialising-VM-%28initialiseAccess%29---with-java-runtime-library%3Dopenjdk7-tp35289028p35289028.html Sent from the JamVM mailing list archive at Nabble.com. |
From: Xerxes R. <xe...@za...> - 2013-04-13 00:32:11
|
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. Cheers Xerxes diff --git a/src/classlib/openjdk/classlib.h b/src/classlib/openjdk/classlib.h index ca671c4..10e930b 100644 --- a/src/classlib/openjdk/classlib.h +++ b/src/classlib/openjdk/classlib.h @@ -114,7 +114,13 @@ extern char *classlibDefaultJavaHome(); /* Access */ +#ifdef JSR292 extern int classlibInitialiseAccess(); +#else +#define classlibInitialiseAccess() \ + /* NOTHING TO DO */ TRUE + +#endif extern int classlibAccessCheck(Class *class1, Class *class2); /* Natives */ -- View this message in context: http://old.nabble.com/Error-initialising-VM-%28initialiseAccess%29---with-java-runtime-library%3Dopenjdk7-tp35289028p35289043.html Sent from the JamVM mailing list archive at Nabble.com. |
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. |
From: Xerxes R. <xe...@za...> - 2013-04-15 11:47:32
|
Xerxes Rånby wrote: > > > 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 > Thank you Robert I can verify that this issue is now fixed: http://git.berlios.de/cgi-bin/cgit.cgi/jamvm/commit/?id=b37d7947af4a30da275ec8edb6a730850a51a5d9 - JSR 292: make access.c conditional on JSR292 macro -- View this message in context: http://old.nabble.com/Error-initialising-VM-%28initialiseAccess%29---with-java-runtime-library%3Dopenjdk7-tp35289028p35296144.html Sent from the JamVM mailing list archive at Nabble.com. |