harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Evgueni Brevnov" <evgueni.brev...@gmail.com>
Subject [drlvm] What should return org.apache...VMStack.getClassLoader(j.l.Class) method for native frames?
Date Fri, 22 Sep 2006 10:49:53 GMT
HI All,

While implementing Invocation API for DRLVM I ran into interesting
situation. Assume we are in native code and just created VM by
JNI_CreateJavaVM(). The next step is to call Class.forName(name)
method through JNI. If you look at forName method implementation you
will find it calls org.apache....VMStack.getCallerClass(0). Which
means it wants to get the caller's class of the forName() method. In
that case we get null since forName was called from native code. Later
Class.forName(name) method passes obtained class to
org.apache...VMStack.getClassLoader(j.l.Class) method to get caller's
class loader.

The question is: What class loader should be returned in that case?

I think we need to return current thread's context class loader in
that case. So it will be bootstrap class loader for any thread
attached through AttachCurrentThread except main thread which has
system class loader as its context class loader.

Any ideas?

Evgueni

---------------------------------------------------------------------
Terms of use : http://incubator.apache.org/harmony/mailing.html
To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
For additional commands, e-mail: harmony-dev-help@incubator.apache.org


Mime
View raw message