From dd5d628184dfb8c460ad01a480a366d735ba6f4f Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 3 May 2000 18:09:27 +0000 Subject: [PATCH] expr.c (build_java_jsr): Use emit_jump, not expand_goto. * expr.c (build_java_jsr): Use emit_jump, not expand_goto. * javaop.h (WORD_TO_INT): New function. (IMMEDIATE_s4): Use WORD_TO_INT. * jcf.h (JPOOL_INT): Ditto. * gjavah.c (decode_signature_piece): Don't treat `$' as namespace separator. From-SVN: r33636 --- gcc/java/ChangeLog | 18 +++++++++++++++++- gcc/java/expr.c | 2 +- gcc/java/gjavah.c | 3 +-- gcc/java/javaop.h | 12 +++++++++++- gcc/java/jcf.h | 2 +- 5 files changed, 31 insertions(+), 6 deletions(-) diff --git a/gcc/java/ChangeLog b/gcc/java/ChangeLog index e3e3a634e325..df283c6693ac 100644 --- a/gcc/java/ChangeLog +++ b/gcc/java/ChangeLog @@ -1,4 +1,20 @@ -2000-04-19 Tom Tromey <tromey@cygnus.com> +2000-05-03 Andrew Haley + + * expr.c (build_java_jsr): Use emit_jump, not expand_goto. + + * javaop.h (WORD_TO_INT): New function. + (IMMEDIATE_s4): Use WORD_TO_INT. + * jcf.h (JPOOL_INT): Ditto. + + * gjavah.c (decode_signature_piece): Don't treat `$' as namespace + separator. + +2000-05-02 Tom Tromey + + * expr.c (build_jni_stub): Cache the result of + _Jv_LookupJNIMethod. + +2000-04-19 Tom Tromey * class.c (add_method_1): Set both DECL_EXTERNAL and METHOD_NATIVE on native function. diff --git a/gcc/java/expr.c b/gcc/java/expr.c index 37358e53a3aa..7a92a8c66c66 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -560,7 +560,7 @@ build_java_jsr (where, ret) tree ret_label = fold (build1 (ADDR_EXPR, return_address_type_node, ret)); push_value (ret_label); flush_quick_stack (); - expand_goto (where); + emit_jump (label_rtx (where)); expand_label (ret); } diff --git a/gcc/java/gjavah.c b/gcc/java/gjavah.c index 4c6d81de5434..3c04ebf4492a 100644 --- a/gcc/java/gjavah.c +++ b/gcc/java/gjavah.c @@ -990,8 +990,7 @@ decode_signature_piece (stream, signature, limit, need_space) while (*signature && *signature != ';') { int ch = UTF8_GET (signature, limit); - /* `$' is the separator for an inner class. */ - if (ch == '/' || ch == '$') + if (ch == '/') fputs ("::", stream); else jcf_print_char (stream, ch); diff --git a/gcc/java/javaop.h b/gcc/java/javaop.h index c603be1d3e0f..d8418f71a2af 100644 --- a/gcc/java/javaop.h +++ b/gcc/java/javaop.h @@ -98,7 +98,7 @@ union Word { #endif #ifndef IMMEDIATE_s4 #define IMMEDIATE_s4 (PC+=4, CHECK_PC_IN_RANGE(PC), \ - ((jint)((BCODE[PC-4] << 24) | (BCODE[PC-3] << 16) \ + (WORD_TO_INT((BCODE[PC-4] << 24) | (BCODE[PC-3] << 16) \ | (BCODE[PC-2] << 8) | (BCODE[PC-1])))) #endif @@ -109,6 +109,16 @@ WORD_TO_FLOAT(jword w) return wu.f; } +/* Sign extend w. */ +static inline jint +WORD_TO_INT(jword w) +{ + jint n = w; + n ^= (jint)1 << 31; + n -= (jint)1 << 31; + return n; +} + static inline jlong WORDS_TO_LONG(jword hi, jword lo) { diff --git a/gcc/java/jcf.h b/gcc/java/jcf.h index d909b2cf6a9e..9bd8a7cd0c02 100644 --- a/gcc/java/jcf.h +++ b/gcc/java/jcf.h @@ -131,7 +131,7 @@ typedef struct JCF { #define JPOOL_UTF_DATA(JCF, INDEX) \ ((JCF)->buffer+JPOOL_UINT(JCF, INDEX)+2) #endif -#define JPOOL_INT(JCF, INDEX) ((jint) JPOOL_UINT (JCF, INDEX)) +#define JPOOL_INT(JCF, INDEX) (WORD_TO_INT(JPOOL_UINT (JCF, INDEX))) #define JPOOL_FLOAT(JCF, INDEX) WORD_TO_FLOAT (JPOOL_UINT (JCF, INDEX)) #define CPOOL_INDEX_IN_RANGE(CPOOL, INDEX) \ -- 2.43.5