Commit c02ebb18 by Zack Weinberg

java-tree.h, [...]: Remove all #if JAVA_USE_HANDLES blocks...

	* java-tree.h, class.c, expr.c, jcf-parse.c, parse.y,
	typeck.c, verify.c: Remove all #if JAVA_USE_HANDLES blocks,
	all mention of CLASS_TO_HANDLE_TYPE or HANDLE_TO_CLASS_TYPE,
	and all now-pointless local variables.  Rename other local
	variables to reflect their not being handles.

	* java-tree.h, jcf-dump.c, jcf-io.c: Remove all
	#if JCF_USE_STDIO blocks.

	* parse.y: Add missing semicolon at end of rule.

From-SVN: r54261
parent d6ee617d
2002-06-04 Zack Weinberg <zack@codesourcery.com>
* java-tree.h, class.c, expr.c, jcf-parse.c, parse.y,
typeck.c, verify.c: Remove all #if JAVA_USE_HANDLES blocks,
all mention of CLASS_TO_HANDLE_TYPE or HANDLE_TO_CLASS_TYPE,
and all now-pointless local variables. Rename other local
variables to reflect their not being handles.
* java-tree.h, jcf-dump.c, jcf-io.c: Remove all
#if JCF_USE_STDIO blocks.
* parse.y: Add missing semicolon at end of rule.
2002-06-03 Geoffrey Keating <geoffk@redhat.com> 2002-06-03 Geoffrey Keating <geoffk@redhat.com>
* check-init.c (attach_initialized_static_class): Delete, unused. * check-init.c (attach_initialized_static_class): Delete, unused.
...@@ -7,7 +20,7 @@ ...@@ -7,7 +20,7 @@
(struct lang_decl_func): Use htab_t, set up for gengtype. (struct lang_decl_func): Use htab_t, set up for gengtype.
(struct init_test_hash_entry): Delete. (struct init_test_hash_entry): Delete.
(struct treetreehash_entry): New. (struct treetreehash_entry): New.
(java_treetreehash_find): New (java_treetreehash_find): New
(java_treetreehash_new): New prototype. (java_treetreehash_new): New prototype.
(java_treetreehash_create): New prototype. (java_treetreehash_create): New prototype.
(java_mark_tree): Delete prototype. (java_mark_tree): Delete prototype.
...@@ -128,7 +141,7 @@ ...@@ -128,7 +141,7 @@
* jcf.h (JCF_USE_SCANDIR): Define. * jcf.h (JCF_USE_SCANDIR): Define.
* parse.y (java_expand_classes): Write the class files in reverse * parse.y (java_expand_classes): Write the class files in reverse
order. order.
2002-05-16 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE> 2002-05-16 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* Make-lang.in: Allow for PWDCMD to override hardcoded pwd. * Make-lang.in: Allow for PWDCMD to override hardcoded pwd.
...@@ -141,7 +154,7 @@ ...@@ -141,7 +154,7 @@
2002-05-08 Mark Mitchell <mark@codesourcery.com> 2002-05-08 Mark Mitchell <mark@codesourcery.com>
* jcf-write.c (write_classfile): Write the file to a * jcf-write.c (write_classfile): Write the file to a
temporary file and then rename it. temporary file and then rename it.
2002-05-07 Tom Tromey <tromey@redhat.com> 2002-05-07 Tom Tromey <tromey@redhat.com>
...@@ -157,7 +170,7 @@ ...@@ -157,7 +170,7 @@
2002-05-07 Andreas Jaeger <aj@suse.de> 2002-05-07 Andreas Jaeger <aj@suse.de>
* parse.y (finish_for_loop): Fix if statement. * parse.y (finish_for_loop): Fix if statement.
2002-05-06 Tom Tromey <tromey@redhat.com> 2002-05-06 Tom Tromey <tromey@redhat.com>
...@@ -216,13 +229,13 @@ ...@@ -216,13 +229,13 @@
2002-04-19 Andrew Haley <aph@redhat.com> 2002-04-19 Andrew Haley <aph@redhat.com>
* jcf-write.c (push_long_const): lo, hi: New variables. * jcf-write.c (push_long_const): lo, hi: New variables.
Use rshift_double to extract the high part of a 64-bit long. Use rshift_double to extract the high part of a 64-bit long.
Use WORD_TO_INT to extract the low part. Use WORD_TO_INT to extract the low part.
* jcf-parse.c (get_constant): CONSTANT_Integer: Use an unsigned * jcf-parse.c (get_constant): CONSTANT_Integer: Use an unsigned
HOST_WIDE_INT for num. Use JPOOL_UINT to get it. HOST_WIDE_INT for num. Use JPOOL_UINT to get it.
CONSTANT_Double: Use JPOOL_UINT to get both halve of a double. CONSTANT_Double: Use JPOOL_UINT to get both halve of a double.
2002-04-18 Neil Booth <neil@daikokuya.demon.co.uk> 2002-04-18 Neil Booth <neil@daikokuya.demon.co.uk>
......
...@@ -282,21 +282,7 @@ make_class () ...@@ -282,21 +282,7 @@ make_class ()
{ {
tree type; tree type;
type = make_node (RECORD_TYPE); type = make_node (RECORD_TYPE);
#ifdef JAVA_USE_HANDLES
tree field1 = build_decl (FIELD_DECL, get_identifier ("obj"),
build_pointer_type (type));
tree field2 = build_decl (FIELD_DECL, get_identifier ("methods"),
methodtable_ptr_type);
tree handle_type = make_node (RECORD_TYPE);
TREE_CHAIN (field1) = field2;
TYPE_FIELDS (handle_type) = field1;
TYPE_BINFO (type) = make_tree_vec (7);
TYPE_BINFO (handle_type) = make_tree_vec (7);
BINFO_HANDLE (TYPE_BINFO (handle_type)) = type;
BINFO_HANDLE (TYPE_BINFO (type)) = handle_type;
#else
TYPE_BINFO (type) = make_tree_vec (6); TYPE_BINFO (type) = make_tree_vec (6);
#endif
MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC (type); MAYBE_CREATE_TYPE_TYPE_LANG_SPECIFIC (type);
return type; return type;
...@@ -353,15 +339,6 @@ push_class (class_type, class_name) ...@@ -353,15 +339,6 @@ push_class (class_type, class_name)
DECL_ARTIFICIAL (decl) = 1; DECL_ARTIFICIAL (decl) = 1;
pushdecl_top_level (decl); pushdecl_top_level (decl);
#ifdef JAVA_USE_HANDLES
{
tree handle_name = identifier_subst (class_name,
"Handle$", '.', '.', "");
tree handle_decl = build_decl (TYPE_DECL, handle_name,
CLASS_TO_HANDLE_TYPE (class_type));
pushdecl (handle_decl);
}
#endif
return decl; return decl;
} }
...@@ -618,12 +595,12 @@ build_java_method_type (fntype, this_class, access_flags) ...@@ -618,12 +595,12 @@ build_java_method_type (fntype, this_class, access_flags)
{ {
if (access_flags & ACC_STATIC) if (access_flags & ACC_STATIC)
return fntype; return fntype;
return build_method_type (CLASS_TO_HANDLE_TYPE (this_class), fntype); return build_method_type (this_class, fntype);
} }
tree tree
add_method_1 (handle_class, access_flags, name, function_type) add_method_1 (this_class, access_flags, name, function_type)
tree handle_class; tree this_class;
int access_flags; int access_flags;
tree name; tree name;
tree function_type; tree function_type;
...@@ -631,10 +608,10 @@ add_method_1 (handle_class, access_flags, name, function_type) ...@@ -631,10 +608,10 @@ add_method_1 (handle_class, access_flags, name, function_type)
tree method_type, fndecl; tree method_type, fndecl;
method_type = build_java_method_type (function_type, method_type = build_java_method_type (function_type,
handle_class, access_flags); this_class, access_flags);
fndecl = build_decl (FUNCTION_DECL, name, method_type); fndecl = build_decl (FUNCTION_DECL, name, method_type);
DECL_CONTEXT (fndecl) = handle_class; DECL_CONTEXT (fndecl) = this_class;
DECL_LANG_SPECIFIC (fndecl) DECL_LANG_SPECIFIC (fndecl)
= (struct lang_decl *) ggc_alloc_cleared (sizeof (struct lang_decl)); = (struct lang_decl *) ggc_alloc_cleared (sizeof (struct lang_decl));
...@@ -653,15 +630,15 @@ add_method_1 (handle_class, access_flags, name, function_type) ...@@ -653,15 +630,15 @@ add_method_1 (handle_class, access_flags, name, function_type)
/* Initialize the static method invocation compound list */ /* Initialize the static method invocation compound list */
DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND (fndecl) = NULL_TREE; DECL_FUNCTION_STATIC_METHOD_INVOCATION_COMPOUND (fndecl) = NULL_TREE;
TREE_CHAIN (fndecl) = TYPE_METHODS (handle_class); TREE_CHAIN (fndecl) = TYPE_METHODS (this_class);
TYPE_METHODS (handle_class) = fndecl; TYPE_METHODS (this_class) = fndecl;
/* Notice that this is a finalizer and update the class type /* Notice that this is a finalizer and update the class type
accordingly. This is used to optimize instance allocation. */ accordingly. This is used to optimize instance allocation. */
if (name == finalize_identifier_node if (name == finalize_identifier_node
&& TREE_TYPE (function_type) == void_type_node && TREE_TYPE (function_type) == void_type_node
&& TREE_VALUE (TYPE_ARG_TYPES (function_type)) == void_type_node) && TREE_VALUE (TYPE_ARG_TYPES (function_type)) == void_type_node)
HAS_FINALIZER_P (handle_class) = 1; HAS_FINALIZER_P (this_class) = 1;
if (access_flags & ACC_PUBLIC) METHOD_PUBLIC (fndecl) = 1; if (access_flags & ACC_PUBLIC) METHOD_PUBLIC (fndecl) = 1;
if (access_flags & ACC_PROTECTED) METHOD_PROTECTED (fndecl) = 1; if (access_flags & ACC_PROTECTED) METHOD_PROTECTED (fndecl) = 1;
...@@ -694,7 +671,6 @@ add_method (this_class, access_flags, name, method_sig) ...@@ -694,7 +671,6 @@ add_method (this_class, access_flags, name, method_sig)
tree name; tree name;
tree method_sig; tree method_sig;
{ {
tree handle_class = CLASS_TO_HANDLE_TYPE (this_class);
tree function_type, fndecl; tree function_type, fndecl;
const unsigned char *sig const unsigned char *sig
= (const unsigned char *) IDENTIFIER_POINTER (method_sig); = (const unsigned char *) IDENTIFIER_POINTER (method_sig);
...@@ -703,7 +679,7 @@ add_method (this_class, access_flags, name, method_sig) ...@@ -703,7 +679,7 @@ add_method (this_class, access_flags, name, method_sig)
fatal_error ("bad method signature"); fatal_error ("bad method signature");
function_type = get_type_from_signature (method_sig); function_type = get_type_from_signature (method_sig);
fndecl = add_method_1 (handle_class, access_flags, name, function_type); fndecl = add_method_1 (this_class, access_flags, name, function_type);
set_java_signature (TREE_TYPE (fndecl), method_sig); set_java_signature (TREE_TYPE (fndecl), method_sig);
return fndecl; return fndecl;
} }
...@@ -1525,7 +1501,7 @@ make_class_data (type) ...@@ -1525,7 +1501,7 @@ make_class_data (type)
fields_decl = NULL_TREE; fields_decl = NULL_TREE;
/* Build Method array. */ /* Build Method array. */
for (method = TYPE_METHODS (CLASS_TO_HANDLE_TYPE (type)); for (method = TYPE_METHODS (type);
method != NULL_TREE; method = TREE_CHAIN (method)) method != NULL_TREE; method = TREE_CHAIN (method))
{ {
tree init; tree init;
...@@ -1707,7 +1683,7 @@ void ...@@ -1707,7 +1683,7 @@ void
finish_class () finish_class ()
{ {
tree method; tree method;
tree type_methods = TYPE_METHODS (CLASS_TO_HANDLE_TYPE (current_class)); tree type_methods = TYPE_METHODS (current_class);
int saw_native_method = 0; int saw_native_method = 0;
/* Find out if we have any native methods. We use this information /* Find out if we have any native methods. We use this information
...@@ -2013,13 +1989,12 @@ layout_class_methods (this_class) ...@@ -2013,13 +1989,12 @@ layout_class_methods (this_class)
tree this_class; tree this_class;
{ {
tree method_decl, dtable_count; tree method_decl, dtable_count;
tree super_class, handle_type; tree super_class;
if (TYPE_NVIRTUALS (this_class)) if (TYPE_NVIRTUALS (this_class))
return; return;
super_class = CLASSTYPE_SUPER (this_class); super_class = CLASSTYPE_SUPER (this_class);
handle_type = CLASS_TO_HANDLE_TYPE (this_class);
if (super_class) if (super_class)
{ {
...@@ -2031,18 +2006,14 @@ layout_class_methods (this_class) ...@@ -2031,18 +2006,14 @@ layout_class_methods (this_class)
else else
dtable_count = integer_zero_node; dtable_count = integer_zero_node;
TYPE_METHODS (handle_type) = nreverse (TYPE_METHODS (handle_type)); TYPE_METHODS (this_class) = nreverse (TYPE_METHODS (this_class));
for (method_decl = TYPE_METHODS (handle_type); for (method_decl = TYPE_METHODS (this_class);
method_decl; method_decl = TREE_CHAIN (method_decl)) method_decl; method_decl = TREE_CHAIN (method_decl))
dtable_count = layout_class_method (this_class, super_class, dtable_count = layout_class_method (this_class, super_class,
method_decl, dtable_count); method_decl, dtable_count);
TYPE_NVIRTUALS (this_class) = dtable_count; TYPE_NVIRTUALS (this_class) = dtable_count;
#ifdef JAVA_USE_HANDLES
layout_type (handle_type);
#endif
} }
/* Return 0 if NAME is equal to STR, -1 if STR is "less" than NAME, /* Return 0 if NAME is equal to STR, -1 if STR is "less" than NAME,
......
...@@ -198,22 +198,6 @@ java_truthvalue_conversion (expr) ...@@ -198,22 +198,6 @@ java_truthvalue_conversion (expr)
} }
} }
#ifdef JAVA_USE_HANDLES
/* Given a pointer to a handle, get a pointer to an object. */
tree
unhand_expr (expr)
tree expr;
{
tree field, handle_type;
expr = build1 (INDIRECT_REF, TREE_TYPE (TREE_TYPE (expr)), expr);
handle_type = TREE_TYPE (expr);
field = TYPE_FIELDS (handle_type);
expr = build (COMPONENT_REF, TREE_TYPE (field), expr, field);
return expr;
}
#endif
/* Save any stack slots that happen to be in the quick_stack into their /* Save any stack slots that happen to be in the quick_stack into their
home virtual register slots. home virtual register slots.
...@@ -404,8 +388,6 @@ can_widen_reference_to (source_type, target_type) ...@@ -404,8 +388,6 @@ can_widen_reference_to (source_type, target_type)
return 1; return 1;
else else
{ {
source_type = HANDLE_TO_CLASS_TYPE (source_type);
target_type = HANDLE_TO_CLASS_TYPE (target_type);
if (TYPE_ARRAY_P (source_type) || TYPE_ARRAY_P (target_type)) if (TYPE_ARRAY_P (source_type) || TYPE_ARRAY_P (target_type))
{ {
HOST_WIDE_INT source_length, target_length; HOST_WIDE_INT source_length, target_length;
...@@ -1571,12 +1553,9 @@ build_field_ref (self_value, self_class, name) ...@@ -1571,12 +1553,9 @@ build_field_ref (self_value, self_class, name)
&& ! (DECL_P (self_value) && ! (DECL_P (self_value)
&& DECL_NAME (self_value) == this_identifier_node)); && DECL_NAME (self_value) == this_identifier_node));
tree base_handle_type = promote_type (base_class); tree base_type = promote_type (base_class);
if (base_handle_type != TREE_TYPE (self_value)) if (base_type != TREE_TYPE (self_value))
self_value = fold (build1 (NOP_EXPR, base_handle_type, self_value)); self_value = fold (build1 (NOP_EXPR, base_type, self_value));
#ifdef JAVA_USE_HANDLES
self_value = unhand_expr (self_value);
#endif
self_value = build_java_indirect_ref (TREE_TYPE (TREE_TYPE (self_value)), self_value = build_java_indirect_ref (TREE_TYPE (TREE_TYPE (self_value)),
self_value, check); self_value, check);
return fold (build (COMPONENT_REF, TREE_TYPE (field_decl), return fold (build (COMPONENT_REF, TREE_TYPE (field_decl),
...@@ -1842,7 +1821,7 @@ build_known_method_ref (method, method_type, self_type, ...@@ -1842,7 +1821,7 @@ build_known_method_ref (method, method_type, self_type,
methods_ident = get_identifier ("methods"); methods_ident = get_identifier ("methods");
ref = build (COMPONENT_REF, method_ptr_type_node, ref, ref = build (COMPONENT_REF, method_ptr_type_node, ref,
lookup_field (&class_type_node, methods_ident)); lookup_field (&class_type_node, methods_ident));
for (meth = TYPE_METHODS (CLASS_TO_HANDLE_TYPE (self_type)); for (meth = TYPE_METHODS (self_type);
; meth = TREE_CHAIN (meth)) ; meth = TREE_CHAIN (meth))
{ {
if (method == meth) if (method == meth)
...@@ -2056,11 +2035,9 @@ expand_invoke (opcode, method_ref_index, nargs) ...@@ -2056,11 +2035,9 @@ expand_invoke (opcode, method_ref_index, nargs)
layout_class_methods (self_type); layout_class_methods (self_type);
if (ID_INIT_P (method_name)) if (ID_INIT_P (method_name))
method = lookup_java_constructor (CLASS_TO_HANDLE_TYPE (self_type), method = lookup_java_constructor (self_type, method_signature);
method_signature);
else else
method = lookup_java_method (CLASS_TO_HANDLE_TYPE (self_type), method = lookup_java_method (self_type, method_name, method_signature);
method_name, method_signature);
if (method == NULL_TREE) if (method == NULL_TREE)
{ {
error ("class '%s' has no method named '%s' matching signature '%s'", error ("class '%s' has no method named '%s' matching signature '%s'",
......
...@@ -1059,22 +1059,6 @@ struct lang_type GTY(()) ...@@ -1059,22 +1059,6 @@ struct lang_type GTY(())
unsigned strictfp:1; /* `strictfp' class. */ unsigned strictfp:1; /* `strictfp' class. */
}; };
#ifdef JAVA_USE_HANDLES
/* TYPE_BINFO_HANDLE points from a handle-class to its corresponding
non-handle-class, and vice verse. */
#define BINFO_HANDLE(NODE) TREE_VEC_ELT ((NODE), 6)
/* Given a RECORD_TYPE for a handle type, return the corresponding class. */
#define HANDLE_TO_CLASS_TYPE(HTYPE) BINFO_HANDLE (TYPE_BINFO (HTYPE))
/* Given a RECORD_TYPE for a class, return the corresponding handle type. */
#define CLASS_TO_HANDLE_TYPE(TYPE) BINFO_HANDLE (TYPE_BINFO (TYPE))
#else
#define HANDLE_TO_CLASS_TYPE(HTYPE) (HTYPE)
#define CLASS_TO_HANDLE_TYPE(TYPE) (TYPE)
#endif
#define JCF_u4 unsigned long #define JCF_u4 unsigned long
#define JCF_u2 unsigned short #define JCF_u2 unsigned short
...@@ -1261,13 +1245,8 @@ extern void jcf_print_utf8 PARAMS ((FILE *, const unsigned char *, int)); ...@@ -1261,13 +1245,8 @@ extern void jcf_print_utf8 PARAMS ((FILE *, const unsigned char *, int));
extern void jcf_print_char PARAMS ((FILE *, int)); extern void jcf_print_char PARAMS ((FILE *, int));
extern void jcf_print_utf8_replace PARAMS ((FILE *, const unsigned char *, extern void jcf_print_utf8_replace PARAMS ((FILE *, const unsigned char *,
int, int, int)); int, int, int));
# if JCF_USE_STDIO
extern const char* open_class PARAMS ((const char *, struct JCF *,
FILE *, const char *));
# else
extern const char* open_class PARAMS ((const char *, struct JCF *, extern const char* open_class PARAMS ((const char *, struct JCF *,
int, const char *)); int, const char *));
# endif /* JCF_USE_STDIO */
#endif #endif
extern void java_debug_context PARAMS ((void)); extern void java_debug_context PARAMS ((void));
extern void safe_layout_class PARAMS ((tree)); extern void safe_layout_class PARAMS ((tree));
......
...@@ -939,11 +939,7 @@ DEFUN(main, (argc, argv), ...@@ -939,11 +939,7 @@ DEFUN(main, (argc, argv),
if (optind >= argc) if (optind >= argc)
{ {
fprintf (out, "Reading .class from <standard input>.\n"); fprintf (out, "Reading .class from <standard input>.\n");
#if JCF_USE_STDIO
open_class ("<stdio>", jcf, stdin, NULL);
#else
open_class ("<stdio>", jcf, 0, NULL); open_class ("<stdio>", jcf, 0, NULL);
#endif
process_class (jcf); process_class (jcf);
} }
else else
......
...@@ -231,30 +231,6 @@ DEFUN(read_zip_member, (jcf, zipd, zipf), ...@@ -231,30 +231,6 @@ DEFUN(read_zip_member, (jcf, zipd, zipf),
return 0; return 0;
} }
#if JCF_USE_STDIO
const char *
DEFUN(open_class, (filename, jcf, stream, dep_name),
const char *filename AND JCF *jcf AND FILE* stream
AND const char *dep_name)
{
if (jcf)
{
if (dep_name != NULL)
jcf_dependency_add_file (dep_name, 0);
JCF_ZERO (jcf);
jcf->buffer = NULL;
jcf->buffer_end = NULL;
jcf->read_ptr = NULL;
jcf->read_end = NULL;
jcf->read_state = stream;
jcf->filename = filename;
jcf->filbuf = jcf_filbuf_from_stdio;
}
else
fclose (stream);
return filename;
}
#else
const char * const char *
DEFUN(open_class, (filename, jcf, fd, dep_name), DEFUN(open_class, (filename, jcf, fd, dep_name),
const char *filename AND JCF *jcf AND int fd AND const char *dep_name) const char *filename AND JCF *jcf AND int fd AND const char *dep_name)
...@@ -289,24 +265,16 @@ DEFUN(open_class, (filename, jcf, fd, dep_name), ...@@ -289,24 +265,16 @@ DEFUN(open_class, (filename, jcf, fd, dep_name),
close (fd); close (fd);
return filename; return filename;
} }
#endif
const char * const char *
DEFUN(find_classfile, (filename, jcf, dep_name), DEFUN(find_classfile, (filename, jcf, dep_name),
char *filename AND JCF *jcf AND const char *dep_name) char *filename AND JCF *jcf AND const char *dep_name)
{ {
#if JCF_USE_STDIO
FILE *stream = fopen (filename, "rb");
if (stream == NULL)
return NULL;
return open_class (arg, jcf, stream, dep_name);
#else
int fd = open (filename, O_RDONLY | O_BINARY); int fd = open (filename, O_RDONLY | O_BINARY);
if (fd < 0) if (fd < 0)
return NULL; return NULL;
return open_class (filename, jcf, fd, dep_name); return open_class (filename, jcf, fd, dep_name);
#endif
} }
#if JCF_USE_SCANDIR #if JCF_USE_SCANDIR
...@@ -461,11 +429,7 @@ DEFUN(find_class, (classname, classname_length, jcf, source_ok), ...@@ -461,11 +429,7 @@ DEFUN(find_class, (classname, classname_length, jcf, source_ok),
const char *classname AND int classname_length AND JCF *jcf AND int source_ok) const char *classname AND int classname_length AND JCF *jcf AND int source_ok)
{ {
#if JCF_USE_STDIO
FILE *stream;
#else
int fd; int fd;
#endif
int i, k, java = -1, class = -1; int i, k, java = -1, class = -1;
struct stat java_buf, class_buf; struct stat java_buf, class_buf;
char *dep_file; char *dep_file;
...@@ -578,27 +542,6 @@ DEFUN(find_class, (classname, classname_length, jcf, source_ok), ...@@ -578,27 +542,6 @@ DEFUN(find_class, (classname, classname_length, jcf, source_ok),
dep_file = java_buffer; dep_file = java_buffer;
else else
dep_file = buffer; dep_file = buffer;
#if JCF_USE_STDIO
if (!class)
{
SOURCE_FRONTEND_DEBUG (("Trying %s", buffer));
stream = fopen (buffer, "rb");
if (stream)
goto found;
}
/* Give .java a try, if necessary */
if (!java)
{
strcpy (buffer, java_buffer);
SOURCE_FRONTEND_DEBUG (("Trying %s", buffer));
stream = fopen (buffer, "r");
if (stream)
{
jcf->java_source = 1;
goto found;
}
}
#else
if (!class) if (!class)
{ {
SOURCE_FRONTEND_DEBUG ((stderr, "[Class selected: %s]\n", SOURCE_FRONTEND_DEBUG ((stderr, "[Class selected: %s]\n",
...@@ -624,7 +567,6 @@ DEFUN(find_class, (classname, classname_length, jcf, source_ok), ...@@ -624,7 +567,6 @@ DEFUN(find_class, (classname, classname_length, jcf, source_ok),
goto found; goto found;
} }
} }
#endif
free (buffer); free (buffer);
...@@ -635,12 +577,6 @@ DEFUN(find_class, (classname, classname_length, jcf, source_ok), ...@@ -635,12 +577,6 @@ DEFUN(find_class, (classname, classname_length, jcf, source_ok),
return NULL; return NULL;
found: found:
#if JCF_USE_STDIO
if (jcf->java_source)
return NULL; /* FIXME */
else
return open_class (buffer, jcf, stream, dep_file);
#else
if (jcf->java_source) if (jcf->java_source)
{ {
JCF_ZERO (jcf); /* JCF_FINISH relies on this */ JCF_ZERO (jcf); /* JCF_FINISH relies on this */
...@@ -652,7 +588,6 @@ DEFUN(find_class, (classname, classname_length, jcf, source_ok), ...@@ -652,7 +588,6 @@ DEFUN(find_class, (classname, classname_length, jcf, source_ok),
buffer = (char *) open_class (buffer, jcf, fd, dep_file); buffer = (char *) open_class (buffer, jcf, fd, dep_file);
jcf->classname = xstrdup (classname); jcf->classname = xstrdup (classname);
return buffer; return buffer;
#endif
} }
void void
......
...@@ -193,9 +193,7 @@ set_source_filename (jcf, index) ...@@ -193,9 +193,7 @@ set_source_filename (jcf, index)
DECL_LINENUMBERS_OFFSET (current_method) = 0) DECL_LINENUMBERS_OFFSET (current_method) = 0)
#define HANDLE_END_METHODS() \ #define HANDLE_END_METHODS() \
{ tree handle_type = CLASS_TO_HANDLE_TYPE (current_class); \ { current_method = NULL_TREE; }
if (handle_type != current_class) layout_type (handle_type); \
current_method = NULL_TREE; }
#define HANDLE_CODE_ATTRIBUTE(MAX_STACK, MAX_LOCALS, CODE_LENGTH) \ #define HANDLE_CODE_ATTRIBUTE(MAX_STACK, MAX_LOCALS, CODE_LENGTH) \
{ DECL_MAX_STACK (current_method) = (MAX_STACK); \ { DECL_MAX_STACK (current_method) = (MAX_STACK); \
...@@ -745,12 +743,12 @@ parse_class_file () ...@@ -745,12 +743,12 @@ parse_class_file ()
compiling from class files. */ compiling from class files. */
always_initialize_class_p = 1; always_initialize_class_p = 1;
for (field = TYPE_FIELDS (CLASS_TO_HANDLE_TYPE (current_class)); for (field = TYPE_FIELDS (current_class);
field != NULL_TREE; field = TREE_CHAIN (field)) field != NULL_TREE; field = TREE_CHAIN (field))
if (FIELD_STATIC (field)) if (FIELD_STATIC (field))
DECL_EXTERNAL (field) = 0; DECL_EXTERNAL (field) = 0;
for (method = TYPE_METHODS (CLASS_TO_HANDLE_TYPE (current_class)); for (method = TYPE_METHODS (current_class);
method != NULL_TREE; method = TREE_CHAIN (method)) method != NULL_TREE; method = TREE_CHAIN (method))
{ {
JCF *jcf = current_jcf; JCF *jcf = current_jcf;
......
...@@ -1896,6 +1896,7 @@ catch_clause: ...@@ -1896,6 +1896,7 @@ catch_clause:
exit_block (); exit_block ();
$$ = $1; $$ = $1;
} }
;
catch_clause_parameter: catch_clause_parameter:
CATCH_TK OP_TK formal_parameter CP_TK CATCH_TK OP_TK formal_parameter CP_TK
...@@ -6303,7 +6304,7 @@ java_check_regular_methods (class_decl) ...@@ -6303,7 +6304,7 @@ java_check_regular_methods (class_decl)
{ {
int saw_constructor = ANONYMOUS_CLASS_P (TREE_TYPE (class_decl)); int saw_constructor = ANONYMOUS_CLASS_P (TREE_TYPE (class_decl));
tree method; tree method;
tree class = CLASS_TO_HANDLE_TYPE (TREE_TYPE (class_decl)); tree class = TREE_TYPE (class_decl);
tree found = NULL_TREE; tree found = NULL_TREE;
tree mthrows; tree mthrows;
......
...@@ -446,7 +446,7 @@ promote_type (type) ...@@ -446,7 +446,7 @@ promote_type (type)
switch (TREE_CODE (type)) switch (TREE_CODE (type))
{ {
case RECORD_TYPE: case RECORD_TYPE:
return build_pointer_type (CLASS_TO_HANDLE_TYPE (type)); return build_pointer_type (type);
case BOOLEAN_TYPE: case BOOLEAN_TYPE:
if (type == boolean_type_node) if (type == boolean_type_node)
return promoted_boolean_type_node; return promoted_boolean_type_node;
......
...@@ -145,8 +145,8 @@ merge_types (type1, type2) ...@@ -145,8 +145,8 @@ merge_types (type1, type2)
if (type2 == ptr_type_node || type1 == object_ptr_type_node) if (type2 == ptr_type_node || type1 == object_ptr_type_node)
return type1; return type1;
tt1 = HANDLE_TO_CLASS_TYPE (TREE_TYPE (type1)); tt1 = TREE_TYPE (type1);
tt2 = HANDLE_TO_CLASS_TYPE (TREE_TYPE (type2)); tt2 = TREE_TYPE (type2);
/* If tt{1,2} haven't been properly loaded, now is a good time /* If tt{1,2} haven't been properly loaded, now is a good time
to do it. */ to do it. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment