diff options
author | (no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-01-17 19:56:11 +0000 |
---|---|---|
committer | (no author) <(no author)@138bc75d-0d04-0410-961f-82ee72b054a4> | 2003-01-17 19:56:11 +0000 |
commit | faa9c366d6b082f64b2d5b94c8b84b098f742770 (patch) | |
tree | d4514c0c0274febfe482a8a12d2a66c567ea31d7 /libjava | |
parent | be879b5f2aed1bdc38b843f195051a7feceb726e (diff) |
This commit was manufactured by cvs2svn to create branch
'tree-ssa-20020619-branch'.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/tree-ssa-20020619-branch@61453 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava')
-rw-r--r-- | libjava/include/x86_64-signal.h | 83 | ||||
-rw-r--r-- | libjava/java/rmi/server/RMIClassLoaderSpi.java | 64 | ||||
-rw-r--r-- | libjava/testsuite/libjava.compile/pr8712.java | 7 | ||||
-rw-r--r-- | libjava/testsuite/libjava.compile/pr8955.java | 13 |
4 files changed, 167 insertions, 0 deletions
diff --git a/libjava/include/x86_64-signal.h b/libjava/include/x86_64-signal.h new file mode 100644 index 00000000000..c368dd31e87 --- /dev/null +++ b/libjava/include/x86_64-signal.h @@ -0,0 +1,83 @@ +// x86_64-signal.h - Catch runtime signals and turn them into exceptions +// on an x86_64 based GNU/Linux system. + +/* Copyright (C) 2003 Free Software Foundation + + This file is part of libgcj. + +This software is copyrighted work licensed under the terms of the +Libgcj License. Please consult the file "LIBGCJ_LICENSE" for +details. */ + + +#ifndef JAVA_SIGNAL_H +#define JAVA_SIGNAL_H 1 + +#include <signal.h> +#include <sys/syscall.h> + +#define HANDLE_SEGV 1 + +#define SIGNAL_HANDLER(_name) \ +static void _Jv_##_name (int, siginfo_t *_sip, void *_p) + +extern "C" +{ + struct kernel_sigaction + { + void (*k_sa_sigaction)(int,siginfo_t *,void *); + unsigned long k_sa_flags; + void (*k_sa_restorer) (void); + sigset_t k_sa_mask; + }; +} + +#define MAKE_THROW_FRAME(_exception) \ +do \ +{ \ + /* Advance the program counter so that it is after the start of the \ + instruction: the x86_64 exception handler expects \ + the PC to point to the instruction after a call. */ \ + struct ucontext *_uc = (struct ucontext *)_p; \ + struct sigcontext *_sc = (struct sigcontext *) &_uc->uc_mcontext; \ + _sc->rip += 2; \ +} \ +while (0) + +#define RESTORE(name, syscall) RESTORE2 (name, syscall) +#define RESTORE2(name, syscall) \ +asm \ + ( \ + ".byte 0 # Yes, this really is necessary\n" \ + ".align 16\n" \ + "__" #name ":\n" \ + " movq $" #syscall ", %rax\n" \ + " syscall\n" \ + ); + +/* The return code for realtime-signals. */ +RESTORE (restore_rt, __NR_rt_sigreturn) +static void restore_rt (void) asm ("__restore_rt"); + +#define INIT_SEGV \ +do \ + { \ + nullp = new java::lang::NullPointerException (); \ + struct kernel_sigaction act; \ + act.k_sa_sigaction = _Jv_catch_segv; \ + sigemptyset (&act.k_sa_mask); \ + act.k_sa_flags = SA_SIGINFO|0x4000000; \ + act.k_sa_restorer = restore_rt; \ + syscall (SYS_rt_sigaction, SIGSEGV, &act, NULL, _NSIG / 8); \ + } \ +while (0) + +/* We use syscall(SYS_rt_sigaction) in INIT_SEGV instead of + * sigaction() because on some systems the pthreads wrappers for + * signal handlers are not compiled with unwind information, so it's + * not possible to unwind through them. This is a problem that will + * go away if all systems ever have pthreads libraries that are + * compiled with unwind info. */ + +#endif /* JAVA_SIGNAL_H */ + diff --git a/libjava/java/rmi/server/RMIClassLoaderSpi.java b/libjava/java/rmi/server/RMIClassLoaderSpi.java new file mode 100644 index 00000000000..2dbb3849c27 --- /dev/null +++ b/libjava/java/rmi/server/RMIClassLoaderSpi.java @@ -0,0 +1,64 @@ +/* RMIClassLoaderSpi.java + Copyright (c) 2002 Free Software Foundation, Inc. + +This file is part of GNU Classpath. + +GNU Classpath is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2, or (at your option) +any later version. + +GNU Classpath is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Classpath; see the file COPYING. If not, write to the +Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +02111-1307 USA. + +Linking this library statically or dynamically with other modules is +making a combined work based on this library. Thus, the terms and +conditions of the GNU General Public License cover the whole +combination. + +As a special exception, the copyright holders of this library give you +permission to link this library with independent modules to produce an +executable, regardless of the license terms of these independent +modules, and to copy and distribute the resulting executable under +terms of your choice, provided that you also meet, for each linked +independent module, the terms and conditions of the license of that +module. An independent module is a module which is not derived from +or based on this library. If you modify this library, you may extend +this exception to your version of the library, but you are not +obligated to do so. If you do not wish to do so, delete this +exception statement from your version. */ + +package java.rmi.server; + +import java.net.MalformedURLException; + +/** + * @author Michael Koch + * @since 1.4 + */ +public abstract class RMIClassLoaderSpi +{ + public RMIClassLoaderSpi() + { + } + + public abstract Class loadClass (String codeBase, String name, + ClassLoader defaultLoader) + throws MalformedURLException, ClassNotFoundException; + + public abstract Class loadProxyClass (String codeBase, String[] interfaces, + ClassLoader defaultLoader) + throws MalformedURLException, ClassNotFoundException; + + public abstract ClassLoader getClassLoader (String codebase) + throws MalformedURLException; + + public abstract String getClassAnnotation (Class cl); +} diff --git a/libjava/testsuite/libjava.compile/pr8712.java b/libjava/testsuite/libjava.compile/pr8712.java new file mode 100644 index 00000000000..7a6eb754d90 --- /dev/null +++ b/libjava/testsuite/libjava.compile/pr8712.java @@ -0,0 +1,7 @@ +public class pr8712 +{ + boolean x(pr8712 a) + { + return (!(a instanceof pr8712)); + } +} diff --git a/libjava/testsuite/libjava.compile/pr8955.java b/libjava/testsuite/libjava.compile/pr8955.java new file mode 100644 index 00000000000..ae78f503f9c --- /dev/null +++ b/libjava/testsuite/libjava.compile/pr8955.java @@ -0,0 +1,13 @@ +public class pr8955 +{ + static final int val = Integer.MIN_VALUE; + void foo() + { + switch(1) { + case val: + break; + case 1: + break; + } + } +} |