296 assert(_ublock != NULL, "must have old block");
297 _ublock = b;
298 }
299
300 void LIR_OpBranch::negate_cond() {
301 switch (_cond) {
302 case lir_cond_equal: _cond = lir_cond_notEqual; break;
303 case lir_cond_notEqual: _cond = lir_cond_equal; break;
304 case lir_cond_less: _cond = lir_cond_greaterEqual; break;
305 case lir_cond_lessEqual: _cond = lir_cond_greater; break;
306 case lir_cond_greaterEqual: _cond = lir_cond_less; break;
307 case lir_cond_greater: _cond = lir_cond_lessEqual; break;
308 default: ShouldNotReachHere();
309 }
310 }
311
312
313 LIR_OpTypeCheck::LIR_OpTypeCheck(LIR_Code code, LIR_Opr result, LIR_Opr object, ciKlass* klass,
314 LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3,
315 bool fast_check, CodeEmitInfo* info_for_exception, CodeEmitInfo* info_for_patch,
316 CodeStub* stub)
317
318 : LIR_Op(code, result, NULL)
319 , _object(object)
320 , _array(LIR_OprFact::illegalOpr)
321 , _klass(klass)
322 , _tmp1(tmp1)
323 , _tmp2(tmp2)
324 , _tmp3(tmp3)
325 , _fast_check(fast_check)
326 , _info_for_patch(info_for_patch)
327 , _info_for_exception(info_for_exception)
328 , _stub(stub)
329 , _profiled_method(NULL)
330 , _profiled_bci(-1)
331 , _should_profile(false)
332 {
333 if (code == lir_checkcast) {
334 assert(info_for_exception != NULL, "checkcast throws exceptions");
335 } else if (code == lir_instanceof) {
336 assert(info_for_exception == NULL, "instanceof throws no exceptions");
337 } else {
338 ShouldNotReachHere();
339 }
340 }
341
342
343
344 LIR_OpTypeCheck::LIR_OpTypeCheck(LIR_Code code, LIR_Opr object, LIR_Opr array, LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, CodeEmitInfo* info_for_exception)
345 : LIR_Op(code, LIR_OprFact::illegalOpr, NULL)
346 , _object(object)
347 , _array(array)
348 , _klass(NULL)
349 , _tmp1(tmp1)
350 , _tmp2(tmp2)
351 , _tmp3(tmp3)
352 , _fast_check(false)
353 , _info_for_patch(NULL)
354 , _info_for_exception(info_for_exception)
355 , _stub(NULL)
356 , _profiled_method(NULL)
357 , _profiled_bci(-1)
358 , _should_profile(false)
359 {
360 if (code == lir_store_check) {
361 _stub = new ArrayStoreExceptionStub(object, info_for_exception);
362 assert(info_for_exception != NULL, "store_check throws exceptions");
363 } else {
364 ShouldNotReachHere();
365 }
366 }
367
368
369 LIR_OpArrayCopy::LIR_OpArrayCopy(LIR_Opr src, LIR_Opr src_pos, LIR_Opr dst, LIR_Opr dst_pos, LIR_Opr length,
370 LIR_Opr tmp, ciArrayKlass* expected_type, int flags, CodeEmitInfo* info)
371 : LIR_Op(lir_arraycopy, LIR_OprFact::illegalOpr, info)
372 , _src(src)
373 , _src_pos(src_pos)
374 , _dst(dst)
375 , _dst_pos(dst_pos)
376 , _length(length)
377 , _tmp(tmp)
378 , _expected_type(expected_type)
1372 lir_unlock,
1373 hdr,
1374 obj,
1375 lock,
1376 scratch,
1377 stub,
1378 NULL));
1379 }
1380
1381
1382 void check_LIR() {
1383 // cannot do the proper checking as PRODUCT and other modes return different results
1384 // guarantee(sizeof(LIR_OprDesc) == wordSize, "may not have a v-table");
1385 }
1386
1387
1388
1389 void LIR_List::checkcast (LIR_Opr result, LIR_Opr object, ciKlass* klass,
1390 LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, bool fast_check,
1391 CodeEmitInfo* info_for_exception, CodeEmitInfo* info_for_patch, CodeStub* stub,
1392 ciMethod* profiled_method, int profiled_bci) {
1393 LIR_OpTypeCheck* c = new LIR_OpTypeCheck(lir_checkcast, result, object, klass,
1394 tmp1, tmp2, tmp3, fast_check, info_for_exception, info_for_patch, stub);
1395 if (profiled_method != NULL) {
1396 c->set_profiled_method(profiled_method);
1397 c->set_profiled_bci(profiled_bci);
1398 c->set_should_profile(true);
1399 }
1400 append(c);
1401 }
1402
1403 void LIR_List::instanceof(LIR_Opr result, LIR_Opr object, ciKlass* klass, LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, bool fast_check, CodeEmitInfo* info_for_patch, ciMethod* profiled_method, int profiled_bci) {
1404 LIR_OpTypeCheck* c = new LIR_OpTypeCheck(lir_instanceof, result, object, klass, tmp1, tmp2, tmp3, fast_check, NULL, info_for_patch, NULL);
1405 if (profiled_method != NULL) {
1406 c->set_profiled_method(profiled_method);
1407 c->set_profiled_bci(profiled_bci);
1408 c->set_should_profile(true);
1409 }
1410 append(c);
1411 }
1412
|
296 assert(_ublock != NULL, "must have old block");
297 _ublock = b;
298 }
299
300 void LIR_OpBranch::negate_cond() {
301 switch (_cond) {
302 case lir_cond_equal: _cond = lir_cond_notEqual; break;
303 case lir_cond_notEqual: _cond = lir_cond_equal; break;
304 case lir_cond_less: _cond = lir_cond_greaterEqual; break;
305 case lir_cond_lessEqual: _cond = lir_cond_greater; break;
306 case lir_cond_greaterEqual: _cond = lir_cond_less; break;
307 case lir_cond_greater: _cond = lir_cond_lessEqual; break;
308 default: ShouldNotReachHere();
309 }
310 }
311
312
313 LIR_OpTypeCheck::LIR_OpTypeCheck(LIR_Code code, LIR_Opr result, LIR_Opr object, ciKlass* klass,
314 LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3,
315 bool fast_check, CodeEmitInfo* info_for_exception, CodeEmitInfo* info_for_patch,
316 CodeStub* stub, bool need_null_check)
317
318 : LIR_Op(code, result, NULL)
319 , _object(object)
320 , _array(LIR_OprFact::illegalOpr)
321 , _klass(klass)
322 , _tmp1(tmp1)
323 , _tmp2(tmp2)
324 , _tmp3(tmp3)
325 , _fast_check(fast_check)
326 , _info_for_patch(info_for_patch)
327 , _info_for_exception(info_for_exception)
328 , _stub(stub)
329 , _profiled_method(NULL)
330 , _profiled_bci(-1)
331 , _should_profile(false)
332 , _need_null_check(need_null_check)
333 {
334 if (code == lir_checkcast) {
335 assert(info_for_exception != NULL, "checkcast throws exceptions");
336 } else if (code == lir_instanceof) {
337 assert(info_for_exception == NULL, "instanceof throws no exceptions");
338 } else {
339 ShouldNotReachHere();
340 }
341 }
342
343
344
345 LIR_OpTypeCheck::LIR_OpTypeCheck(LIR_Code code, LIR_Opr object, LIR_Opr array, LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, CodeEmitInfo* info_for_exception)
346 : LIR_Op(code, LIR_OprFact::illegalOpr, NULL)
347 , _object(object)
348 , _array(array)
349 , _klass(NULL)
350 , _tmp1(tmp1)
351 , _tmp2(tmp2)
352 , _tmp3(tmp3)
353 , _fast_check(false)
354 , _info_for_patch(NULL)
355 , _info_for_exception(info_for_exception)
356 , _stub(NULL)
357 , _profiled_method(NULL)
358 , _profiled_bci(-1)
359 , _should_profile(false)
360 , _need_null_check(true)
361 {
362 if (code == lir_store_check) {
363 _stub = new ArrayStoreExceptionStub(object, info_for_exception);
364 assert(info_for_exception != NULL, "store_check throws exceptions");
365 } else {
366 ShouldNotReachHere();
367 }
368 }
369
370
371 LIR_OpArrayCopy::LIR_OpArrayCopy(LIR_Opr src, LIR_Opr src_pos, LIR_Opr dst, LIR_Opr dst_pos, LIR_Opr length,
372 LIR_Opr tmp, ciArrayKlass* expected_type, int flags, CodeEmitInfo* info)
373 : LIR_Op(lir_arraycopy, LIR_OprFact::illegalOpr, info)
374 , _src(src)
375 , _src_pos(src_pos)
376 , _dst(dst)
377 , _dst_pos(dst_pos)
378 , _length(length)
379 , _tmp(tmp)
380 , _expected_type(expected_type)
1374 lir_unlock,
1375 hdr,
1376 obj,
1377 lock,
1378 scratch,
1379 stub,
1380 NULL));
1381 }
1382
1383
1384 void check_LIR() {
1385 // cannot do the proper checking as PRODUCT and other modes return different results
1386 // guarantee(sizeof(LIR_OprDesc) == wordSize, "may not have a v-table");
1387 }
1388
1389
1390
1391 void LIR_List::checkcast (LIR_Opr result, LIR_Opr object, ciKlass* klass,
1392 LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, bool fast_check,
1393 CodeEmitInfo* info_for_exception, CodeEmitInfo* info_for_patch, CodeStub* stub,
1394 ciMethod* profiled_method, int profiled_bci, bool is_never_null) {
1395 // If klass is non-nullable, LIRGenerator::do_CheckCast has already performed null-check
1396 // on the object.
1397 bool need_null_check = !is_never_null;
1398 LIR_OpTypeCheck* c = new LIR_OpTypeCheck(lir_checkcast, result, object, klass,
1399 tmp1, tmp2, tmp3, fast_check, info_for_exception, info_for_patch, stub);
1400 if (profiled_method != NULL) {
1401 c->set_profiled_method(profiled_method);
1402 c->set_profiled_bci(profiled_bci);
1403 c->set_should_profile(true);
1404 }
1405 append(c);
1406 }
1407
1408 void LIR_List::instanceof(LIR_Opr result, LIR_Opr object, ciKlass* klass, LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, bool fast_check, CodeEmitInfo* info_for_patch, ciMethod* profiled_method, int profiled_bci) {
1409 LIR_OpTypeCheck* c = new LIR_OpTypeCheck(lir_instanceof, result, object, klass, tmp1, tmp2, tmp3, fast_check, NULL, info_for_patch, NULL);
1410 if (profiled_method != NULL) {
1411 c->set_profiled_method(profiled_method);
1412 c->set_profiled_bci(profiled_bci);
1413 c->set_should_profile(true);
1414 }
1415 append(c);
1416 }
1417
|