natVMSecurityManager.cc (getClassContext): Add new arg: klass.
2005-03-17 Andrew Haley <aph@redhat.com> * java/lang/natVMSecurityManager.cc (getClassContext): Add new arg: klass. Pass klass to _Jv_StackTrace::GetClassContext(). * java/lang/ClassLoader.java (getParent): Pass class to VMSecurityManager.getClassContext() (getSystemClassLoader): Likewise. * java/lang/Package.java (getPackage): Likewise. (getPackages): Likewise. * java/lang/SecurityManager.java (getClassContext): Likewise. (currentClassLoader): Likewise. * java/lang/VMSecurityManager.java: (getClassContext): Likewise. (currentClassLoader) Add new arg: caller. Pass caller to VMSecurityManager.getClassContext. * stacktrace.cc (GetClassContext): Correct calculation of jframe_count. * boehm.cc (_Jv_MarkObj): (_Jv_MarkObj): Mark im->source_file_name. From-SVN: r96803
This commit is contained in:
parent
21e01bf10d
commit
e5a8980bb9
8 changed files with 45 additions and 22 deletions
|
@ -43,19 +43,19 @@ class VMSecurityManager
|
|||
** @return an array containing all the methods on classes
|
||||
** on the Java execution stack.
|
||||
**/
|
||||
static native Class[] getClassContext();
|
||||
static native Class[] getClassContext(Class caller);
|
||||
|
||||
/** Get the current ClassLoader--the one nearest to the
|
||||
** top of the stack.
|
||||
** @return the current ClassLoader.
|
||||
**/
|
||||
static ClassLoader currentClassLoader()
|
||||
static ClassLoader currentClassLoader(Class caller)
|
||||
{
|
||||
// The docs above are wrong. See the online docs.
|
||||
// FIXME this implementation is a bit wrong too -- the docs say we
|
||||
// must also consider ancestors of the system class loader.
|
||||
ClassLoader systemClassLoader = VMClassLoader.getSystemClassLoader();
|
||||
Class[] classStack = getClassContext ();
|
||||
Class[] classStack = getClassContext (caller);
|
||||
for (int i = 0; i < classStack.length; i++)
|
||||
{
|
||||
ClassLoader loader = classStack[i].getClassLoader();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue