From d45e1e6e1a18f6716de168b35aa594666410a7e1 Mon Sep 17 00:00:00 2001 From: tromey Date: Fri, 17 Aug 2007 22:08:04 +0000 Subject: * typeck.c (find_method_in_interfaces): Update. * jcf-parse.c (load_class): Update. * java-gimplify.c (java_gimplify_component_ref): Removed. (java_gimplify_modify_expr): Update. Removed pre_p and post_p arguments. (java_gimplify_expr): Update. * decl.c (java_init_decl_processing): Update. * class.c (set_constant_value): Update. (make_class_data): Update. (finish_class): Update. (build_static_field_ref): Update. (is_compiled_class): Update. (maybe_layout_super_class): Update. (layout_class): Update. (layout_class_method): Update. * java-tree.h (CAN_COMPLETE_NORMALLY): Removed. (lang_decl_var) : Removed fields. (lang_decl_func) : Removed field. (lang_type) : Removed fields. (FIELD_NESTED_ACCESS): Removed. (FIELD_NESTED_ACCESS_P): Removed. (DECL_FIELD_FINAL_IUD): Removed. (DECL_LOCAL_FINAL_IUD): Removed (LOCAL_FINAL_P): Removed. (FINAL_VARIABLE_P): Removed. (CLASS_FINAL_VARIABLE_P): Removed. (DECL_BIT_INDEX): Removed. (DECL_INIT_CALLS_THIS): Removed. (FIELD_LOCAL_ALIAS): Removed. (FIELD_LOCAL_ALIAS_USED): Removed. (FIELD_THISN): Removed. (DECL_FUNCTION_INIT_TEST_CLASS): Removed. (LOCAL_CLASS_INITIALIZATION_FLAG): Removed. (LOCAL_CLASS_INITIALIZATION_FLAG_P): Removed. (TYPE_DOT_CLASS): Removed. (TYPE_VERIFY_METHOD): Removed. (ID_CLASSDOLLAR_P): Removed. (enum java_tree_index) : Removed. (classdollar_identifier_node): Removed. (TYPE_UNKNOWN): Removed. (CLASS_FROM_SOURCE_P): Removed. * expr.c (build_jni_stub): Update. (force_evaluation_order): Update. (build_java_empty_stmt): Update. (build_class_init): Update. (java_stack_swap): Update. (build_jni_stub): Update. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127602 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/java/java-gimplify.c | 93 ++---------------------------------------------- 1 file changed, 3 insertions(+), 90 deletions(-) (limited to 'gcc/java/java-gimplify.c') diff --git a/gcc/java/java-gimplify.c b/gcc/java/java-gimplify.c index 091cb1b875f..53582411353 100644 --- a/gcc/java/java-gimplify.c +++ b/gcc/java/java-gimplify.c @@ -32,8 +32,7 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "toplev.h" static tree java_gimplify_block (tree); -static enum gimplify_status java_gimplify_modify_expr (tree*, tree*, tree *); -static enum gimplify_status java_gimplify_component_ref (tree*, tree*, tree *); +static enum gimplify_status java_gimplify_modify_expr (tree *); static enum gimplify_status java_gimplify_self_mod_expr (tree*, tree*, tree *); static void dump_java_tree (enum tree_dump_index, tree); @@ -73,7 +72,7 @@ java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED, semantics should only be generated by the front-end, and never by anything after gimplification. */ case MODIFY_EXPR: - return java_gimplify_modify_expr (expr_p, pre_p, post_p); + return java_gimplify_modify_expr (expr_p); case SAVE_EXPR: /* Note that we can see if the save_expr was @@ -98,9 +97,6 @@ java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED, case COMPARE_G_EXPR: gcc_unreachable (); - case COMPONENT_REF: - return java_gimplify_component_ref (expr_p, pre_p, post_p); - default: /* Java insists on strict left-to-right evaluation of expressions. A problem may arise if a variable used in the LHS of a binary @@ -129,96 +125,13 @@ java_gimplify_expr (tree *expr_p, tree *pre_p ATTRIBUTE_UNUSED, } static enum gimplify_status -java_gimplify_component_ref (tree *expr_p, tree *pre_p, tree *post_p) -{ - if (CLASS_FROM_SOURCE_P (output_class) - && TREE_THIS_VOLATILE (TREE_OPERAND (*expr_p, 1)) - && ! TREE_THIS_VOLATILE (*expr_p)) - { - enum gimplify_status stat; - tree sync_expr; - - /* Special handling for volatile fields. - - A load has "acquire" semantics, implying that you can't move up - later operations. A store has "release" semantics meaning that - earlier operations cannot be delayed past it. - - This logic only handles loads: stores are handled in - java_gimplify_modify_expr(). - - We gimplify this COMPONENT_REF, put the result in a tmp_var, and then - return a COMPOUND_EXPR of the form {__sync_synchronize(); tmp_var}. - This forces __sync_synchronize() to be placed immediately after - loading from the volatile field. - - */ - - TREE_THIS_VOLATILE (*expr_p) = 1; - *expr_p = java_modify_addr_for_volatile (*expr_p); - stat = gimplify_expr (expr_p, pre_p, post_p, - is_gimple_formal_tmp_var, fb_rvalue); - if (stat == GS_ERROR) - return stat; - - sync_expr = build_call_expr (built_in_decls[BUILT_IN_SYNCHRONIZE], 0); - TREE_SIDE_EFFECTS (sync_expr) = 1; - *expr_p = build2 (COMPOUND_EXPR, TREE_TYPE (*expr_p), - sync_expr, *expr_p); - TREE_SIDE_EFFECTS (*expr_p) = 1; - } - - return GS_UNHANDLED; -} - - -static enum gimplify_status -java_gimplify_modify_expr (tree *modify_expr_p, tree *pre_p, tree *post_p) +java_gimplify_modify_expr (tree *modify_expr_p) { tree modify_expr = *modify_expr_p; tree lhs = TREE_OPERAND (modify_expr, 0); tree rhs = TREE_OPERAND (modify_expr, 1); tree lhs_type = TREE_TYPE (lhs); - if (CLASS_FROM_SOURCE_P (output_class) - && TREE_CODE (lhs) == COMPONENT_REF - && TREE_THIS_VOLATILE (TREE_OPERAND (lhs, 1))) - { - /* Special handling for volatile fields. - - A load has "acquire" semantics, implying that you can't move up - later operations. A store has "release" semantics meaning that - earlier operations cannot be delayed past it. - - This logic only handles stores; loads are handled in - java_gimplify_component_ref(). - - We gimplify the rhs, put the result in a tmp_var, and then return - a MODIFY_EXPR with an rhs of the form {__sync_synchronize(); tmp_var}. - This forces __sync_synchronize() to be placed after evaluating - the rhs and immediately before storing to the volatile field. - - */ - - enum gimplify_status stat; - tree sync_expr = - build_call_expr (built_in_decls[BUILT_IN_SYNCHRONIZE], 0); - TREE_SIDE_EFFECTS (sync_expr) = 1; - - stat = gimplify_expr (&rhs, pre_p, post_p, - is_gimple_formal_tmp_var, fb_rvalue); - if (stat == GS_ERROR) - return stat; - - rhs = build2 (COMPOUND_EXPR, TREE_TYPE (rhs), - sync_expr, rhs); - TREE_SIDE_EFFECTS (rhs) = 1; - TREE_THIS_VOLATILE (lhs) = 1; - lhs = java_modify_addr_for_volatile (lhs); - TREE_OPERAND (modify_expr, 0) = lhs; - TREE_OPERAND (modify_expr, 1) = rhs; - } - /* This is specific to the bytecode compiler. If a variable has LOCAL_SLOT_P set, replace an assignment to it with an assignment to the corresponding variable that holds all its aliases. */ -- cgit v1.2.1