2137 |
2137 |
2138 if ( (*rep_var) == '$' ) { |
2138 if ( (*rep_var) == '$' ) { |
2139 // A subfield variable, '$$' prefix |
2139 // A subfield variable, '$$' prefix |
2140 emit_field( rep_var ); |
2140 emit_field( rep_var ); |
2141 } else { |
2141 } else { |
2142 // A replacement variable, '$' prefix |
2142 if (_strings_to_emit.peek() != NULL && |
2143 emit_rep_var( rep_var ); |
2143 strcmp(_strings_to_emit.peek(), "$Address") == 0) { |
|
2144 fprintf(_fp, "Address::make_raw("); |
|
2145 |
|
2146 emit_rep_var( rep_var ); |
|
2147 fprintf(_fp,"->base(ra_,this,idx%d), ", _operand_idx); |
|
2148 |
|
2149 _reg_status = LITERAL_ACCESSED; |
|
2150 emit_rep_var( rep_var ); |
|
2151 fprintf(_fp,"->index(ra_,this,idx%d), ", _operand_idx); |
|
2152 |
|
2153 _reg_status = LITERAL_ACCESSED; |
|
2154 emit_rep_var( rep_var ); |
|
2155 fprintf(_fp,"->scale(), "); |
|
2156 |
|
2157 _reg_status = LITERAL_ACCESSED; |
|
2158 emit_rep_var( rep_var ); |
|
2159 Form::DataType stack_type = _operand ? _operand->is_user_name_for_sReg() : Form::none; |
|
2160 if( _operand && _operand_idx==0 && stack_type != Form::none ) { |
|
2161 fprintf(_fp,"->disp(ra_,this,0), "); |
|
2162 } else { |
|
2163 fprintf(_fp,"->disp(ra_,this,idx%d), ", _operand_idx); |
|
2164 } |
|
2165 |
|
2166 _reg_status = LITERAL_ACCESSED; |
|
2167 emit_rep_var( rep_var ); |
|
2168 fprintf(_fp,"->disp_is_oop())"); |
|
2169 |
|
2170 // skip trailing $Address |
|
2171 _strings_to_emit.iter(); |
|
2172 } else { |
|
2173 // A replacement variable, '$' prefix |
|
2174 const char* next = _strings_to_emit.peek(); |
|
2175 const char* next2 = _strings_to_emit.peek(2); |
|
2176 if (next != NULL && next2 != NULL && strcmp(next2, "$Register") == 0 && |
|
2177 (strcmp(next, "$base") == 0 || strcmp(next, "$index") == 0)) { |
|
2178 // handle $rev_var$$base$$Register and $rev_var$$index$$Register by |
|
2179 // producing as_Register(opnd_array(#)->base(ra_,this,idx1)). |
|
2180 fprintf(_fp, "as_Register("); |
|
2181 // emit the operand reference |
|
2182 emit_rep_var( rep_var ); |
|
2183 rep_var = _strings_to_emit.iter(); |
|
2184 assert(strcmp(rep_var, "$base") == 0 || strcmp(rep_var, "$index") == 0, "bad pattern"); |
|
2185 // handle base or index |
|
2186 emit_field(rep_var); |
|
2187 rep_var = _strings_to_emit.iter(); |
|
2188 assert(strcmp(rep_var, "$Register") == 0, "bad pattern"); |
|
2189 // close up the parens |
|
2190 fprintf(_fp, ")"); |
|
2191 } else { |
|
2192 emit_rep_var( rep_var ); |
|
2193 } |
|
2194 } |
2144 } // end replacement and/or subfield |
2195 } // end replacement and/or subfield |
2145 } |
2196 } |
2146 } |
2197 } |
2147 |
2198 |
2148 void emit_reloc_type(const char* type) { |
2199 void emit_reloc_type(const char* type) { |