diff options
author | krab <krab@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-08-18 14:16:42 +0000 |
---|---|---|
committer | krab <krab@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-08-18 14:16:42 +0000 |
commit | 009022b277bdd8bc12a66677811adee7135ec042 (patch) | |
tree | 3bcaf8f2877d654d67d3e2cc982a85a71299ca35 /libjava/interpret.cc | |
parent | 71a3455af48e575974a233c4174aeb50c835a469 (diff) | |
download | ppe42-gcc-009022b277bdd8bc12a66677811adee7135ec042.tar.gz ppe42-gcc-009022b277bdd8bc12a66677811adee7135ec042.zip |
* java/lang/natClassLoader.cc (_Jv_PrepareCompiledClass): Renamed
from _Jv_InternClassStrings.
* prims.cc (_Jv_RunMain): New function.
(JvRunMain): Remove gij-support.
* gij.cc (main): Use _Jv_RunMain.
* java/util/zip/ZipFile.java: Call readDirectory in constructor.
* interpret.cc (PUSHA, PUSHI, PUSHF, PUSHL, PUSHD): Don't store
argument in temp variable.
(continue1): For all op_x2y insns, use temp variable for
intermediate value. Also remove some comments.
* java/lang/natClass.cc (newInstance): Call _Jv_InitClass.
(forName): Don't call _Jv_InitClass.
* java/lang/Class.java (getResource,getResourceAsStream): Implement.
* java/util/zip/ZipEntry.java (ZipEntry(ZipEntry)): New construcor.
* java/util/jar/JarInputStream.java: New file.
* java/util/jar/JarEntry.java: New file.
* java/util/jar/JarFile.java: New file.
* java/net/URLClassLoader.java: New file.
* java/net/JarURLConnection.java: New file.
* gnu/gcj/protocol/jar/Handler.java: New file.
* gnu/gcj/protocol/jar/Connection.java: New file.
* java/security/SecureClassLoader.java: New file.
* java/lang/ClassLoader.java (parent): New variable.
(ClassLoader (ClassLoader)): new constructor.
(findClass): New method.
(loadClass): Add default 1.2 implementation.
(getSystemResourceAsBytes, getResourceAsBytes): Removed.
(readfully): Removed.
* gnu/gcj/runtime/VMClassLoader.java: Moved from java/lang.
(findSystemClass): New method.
(VMClassLoader): Constructor rewritten.
(init): New method.
All other methods removed.
* java/lang/natClassLoader.cc: Change use of java::lang::VMClassLoader
to gnu::gcj::runtime::VMClassLoader.
(_Jv_InternClassStrings): Use _Jv_ResolvePoolEntry. Also handle
class entries.
(VMClassLoader::findSystemClass): renamed from findBootClass.
* Makefile.am: Add new files.
(FirstThread.h, ThreadGroup.h): Add _Jv_Main friend.
* Makefile.in: Rebuilt.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@28748 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libjava/interpret.cc')
-rw-r--r-- | libjava/interpret.cc | 71 |
1 files changed, 30 insertions, 41 deletions
diff --git a/libjava/interpret.cc b/libjava/interpret.cc index 6ca6f0da606..2ecaf03de9e 100644 --- a/libjava/interpret.cc +++ b/libjava/interpret.cc @@ -109,22 +109,25 @@ static inline void dupx (_Jv_word *&sp, int n, int x) }; -#define PUSHA(V) \ - ({ jobject __v=(V); (sp++)->o = __v; }) -#define PUSHI(V) \ - ({ jint __v=(V); (sp++)->i = __v; }) -#define PUSHF(V) \ - ({ jfloat __v=(V); (sp++)->f = __v; }) -#define PUSHL(V) \ - ({ jlong __v=(V); _Jv_storeLong(sp,__v); sp+=2; }) -#define PUSHD(V) \ - ({ jdouble __v=(V); _Jv_storeDouble(sp,__v); sp+=2; }) +#define PUSHA(V) (sp++)->o = (V) +#define PUSHI(V) (sp++)->i = (V) +#define PUSHF(V) (sp++)->f = (V) +#define PUSHL(V) ({ _Jv_word2 w2; w2.l=(V); \ + (sp++)->ia[0] = w2.ia[0]; \ + (sp++)->ia[0] = w2.ia[1]; }) +#define PUSHD(V) ({ _Jv_word2 w2; w2.d=(V); \ + (sp++)->ia[0] = w2.ia[0]; \ + (sp++)->ia[0] = w2.ia[1]; }) #define POPA() ((--sp)->o) #define POPI() ((jint) (--sp)->i) // cast since it may be promoted #define POPF() ((jfloat) (--sp)->f) -#define POPL() ({ sp-=2; _Jv_loadLong (sp); }) -#define POPD() ({ sp-=2; _Jv_loadDouble (sp); }) +#define POPL() ({ _Jv_word2 w2; \ + w2.ia[1] = (--sp)->ia[0]; \ + w2.ia[0] = (--sp)->ia[0]; w2.l; }) +#define POPD() ({ _Jv_word2 w2; \ + w2.ia[1] = (--sp)->ia[0]; \ + w2.ia[0] = (--sp)->ia[0]; w2.d; }) #define LOADA(I) (sp++)->o = locals[I].o #define LOADI(I) (sp++)->i = locals[I].i @@ -456,17 +459,6 @@ dump_time () void _Jv_InterpMethod::continue1 (_Jv_InterpMethodInvocation *inv) { - /* for some reason, which I do not understand, the compiler on x86 - * allocates almost 4k stack space for this function! Even though - * there are many local variables, they are all nicely contained - * within a block scope, except for the few declared right below - * here. What's going on?? It could well be, that there in fact is - * on the order of 1000 local variables, including all those inlined - * and expanded from macros... Compiling with -O0, it allocates a - * "modest" 300 bytes of stack space. Among all those options of - * gcc, why isn't there a -fpack-stack, allowing reuse of stack - * locations? */ - _Jv_word *sp = inv->sp; unsigned char *pc = inv->pc; _Jv_word *locals = inv->local_base (); @@ -542,9 +534,6 @@ void _Jv_InterpMethod::continue1 (_Jv_InterpMethodInvocation *inv) #endif opcode = *pc++; - /* we special-case the single opcode aload_0 -- it makes - up 10% of the time spent in the main loop. */ - switch (opcode) { case op_aload_0: // 0x2a @@ -1359,63 +1348,63 @@ void _Jv_InterpMethod::continue1 (_Jv_InterpMethodInvocation *inv) goto next_insn; case op_i2l: - PUSHL ((jlong)POPI ()); + {jlong value = POPI(); PUSHL (value);} goto next_insn; case op_i2f: - PUSHF ((jfloat)POPI ()); + {jfloat value = POPI(); PUSHF (value);} goto next_insn; case op_i2d: - PUSHD ((jdouble)POPI ()); + {jdouble value = POPI(); PUSHD (value);} goto next_insn; case op_l2i: - PUSHI ((jint)POPL ()); + {jint value = POPL(); PUSHI (value);} goto next_insn; case op_l2f: - PUSHF ((jfloat)POPL ()); + {jfloat value = POPL(); PUSHF (value);} goto next_insn; case op_l2d: - PUSHD ((jdouble)POPL ()); + {jdouble value = POPL(); PUSHD (value);} goto next_insn; case op_f2i: - PUSHI ((jint)POPF ()); + { jint value = (jint)POPF (); PUSHI(value); } goto next_insn; case op_f2l: - PUSHL ((jlong)POPF ()); + { jlong value = (jlong)POPF (); PUSHL(value); } goto next_insn; case op_f2d: - PUSHD ((jdouble)POPF ()); + { jdouble value = POPF (); PUSHD(value); } goto next_insn; case op_d2i: - PUSHI ((jint)POPD ()); + { jint value = (jint)POPD (); PUSHI(value); } goto next_insn; case op_d2l: - PUSHL ((jlong)POPD ()); + { jlong value = (jlong)POPD (); PUSHL(value); } goto next_insn; case op_d2f: - PUSHF ((jfloat)POPD ()); + { jfloat value = POPD (); PUSHF(value); } goto next_insn; case op_i2b: - PUSHI ((jbyte)POPI ()); + { jbyte value = POPI (); PUSHI(value); } goto next_insn; case op_i2c: - PUSHI ((jchar)POPI ()); + { jchar value = POPI (); PUSHI(value); } goto next_insn; case op_i2s: - PUSHI ((jshort)POPI ()); + { jshort value = POPI (); PUSHI(value); } goto next_insn; case op_lcmp: |