Commit 66b48140 by Per Bothner

Optimize: `return (a ? b : c)' as: `if (a) return b; else return c;'.

 
	Optimize: `return (a ? b : c)' as: `if (a) return b; else return c;'.
	* jcf-write.c (generate_bytecode_return):  New function.
	(generate_bytecode_insns):  Use it, for RETURN_EXPR.
	* jcf-write.c (generate_bytecode_insns):  For REAL_CST that is 0 or 1,
	generate special [fd]const_[01] instructions.
	* jcf-parse.c (yyparse):  Don't emit_register_classes if -fsyntax-only.
	* verify.c (verify_jvm_instructions):  Do INVALIDATE_PC after
	handling OPCODE_lookupswitch or OPCODE_tableswitch.

From-SVN: r24972
parent bb6e881c
...@@ -841,7 +841,7 @@ yyparse () ...@@ -841,7 +841,7 @@ yyparse ()
} }
java_expand_classes (); java_expand_classes ();
if (!java_report_errors () && !flag_emit_class_files) if (!java_report_errors () && !flag_syntax_only)
emit_register_classes (); emit_register_classes ();
return 0; return 0;
} }
......
...@@ -979,6 +979,7 @@ verify_jvm_instructions (jcf, byte_ops, length) ...@@ -979,6 +979,7 @@ verify_jvm_instructions (jcf, byte_ops, length)
while (low++ <= high) while (low++ <= high)
PUSH_PENDING (lookup_label (oldpc + IMMEDIATE_s4)); PUSH_PENDING (lookup_label (oldpc + IMMEDIATE_s4));
INVALIDATE_PC;
break; break;
} }
...@@ -1010,6 +1011,7 @@ verify_jvm_instructions (jcf, byte_ops, length) ...@@ -1010,6 +1011,7 @@ verify_jvm_instructions (jcf, byte_ops, length)
last = match; last = match;
PUSH_PENDING (lookup_label (oldpc + IMMEDIATE_s4)); PUSH_PENDING (lookup_label (oldpc + IMMEDIATE_s4));
} }
INVALIDATE_PC;
break; break;
} }
......
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