343 |
343 |
344 |
344 |
345 LIR_OpTypeCheck::LIR_OpTypeCheck(LIR_Code code, LIR_Opr result, LIR_Opr object, ciKlass* klass, |
345 LIR_OpTypeCheck::LIR_OpTypeCheck(LIR_Code code, LIR_Opr result, LIR_Opr object, ciKlass* klass, |
346 LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, |
346 LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, |
347 bool fast_check, CodeEmitInfo* info_for_exception, CodeEmitInfo* info_for_patch, |
347 bool fast_check, CodeEmitInfo* info_for_exception, CodeEmitInfo* info_for_patch, |
348 CodeStub* stub, |
348 CodeStub* stub) |
349 ciMethod* profiled_method, |
349 |
350 int profiled_bci) |
|
351 : LIR_Op(code, result, NULL) |
350 : LIR_Op(code, result, NULL) |
352 , _object(object) |
351 , _object(object) |
353 , _array(LIR_OprFact::illegalOpr) |
352 , _array(LIR_OprFact::illegalOpr) |
354 , _klass(klass) |
353 , _klass(klass) |
355 , _tmp1(tmp1) |
354 , _tmp1(tmp1) |
357 , _tmp3(tmp3) |
356 , _tmp3(tmp3) |
358 , _fast_check(fast_check) |
357 , _fast_check(fast_check) |
359 , _stub(stub) |
358 , _stub(stub) |
360 , _info_for_patch(info_for_patch) |
359 , _info_for_patch(info_for_patch) |
361 , _info_for_exception(info_for_exception) |
360 , _info_for_exception(info_for_exception) |
362 , _profiled_method(profiled_method) |
361 , _profiled_method(NULL) |
363 , _profiled_bci(profiled_bci) { |
362 , _profiled_bci(-1) |
|
363 , _should_profile(false) |
|
364 { |
364 if (code == lir_checkcast) { |
365 if (code == lir_checkcast) { |
365 assert(info_for_exception != NULL, "checkcast throws exceptions"); |
366 assert(info_for_exception != NULL, "checkcast throws exceptions"); |
366 } else if (code == lir_instanceof) { |
367 } else if (code == lir_instanceof) { |
367 assert(info_for_exception == NULL, "instanceof throws no exceptions"); |
368 assert(info_for_exception == NULL, "instanceof throws no exceptions"); |
368 } else { |
369 } else { |
382 , _tmp3(tmp3) |
383 , _tmp3(tmp3) |
383 , _fast_check(false) |
384 , _fast_check(false) |
384 , _stub(NULL) |
385 , _stub(NULL) |
385 , _info_for_patch(NULL) |
386 , _info_for_patch(NULL) |
386 , _info_for_exception(info_for_exception) |
387 , _info_for_exception(info_for_exception) |
387 , _profiled_method(profiled_method) |
388 , _profiled_method(NULL) |
388 , _profiled_bci(profiled_bci) { |
389 , _profiled_bci(-1) |
|
390 , _should_profile(false) |
|
391 { |
389 if (code == lir_store_check) { |
392 if (code == lir_store_check) { |
390 _stub = new ArrayStoreExceptionStub(info_for_exception); |
393 _stub = new ArrayStoreExceptionStub(info_for_exception); |
391 assert(info_for_exception != NULL, "store_check throws exceptions"); |
394 assert(info_for_exception != NULL, "store_check throws exceptions"); |
392 } else { |
395 } else { |
393 ShouldNotReachHere(); |
396 ShouldNotReachHere(); |
493 case lir_leal: // input and result always valid, info always invalid |
496 case lir_leal: // input and result always valid, info always invalid |
494 case lir_neg: // input and result always valid, info always invalid |
497 case lir_neg: // input and result always valid, info always invalid |
495 case lir_monaddr: // input and result always valid, info always invalid |
498 case lir_monaddr: // input and result always valid, info always invalid |
496 case lir_null_check: // input and info always valid, result always invalid |
499 case lir_null_check: // input and info always valid, result always invalid |
497 case lir_move: // input and result always valid, may have info |
500 case lir_move: // input and result always valid, may have info |
|
501 case lir_pack64: // input and result always valid |
|
502 case lir_unpack64: // input and result always valid |
498 case lir_prefetchr: // input always valid, result and info always invalid |
503 case lir_prefetchr: // input always valid, result and info always invalid |
499 case lir_prefetchw: // input always valid, result and info always invalid |
504 case lir_prefetchw: // input always valid, result and info always invalid |
500 { |
505 { |
501 assert(op->as_Op1() != NULL, "must be"); |
506 assert(op->as_Op1() != NULL, "must be"); |
502 LIR_Op1* op1 = (LIR_Op1*)op; |
507 LIR_Op1* op1 = (LIR_Op1*)op; |
1362 |
1368 |
1363 void LIR_List::checkcast (LIR_Opr result, LIR_Opr object, ciKlass* klass, |
1369 void LIR_List::checkcast (LIR_Opr result, LIR_Opr object, ciKlass* klass, |
1364 LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, bool fast_check, |
1370 LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, bool fast_check, |
1365 CodeEmitInfo* info_for_exception, CodeEmitInfo* info_for_patch, CodeStub* stub, |
1371 CodeEmitInfo* info_for_exception, CodeEmitInfo* info_for_patch, CodeStub* stub, |
1366 ciMethod* profiled_method, int profiled_bci) { |
1372 ciMethod* profiled_method, int profiled_bci) { |
1367 append(new LIR_OpTypeCheck(lir_checkcast, result, object, klass, |
1373 LIR_OpTypeCheck* c = new LIR_OpTypeCheck(lir_checkcast, result, object, klass, |
1368 tmp1, tmp2, tmp3, fast_check, info_for_exception, info_for_patch, stub, |
1374 tmp1, tmp2, tmp3, fast_check, info_for_exception, info_for_patch, stub); |
1369 profiled_method, profiled_bci)); |
1375 if (profiled_method != NULL) { |
1370 } |
1376 c->set_profiled_method(profiled_method); |
1371 |
1377 c->set_profiled_bci(profiled_bci); |
|
1378 c->set_should_profile(true); |
|
1379 } |
|
1380 append(c); |
|
1381 } |
1372 |
1382 |
1373 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) { |
1383 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) { |
1374 append(new LIR_OpTypeCheck(lir_instanceof, result, object, klass, tmp1, tmp2, tmp3, fast_check, NULL, info_for_patch, NULL, NULL, 0)); |
1384 append(new LIR_OpTypeCheck(lir_instanceof, result, object, klass, tmp1, tmp2, tmp3, fast_check, NULL, info_for_patch, NULL)); |
1375 } |
1385 } |
1376 |
1386 |
1377 |
1387 |
1378 void LIR_List::store_check(LIR_Opr object, LIR_Opr array, LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, CodeEmitInfo* info_for_exception) { |
1388 void LIR_List::store_check(LIR_Opr object, LIR_Opr array, LIR_Opr tmp1, LIR_Opr tmp2, LIR_Opr tmp3, CodeEmitInfo* info_for_exception) { |
1379 append(new LIR_OpTypeCheck(lir_store_check, object, array, tmp1, tmp2, tmp3, info_for_exception, NULL, 0)); |
1389 append(new LIR_OpTypeCheck(lir_store_check, object, array, tmp1, tmp2, tmp3, info_for_exception)); |
1380 } |
1390 } |
1381 |
1391 |
1382 |
1392 |
1383 void LIR_List::cas_long(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, |
1393 void LIR_List::cas_long(LIR_Opr addr, LIR_Opr cmp_value, LIR_Opr new_value, |
1384 LIR_Opr t1, LIR_Opr t2, LIR_Opr result) { |
1394 LIR_Opr t1, LIR_Opr t2, LIR_Opr result) { |
1609 case lir_throw: s = "throw"; break; |
1619 case lir_throw: s = "throw"; break; |
1610 case lir_unwind: s = "unwind"; break; |
1620 case lir_unwind: s = "unwind"; break; |
1611 case lir_convert: s = "convert"; break; |
1621 case lir_convert: s = "convert"; break; |
1612 case lir_alloc_object: s = "alloc_obj"; break; |
1622 case lir_alloc_object: s = "alloc_obj"; break; |
1613 case lir_monaddr: s = "mon_addr"; break; |
1623 case lir_monaddr: s = "mon_addr"; break; |
|
1624 case lir_pack64: s = "pack64"; break; |
|
1625 case lir_unpack64: s = "unpack64"; break; |
1614 // LIR_Op2 |
1626 // LIR_Op2 |
1615 case lir_cmp: s = "cmp"; break; |
1627 case lir_cmp: s = "cmp"; break; |
1616 case lir_cmp_l2i: s = "cmp_l2i"; break; |
1628 case lir_cmp_l2i: s = "cmp_l2i"; break; |
1617 case lir_ucmp_fd2i: s = "ucomp_fd2i"; break; |
1629 case lir_ucmp_fd2i: s = "ucomp_fd2i"; break; |
1618 case lir_cmp_fd2i: s = "comp_fd2i"; break; |
1630 case lir_cmp_fd2i: s = "comp_fd2i"; break; |