diff src/share/vm/adlc/output_c.cpp @ 3853:11211f7cb5a0

7079317: Incorrect branch's destination block in PrintoOptoAssembly output Summary: save/restore label and block in scratch_emit_size() Reviewed-by: never
author kvn
date Tue, 16 Aug 2011 11:53:57 -0700
parents 3d42f82cd811
children 6729bbc1fcd6
line wrap: on
line diff
--- a/src/share/vm/adlc/output_c.cpp	Tue Aug 16 04:14:05 2011 -0700
+++ b/src/share/vm/adlc/output_c.cpp	Tue Aug 16 11:53:57 2011 -0700
@@ -3094,6 +3094,13 @@
       fprintf(fp,"  oper->_label     = label;\n");
       fprintf(fp,"  oper->_block_num = block_num;\n");
       fprintf(fp,"}\n");
+      // Save the label
+      fprintf(fp,"void %sNode::save_label( Label** label, uint* block_num ) {\n", instr->_ident);
+      fprintf(fp,"  labelOper* oper  = (labelOper*)(opnd_array(%d));\n",
+              label_position );
+      fprintf(fp,"  *label = oper->_label;\n");
+      fprintf(fp,"  *block_num = oper->_block_num;\n");
+      fprintf(fp,"}\n");
     }
   }