192 assert(t != unknown_type, "not set");
193 return t == object_type;
194 }
195 }
196
197
198
199 void LIR_Op2::verify() const {
200 #ifdef ASSERT
201 switch (code()) {
202 case lir_cmove:
203 case lir_xchg:
204 break;
205
206 default:
207 assert(!result_opr()->is_register() || !result_opr()->is_oop_register(),
208 "can't produce oops from arith");
209 }
210
211 if (TwoOperandLIRForm) {
212 switch (code()) {
213 case lir_add:
214 case lir_sub:
215 case lir_mul:
216 case lir_mul_strictfp:
217 case lir_div:
218 case lir_div_strictfp:
219 case lir_rem:
220 case lir_logic_and:
221 case lir_logic_or:
222 case lir_logic_xor:
223 case lir_shl:
224 case lir_shr:
225 assert(in_opr1() == result_opr(), "opr1 and result must match");
226 assert(in_opr1()->is_valid() && in_opr2()->is_valid(), "must be valid");
227 break;
228
229 // special handling for lir_ushr because of write barriers
230 case lir_ushr:
231 assert(in_opr1() == result_opr() || in_opr2()->is_constant(), "opr1 and result must match or shift count is constant");
232 assert(in_opr1()->is_valid() && in_opr2()->is_valid(), "must be valid");
233 break;
234
235 }
236 }
237 #endif
238 }
239
240
241 LIR_OpBranch::LIR_OpBranch(LIR_Condition cond, BasicType type, BlockBegin* block)
242 : LIR_Op(lir_branch, LIR_OprFact::illegalOpr, (CodeEmitInfo*)NULL)
243 , _cond(cond)
244 , _type(type)
245 , _label(block->label())
246 , _block(block)
247 , _ublock(NULL)
248 , _stub(NULL) {
249 }
250
251 LIR_OpBranch::LIR_OpBranch(LIR_Condition cond, BasicType type, CodeStub* stub) :
|
192 assert(t != unknown_type, "not set");
193 return t == object_type;
194 }
195 }
196
197
198
199 void LIR_Op2::verify() const {
200 #ifdef ASSERT
201 switch (code()) {
202 case lir_cmove:
203 case lir_xchg:
204 break;
205
206 default:
207 assert(!result_opr()->is_register() || !result_opr()->is_oop_register(),
208 "can't produce oops from arith");
209 }
210
211 if (TwoOperandLIRForm) {
212
213 #ifdef ASSERT
214 bool threeOperandForm = false;
215 #ifdef S390
216 // There are 3 operand shifts on S390 (see LIR_Assembler::shift_op()).
217 threeOperandForm =
218 code() == lir_shl ||
219 ((code() == lir_shr || code() == lir_ushr) && (result_opr()->is_double_cpu() || in_opr1()->type() == T_OBJECT));
220 #endif
221 #endif
222
223 switch (code()) {
224 case lir_add:
225 case lir_sub:
226 case lir_mul:
227 case lir_mul_strictfp:
228 case lir_div:
229 case lir_div_strictfp:
230 case lir_rem:
231 case lir_logic_and:
232 case lir_logic_or:
233 case lir_logic_xor:
234 case lir_shl:
235 case lir_shr:
236 assert(in_opr1() == result_opr() || threeOperandForm, "opr1 and result must match");
237 assert(in_opr1()->is_valid() && in_opr2()->is_valid(), "must be valid");
238 break;
239
240 // special handling for lir_ushr because of write barriers
241 case lir_ushr:
242 assert(in_opr1() == result_opr() || in_opr2()->is_constant() || threeOperandForm, "opr1 and result must match or shift count is constant");
243 assert(in_opr1()->is_valid() && in_opr2()->is_valid(), "must be valid");
244 break;
245
246 }
247 }
248 #endif
249 }
250
251
252 LIR_OpBranch::LIR_OpBranch(LIR_Condition cond, BasicType type, BlockBegin* block)
253 : LIR_Op(lir_branch, LIR_OprFact::illegalOpr, (CodeEmitInfo*)NULL)
254 , _cond(cond)
255 , _type(type)
256 , _label(block->label())
257 , _block(block)
258 , _ublock(NULL)
259 , _stub(NULL) {
260 }
261
262 LIR_OpBranch::LIR_OpBranch(LIR_Condition cond, BasicType type, CodeStub* stub) :
|