From 3f1158befea32dcc2615a809dd7a0a5359d62c12 Mon Sep 17 00:00:00 2001 From: bothner Date: Wed, 25 Nov 1998 17:10:49 +0000 Subject: [PATCH] =?utf8?q?=EF=BF=BD=20=09*=20java-tree.h=20(end=5Fparams?= =?utf8?q?=5Fnode):=20=20Declare=20global.=20=09*=20decl.c=20(end=5Fparams?= =?utf8?q?=5Fnode):=20=20New=20global.=20=09(init=5Fdecl=5Fprocessing,=20s?= =?utf8?q?tart=5Fjava=5Fmethod):=20=20Use=20end=5Fparams=5Fnode=20for=20?= =?utf8?q?=09end=20of=20list=20of=20parameter=20types.=20=20Follows=20corr?= =?utf8?q?ect=20gcc=20conventions.=20=09*=20expr.c=20(pop=5Fargument=5Ftyp?= =?utf8?q?es,=20pop=5Farguments):=20=20Likewise.=20=09*=20lang.c=20(put=5F?= =?utf8?q?decl=5Fnode):=20=20Likewise.=20=09*=20typeck.c=20(various=20plac?= =?utf8?q?es):=20=20Likewise.=20=09*=20class.y=20(various=20places):=20=20?= =?utf8?q?Likewise.=20=09*=20parse.y=20(various=20places):=20=20Likewise.?= =?utf8?q?=20=09*=20parse.y=20(java=5Fcomplete=5Ftree):=20=20Move=20CAN=5F?= =?utf8?q?COMPLETE=5FNORMALLY.=20=09(build=5Fjump=5Fto=5Ffinally):=20=20Ad?= =?utf8?q?d=20missing=20CAN=5FCOMPLETE=5FNORMALLY.=20=09*=20class.c:=20=20?= =?utf8?q?Add=20#include=20flags.h,=20remove=20no-longer=20needed=20declar?= =?utf8?q?ation.=20=09*=20class.c=20(layout=5Fclass=5Fmethod):=20=20Remove?= =?utf8?q?=20commented-out=20code,=20re-format.=20=09Don't=20add=20vtable?= =?utf8?q?=20entry=20(or=20index)=20for=20private=20methods.=20=09*=20expr?= =?utf8?q?.c=20(expand=5Finvoke):=20=20A=20private=20method=20is=20implici?= =?utf8?q?tly=20final.=20=09*=20class.c=20(make=5Fclass=5Fdata):=20=20If?= =?utf8?q?=20inlining=20or=20optimizing,=20=09skip=20private=20methods.=20?= =?utf8?q?=09*=20class.c=20(finish=5Fclass):=20=20New=20function.=20=20Cal?= =?utf8?q?ls=20existing=20methods,=20=09but=20alls=20emits=20deferred=20in?= =?utf8?q?line=20functions.=20=09*=20jcf-parse.c=20(parse=5Fclass=5Ffile):?= =?utf8?q?=20=20Call=20finish=5Fclass.=20=09*=20parse.y=20(java=5Fcomplete?= =?utf8?q?=5Fexpand=5Fmethods):=20=20Likewise.=20=09*=20expr.c=20(build=5F?= =?utf8?q?java=5Fbinop):=20=20Explicit=20default,=20to=20silence=20-Wall.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@23870 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/decl.c | 44 ++++++++++++++++++++++---------------------- gcc/java/expr.c | 25 +++++-------------------- 2 files changed, 27 insertions(+), 42 deletions(-) diff --git a/gcc/java/decl.c b/gcc/java/decl.c index d6e631e..6224bb6 100644 --- a/gcc/java/decl.c +++ b/gcc/java/decl.c @@ -333,6 +333,8 @@ tree length_identifier_node; tree this_identifier_node; tree super_identifier_node; +tree end_params_node; + /* References to internal libjava functions we use. */ tree alloc_object_node; tree soft_instanceof_node; @@ -415,6 +417,7 @@ builtin_function (name, type, function_code, library_name) void init_decl_processing () { + register tree endlink; tree field; tree t; @@ -672,8 +675,10 @@ init_decl_processing () CLASS_LOADED_P (method_type_node) = 1; build_decl (TYPE_DECL, get_identifier ("Method"), method_type_node); + endlink = end_params_node = tree_cons (NULL_TREE, void_type_node, NULL_TREE); + t = tree_cons (NULL_TREE, class_ptr_type, - build_tree_list (NULL_TREE, int_type_node)); + tree_cons (NULL_TREE, int_type_node, endlink)); alloc_object_node = builtin_function ("_Jv_AllocObject", build_function_type (ptr_type_node, t), NOT_BUILT_IN, NULL_PTR); @@ -681,21 +686,18 @@ init_decl_processing () build_function_type (void_type_node, t), NOT_BUILT_IN, NULL_PTR); - t = build_tree_list (NULL_TREE, void_type_node); + t = tree_cons (NULL_TREE, ptr_type_node, endlink); throw_node = builtin_function ("_Jv_Throw", build_function_type (ptr_type_node, t), NOT_BUILT_IN, NULL_PTR); + t = build_function_type (int_type_node, endlink); soft_monitorenter_node - = builtin_function ("_Jv_MonitorEnter", - build_function_type (int_type_node, t), - NOT_BUILT_IN, NULL_PTR); + = builtin_function ("_Jv_MonitorEnter", t, NOT_BUILT_IN, NULL_PTR); soft_monitorexit_node - = builtin_function ("_Jv_MonitorExit", - build_function_type (int_type_node, t), - NOT_BUILT_IN, NULL_PTR); + = builtin_function ("_Jv_MonitorExit", t, NOT_BUILT_IN, NULL_PTR); t = tree_cons (NULL_TREE, int_type_node, - build_tree_list (NULL_TREE, int_type_node)); + tree_cons (NULL_TREE, int_type_node, endlink)); soft_newarray_node = builtin_function ("_Jv_NewArray", build_function_type(ptr_type_node, t), @@ -703,22 +705,21 @@ init_decl_processing () t = tree_cons (NULL_TREE, int_type_node, tree_cons (NULL_TREE, class_ptr_type, - build_tree_list (NULL_TREE, - object_ptr_type_node))); + tree_cons (NULL_TREE, object_ptr_type_node, endlink))); soft_anewarray_node = builtin_function ("_Jv_NewObjectArray", build_function_type (ptr_type_node, t), NOT_BUILT_IN, NULL_PTR ); t = tree_cons (NULL_TREE, ptr_type_node, - build_tree_list (NULL_TREE, int_type_node)); + tree_cons (NULL_TREE, int_type_node, endlink)); soft_multianewarray_node = builtin_function ("_Jv_NewMultiArray", build_function_type (ptr_type_node, t), NOT_BUILT_IN, NULL_PTR ); t = build_function_type (void_type_node, - build_tree_list (NULL_TREE, int_type_node)); + tree_cons (NULL_TREE, int_type_node, endlink)); soft_badarrayindex_node = builtin_function ("_Jv_ThrowBadArrayIndex", t, NOT_BUILT_IN, NULL_PTR); @@ -726,50 +727,49 @@ init_decl_processing () TREE_SIDE_EFFECTS (soft_badarrayindex_node) = 1; t = tree_cons (NULL_TREE, class_ptr_type, - build_tree_list (NULL_TREE, object_ptr_type_node)); + tree_cons (NULL_TREE, object_ptr_type_node, endlink)); soft_checkcast_node = builtin_function ("_Jv_CheckCast", build_function_type (ptr_type_node, t), NOT_BUILT_IN, NULL_PTR); t = tree_cons (NULL_TREE, object_ptr_type_node, - build_tree_list (NULL_TREE, class_ptr_type)); + tree_cons (NULL_TREE, class_ptr_type, endlink)); soft_instanceof_node = builtin_function ("_Jv_IsInstanceOf", build_function_type (promoted_boolean_type_node, t), NOT_BUILT_IN, NULL_PTR); t = tree_cons (NULL_TREE, object_ptr_type_node, - build_tree_list (NULL_TREE, object_ptr_type_node)); + tree_cons (NULL_TREE, object_ptr_type_node, endlink)); soft_checkarraystore_node = builtin_function ("_Jv_CheckArrayStore", build_function_type (void_type_node, t), NOT_BUILT_IN, NULL_PTR); t = tree_cons (NULL_TREE, ptr_type_node, tree_cons (NULL_TREE, ptr_type_node, - build_tree_list (NULL_TREE, ptr_type_node))); + tree_cons (NULL_TREE, ptr_type_node, endlink))); soft_lookupinterfacemethod_node = builtin_function ("_Jv_LookupInterfaceMethod", build_function_type (ptr_type_node, t), NOT_BUILT_IN, NULL_PTR); t = tree_cons (NULL_TREE, double_type_node, - build_tree_list (NULL_TREE, double_type_node)); + tree_cons (NULL_TREE, double_type_node, endlink)); soft_fmod_node = builtin_function ("__builtin_fmod", build_function_type (double_type_node, t), BUILT_IN_FMOD, "fmod"); - t = build_tree_list (NULL_TREE, void_type_node); soft_exceptioninfo_call_node = build (CALL_EXPR, ptr_type_node, build_address_of (builtin_function ("_Jv_exception_info", - build_function_type (ptr_type_node, t), + build_function_type (ptr_type_node, endlink), NOT_BUILT_IN, NULL_PTR)), NULL_TREE, NULL_TREE); TREE_SIDE_EFFECTS (soft_exceptioninfo_call_node) = 1; #if 0 t = tree_cons (NULL_TREE, float_type_node, - build_tree_list (NULL_TREE, float_type_node)); + tree_cons (NULL_TREE, float_type_node, endlink)); soft_fmodf_node = builtin_function ("__builtin_fmodf", build_function_type (float_type_node, t), @@ -1535,7 +1535,7 @@ start_java_method (fndecl) ptr = &DECL_ARGUMENTS (fndecl); for (tem = TYPE_ARG_TYPES (TREE_TYPE (fndecl)), i = 0; - tem != NULL_TREE; tem = TREE_CHAIN (tem), i++) + tem != end_params_node; tem = TREE_CHAIN (tem), i++) { tree parm_name = NULL_TREE, parm_decl; tree parm_type = TREE_VALUE (tem); diff --git a/gcc/java/expr.c b/gcc/java/expr.c index b19b655..e97569d 100644 --- a/gcc/java/expr.c +++ b/gcc/java/expr.c @@ -1028,23 +1028,7 @@ build_java_binop (op, type, arg1, arg2) return call; } break; - -#if 0 /* not required */ - case PLUS_EXPR: - case MULT_EXPR: - case MINUS_EXPR: - case TRUNC_DIV_EXPR: - case RDIV_EXPR: -/* case REM_EXPR: */ - case BIT_AND_EXPR: - case BIT_IOR_EXPR: - case BIT_XOR_EXPR: - break; - default: - error ("unknown opcode"); - return error_mark_node; -#endif - + default: ; } return fold (build (op, type, arg1, arg2)); } @@ -1278,7 +1262,7 @@ void pop_argument_types (arg_types) tree arg_types; { - if (arg_types == NULL_TREE) + if (arg_types == end_params_node) return; if (TREE_CODE (arg_types) == TREE_LIST) { @@ -1293,7 +1277,7 @@ tree pop_arguments (arg_types) tree arg_types; { - if (arg_types == NULL_TREE) + if (arg_types == end_params_node) return NULL_TREE; if (TREE_CODE (arg_types) == TREE_LIST) { @@ -1542,7 +1526,8 @@ expand_invoke (opcode, method_ref_index, nargs) func = NULL_TREE; if (opcode == OPCODE_invokestatic || opcode == OPCODE_invokespecial || (opcode == OPCODE_invokevirtual - && (METHOD_FINAL (method) || CLASS_FINAL (TYPE_NAME (self_type))))) + && (METHOD_PRIVATE (method) + || METHOD_FINAL (method) || CLASS_FINAL (TYPE_NAME (self_type))))) func = build_known_method_ref (method, method_type, self_type, method_signature, arg_list); else -- 2.7.4