1.1 --- a/src/share/vm/adlc/output_c.cpp Fri Mar 06 21:36:50 2009 -0800 1.2 +++ b/src/share/vm/adlc/output_c.cpp Mon Mar 09 03:17:11 2009 -0700 1.3 @@ -2139,8 +2139,59 @@ 1.4 // A subfield variable, '$$' prefix 1.5 emit_field( rep_var ); 1.6 } else { 1.7 - // A replacement variable, '$' prefix 1.8 - emit_rep_var( rep_var ); 1.9 + if (_strings_to_emit.peek() != NULL && 1.10 + strcmp(_strings_to_emit.peek(), "$Address") == 0) { 1.11 + fprintf(_fp, "Address::make_raw("); 1.12 + 1.13 + emit_rep_var( rep_var ); 1.14 + fprintf(_fp,"->base(ra_,this,idx%d), ", _operand_idx); 1.15 + 1.16 + _reg_status = LITERAL_ACCESSED; 1.17 + emit_rep_var( rep_var ); 1.18 + fprintf(_fp,"->index(ra_,this,idx%d), ", _operand_idx); 1.19 + 1.20 + _reg_status = LITERAL_ACCESSED; 1.21 + emit_rep_var( rep_var ); 1.22 + fprintf(_fp,"->scale(), "); 1.23 + 1.24 + _reg_status = LITERAL_ACCESSED; 1.25 + emit_rep_var( rep_var ); 1.26 + Form::DataType stack_type = _operand ? _operand->is_user_name_for_sReg() : Form::none; 1.27 + if( _operand && _operand_idx==0 && stack_type != Form::none ) { 1.28 + fprintf(_fp,"->disp(ra_,this,0), "); 1.29 + } else { 1.30 + fprintf(_fp,"->disp(ra_,this,idx%d), ", _operand_idx); 1.31 + } 1.32 + 1.33 + _reg_status = LITERAL_ACCESSED; 1.34 + emit_rep_var( rep_var ); 1.35 + fprintf(_fp,"->disp_is_oop())"); 1.36 + 1.37 + // skip trailing $Address 1.38 + _strings_to_emit.iter(); 1.39 + } else { 1.40 + // A replacement variable, '$' prefix 1.41 + const char* next = _strings_to_emit.peek(); 1.42 + const char* next2 = _strings_to_emit.peek(2); 1.43 + if (next != NULL && next2 != NULL && strcmp(next2, "$Register") == 0 && 1.44 + (strcmp(next, "$base") == 0 || strcmp(next, "$index") == 0)) { 1.45 + // handle $rev_var$$base$$Register and $rev_var$$index$$Register by 1.46 + // producing as_Register(opnd_array(#)->base(ra_,this,idx1)). 1.47 + fprintf(_fp, "as_Register("); 1.48 + // emit the operand reference 1.49 + emit_rep_var( rep_var ); 1.50 + rep_var = _strings_to_emit.iter(); 1.51 + assert(strcmp(rep_var, "$base") == 0 || strcmp(rep_var, "$index") == 0, "bad pattern"); 1.52 + // handle base or index 1.53 + emit_field(rep_var); 1.54 + rep_var = _strings_to_emit.iter(); 1.55 + assert(strcmp(rep_var, "$Register") == 0, "bad pattern"); 1.56 + // close up the parens 1.57 + fprintf(_fp, ")"); 1.58 + } else { 1.59 + emit_rep_var( rep_var ); 1.60 + } 1.61 + } 1.62 } // end replacement and/or subfield 1.63 } 1.64 }