1 /* src/native/vm/VMAccessController.c - java/security/VMAccessController
3 Copyright (C) 1996-2005, 2006 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 Contact: cacao@cacaojvm.org
27 Authors: Joseph Wenninger
29 Changes: Christian Thalinger
31 $Id: VMAccessController.c 4357 2006-01-22 23:33:38Z twisti $
39 #include "native/jni.h"
40 #include "vm/builtin.h"
42 #include "vm/options.h"
43 #include "vm/jit/stacktrace.h"
47 * Class: java/security/VMAccessController
49 * Signature: ()[[Ljava/lang/Object;
51 JNIEXPORT java_objectarray* JNICALL Java_java_security_VMAccessController_getStack(JNIEnv *env, jclass clazz) {
52 #if defined(__ALPHA__) || defined(__ARM__) || defined(__I386__) || defined(__MIPS__) || defined(__POWERPC__) || defined (__X86_64__)
53 /* these JITs support stacktraces */
55 return cacao_getStackForVMAccessController();
58 # if defined(ENABLE_INTRP)
59 /* the interpreter supports stacktraces, even if the JIT does not */
62 return cacao_getStackForVMAccessController();
67 java_objectarray *result;
68 java_objectarray *classes;
69 java_objectarray *methodnames;
71 if (!(result = builtin_anewarray(2, arrayclass_java_lang_Object)))
74 if (!(classes = builtin_anewarray(0, class_java_lang_Class)))
77 if (!(methodnames = builtin_anewarray(0, class_java_lang_String)))
80 result->data[0] = (java_objectheader *) classes;
81 result->data[1] = (java_objectheader *) methodnames;
90 * These are local overrides for various environment variables in Emacs.
91 * Please do not remove this and leave it at the end of the file, where
92 * Emacs will automagically detect them.
93 * ---------------------------------------------------------------------