1 /* src/native/vm/gnu/java_security_VMAccessController.c
3 Copyright (C) 1996-2005, 2006, 2007 R. Grafl, A. Krall, C. Kruegel,
4 C. Oates, R. Obermaisser, M. Platter, M. Probst, S. Ring,
5 E. Steiner, C. Thalinger, D. Thuernbeck, P. Tomsich, C. Ullrich,
6 J. Wenninger, Institut f. Computersprachen - TU Wien
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., 51 Franklin Street, Fifth Floor, Boston, MA
25 $Id: java_security_VMAccessController.c 7246 2007-01-29 18:49:05Z twisti $
33 #include "native/jni.h"
35 #include "vm/builtin.h"
37 #include "vm/jit/stacktrace.h"
39 #include "vmcore/class.h"
40 #include "vmcore/options.h"
44 * Class: java/security/VMAccessController
46 * Signature: ()[[Ljava/lang/Object;
48 JNIEXPORT java_objectarray* JNICALL Java_java_security_VMAccessController_getStack(JNIEnv *env, jclass clazz) {
49 #if defined(__ALPHA__) || defined(__ARM__) || defined(__I386__) || defined(__MIPS__) || defined(__POWERPC__) || defined (__X86_64__)
50 /* these JITs support stacktraces */
52 return stacktrace_getStack();
55 # if defined(ENABLE_INTRP)
56 /* the interpreter supports stacktraces, even if the JIT does not */
59 return stacktrace_getStack();
64 java_objectarray *result;
65 java_objectarray *classes;
66 java_objectarray *methodnames;
68 if (!(result = builtin_anewarray(2, arrayclass_java_lang_Object)))
71 if (!(classes = builtin_anewarray(0, class_java_lang_Class)))
74 if (!(methodnames = builtin_anewarray(0, class_java_lang_String)))
77 result->data[0] = (java_objectheader *) classes;
78 result->data[1] = (java_objectheader *) methodnames;
87 * These are local overrides for various environment variables in Emacs.
88 * Please do not remove this and leave it at the end of the file, where
89 * Emacs will automagically detect them.
90 * ---------------------------------------------------------------------