1 /* nat/SecurityManager.c - java/lang/SecurityManager
3 Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003
4 R. Grafl, A. Krall, C. Kruegel, C. Oates, R. Obermaisser,
5 M. Probst, S. Ring, E. Steiner, C. Thalinger, D. Thuernbeck,
6 P. Tomsich, J. Wenninger
8 This file is part of CACAO.
10 This program is free software; you can redistribute it and/or
11 modify it under the terms of the GNU General Public License as
12 published by the Free Software Foundation; either version 2, or (at
13 your option) any later version.
15 This program is distributed in the hope that it will be useful, but
16 WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with this program; if not, write to the Free Software
22 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
25 Contact: cacao@complang.tuwien.ac.at
27 Authors: Roman Obermaiser
29 Changes: Joseph Wenninger
31 $Id: VMSecurityManager.c 977 2004-03-25 18:37:52Z twisti $
40 #include "toolbox/loging.h"
41 #include "java_lang_ClassLoader.h"
46 * Class: java/lang/SecurityManager
47 * Method: currentClassLoader
48 * Signature: ()Ljava/lang/ClassLoader;
50 JNIEXPORT java_lang_ClassLoader* JNICALL Java_java_lang_VMSecurityManager_currentClassLoader(JNIEnv *env, jclass clazz)
52 log_text("Java_java_lang_VMSecurityManager_currentClassLoader");
53 init_systemclassloader();
55 return SystemClassLoader;
61 /*THIS IS IN ASMPART NOW*/
63 * Class: java/lang/SecurityManager
64 * Method: getClassContext
65 * Signature: ()[Ljava/lang/Class;
67 JNIEXPORT java_objectarray* JNICALL Java_java_lang_VMSecurityManager_getClassContext(JNIEnv *env, jclass clazz)
69 log_text("Java_java_lang_VMSecurityManager_getClassContext called");
71 /* XXX should use vftbl directly */
72 return (java_objectarray *) builtin_newarray(0, class_array_of(class_java_lang_Class)->vftbl);
76 java_objectarray* temporaryGetClassContextHelper(methodinfo *m) {
81 if (!(m->name)) log_text("method or block has no name");
85 if (!(m->class)) log_text("method or block has no class");
87 utf_display(m->class->name);
90 log_text("temporaryGetClassContextHelper called");
91 if (adr==0) log_text("NO REAL METHOD");
94 struct methodinfo *m=(struct methodinfo*)(*(adr-1));
95 if (!(m->name)) log_text("method or block has no name");
98 if (!(m->class)) log_text("method or block has no class");
100 utf_display(m->class->name);
101 printf("\nFrame size:%ld\n",(long)(*(adr-2)));
103 printf("saveint:%ld\n",(long)(*adr));
104 printf("saveflt:%ld\n",(long)(*(adr-1)));
106 log_text("temporaryGetClassContextHelper leaving");
107 return (java_objectarray *) builtin_newarray(0, class_array_of(class_java_lang_Class)->vftbl);
111 java_objectarray* temporaryGetClassContextHelper2() {
112 log_text("temporaryGetClassContextHelper2 called");
113 return (java_objectarray *) builtin_newarray(0, class_array_of(class_java_lang_Class)->vftbl);
117 * These are local overrides for various environment variables in Emacs.
118 * Please do not remove this and leave it at the end of the file, where
119 * Emacs will automagically detect them.
120 * ---------------------------------------------------------------------
123 * indent-tabs-mode: t