diff options
author | Tom Tromey <tromey@cygnus.com> | 2000-05-02 20:32:31 +0000 |
---|---|---|
committer | Tom Tromey <tromey@gcc.gnu.org> | 2000-05-02 20:32:31 +0000 |
commit | 7145d9fe6bb782d384cab328c028507b4f8f435a (patch) | |
tree | f6a3da973a9c08d0deefae724ed229eadde9cd1c /gcc/java/jcf-parse.c | |
parent | 09fa07054c77f1b022cbd5f676c57df6037b2dd0 (diff) | |
download | gcc-7145d9fe6bb782d384cab328c028507b4f8f435a.zip gcc-7145d9fe6bb782d384cab328c028507b4f8f435a.tar.gz gcc-7145d9fe6bb782d384cab328c028507b4f8f435a.tar.bz2 |
class.c (add_method_1): Set both DECL_EXTERNAL and METHOD_NATIVE on native function.
* class.c (add_method_1): Set both DECL_EXTERNAL and METHOD_NATIVE
on native function.
* jcf-parse.c (parse_class_file): Call build_jni_stub for native
JNI methods.
* expr.c (build_jni_stub): New function.
* lang-specs.h: -fjni and -femit-class-file are incompatible.
* parse.c: Rebuilt.
* parse.y (java_complete_expand_methods): Expand a native method
and call build_jni_stub if -fjni given.
* lang-options.h: Document -fjni.
* lang.c (flag_jni): New global.
(lang_f_options): Added `jni' entry.
* java-tree.h (soft_lookupjnimethod_node,
soft_getjnienvnewframe_node, soft_jnipopsystemframe_node):
Declare.
(flag_jni): Declare.
(build_jni_stub): Declare.
(struct lang_decl): Added `native' flag.
(METHOD_NATIVE): Redefined to use `native' field of lang specific
structure.
* decl.c (soft_lookupjnimethod_node, soft_getjnienvnewframe_node,
soft_jnipopsystemframe_node): New globals.
(init_decl_processing): Set them. _Jv_InitClass only takes one
argument.
* java-tree.def: Put into `C' mode.
From-SVN: r33615
Diffstat (limited to 'gcc/java/jcf-parse.c')
-rw-r--r-- | gcc/java/jcf-parse.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/gcc/java/jcf-parse.c b/gcc/java/jcf-parse.c index 4c3dff7..6d4f246 100644 --- a/gcc/java/jcf-parse.c +++ b/gcc/java/jcf-parse.c @@ -684,9 +684,22 @@ parse_class_file () { JCF *jcf = current_jcf; - if (METHOD_NATIVE (method) || METHOD_ABSTRACT (method)) + if (METHOD_ABSTRACT (method)) continue; + if (METHOD_NATIVE (method)) + { + if (! flag_jni) + continue; + DECL_MAX_LOCALS (method) + = list_length (TYPE_ARG_TYPES (TREE_TYPE (method))); + start_java_method (method); + give_name_to_locals (jcf); + expand_expr_stmt (build_jni_stub (method)); + end_java_method (); + continue; + } + if (DECL_CODE_OFFSET (method) == 0) { error ("missing Code attribute"); |