3474 } 3475 } 3476 } 3477 3478 Intrinsic* result = new Intrinsic(result_type, callee->intrinsic_id(), 3479 args, has_receiver, state_before, 3480 vmIntrinsics::preserves_state(id), 3481 vmIntrinsics::can_trap(id)); 3482 // append instruction & push result 3483 Value value = append_split(result); 3484 if (result_type != voidType) push(result_type, value); 3485 3486 if (callee != method() && profile_return() && result_type->is_object_kind()) { 3487 profile_return_type(result, callee); 3488 } 3489 } 3490 3491 bool GraphBuilder::try_inline_intrinsics(ciMethod* callee) { 3492 // For calling is_intrinsic_available we need to transition to 3493 // the '_thread_in_vm' state because is_intrinsic_available() 3494 // does not accesses critical VM-internal data. 3495 if (!_compilation->compiler()->is_intrinsic_available(callee->get_Method(), NULL)) { 3496 if (!InlineNatives) { 3497 // Return false and also set message that the inlining of 3498 // intrinsics has been disabled in general. 3499 INLINE_BAILOUT("intrinsic method inlining disabled"); 3500 } else { 3501 return false; 3502 } 3503 } 3504 build_graph_for_intrinsic(callee); 3505 return true; 3506 } 3507 3508 3509 bool GraphBuilder::try_inline_jsr(int jsr_dest_bci) { 3510 // Introduce a new callee continuation point - all Ret instructions 3511 // will be replaced with Gotos to this point. 3512 BlockBegin* cont = block_at(next_bci()); 3513 assert(cont != NULL, "continuation must exist (BlockListBuilder starts a new block after a jsr"); 3514 3515 // Note: can not assign state to continuation yet, as we have to | 3474 } 3475 } 3476 } 3477 3478 Intrinsic* result = new Intrinsic(result_type, callee->intrinsic_id(), 3479 args, has_receiver, state_before, 3480 vmIntrinsics::preserves_state(id), 3481 vmIntrinsics::can_trap(id)); 3482 // append instruction & push result 3483 Value value = append_split(result); 3484 if (result_type != voidType) push(result_type, value); 3485 3486 if (callee != method() && profile_return() && result_type->is_object_kind()) { 3487 profile_return_type(result, callee); 3488 } 3489 } 3490 3491 bool GraphBuilder::try_inline_intrinsics(ciMethod* callee) { 3492 // For calling is_intrinsic_available we need to transition to 3493 // the '_thread_in_vm' state because is_intrinsic_available() 3494 // accesses critical VM-internal data. 3495 bool is_available = false; 3496 { 3497 VM_ENTRY_MARK; 3498 methodHandle mh(THREAD, callee->get_Method()); 3499 methodHandle ct(THREAD, method()->get_Method()); 3500 is_available = _compilation->compiler()->is_intrinsic_available(mh, ct); 3501 } 3502 3503 if (!is_available) { 3504 if (!InlineNatives) { 3505 // Return false and also set message that the inlining of 3506 // intrinsics has been disabled in general. 3507 INLINE_BAILOUT("intrinsic method inlining disabled"); 3508 } else { 3509 return false; 3510 } 3511 } 3512 build_graph_for_intrinsic(callee); 3513 return true; 3514 } 3515 3516 3517 bool GraphBuilder::try_inline_jsr(int jsr_dest_bci) { 3518 // Introduce a new callee continuation point - all Ret instructions 3519 // will be replaced with Gotos to this point. 3520 BlockBegin* cont = block_at(next_bci()); 3521 assert(cont != NULL, "continuation must exist (BlockListBuilder starts a new block after a jsr"); 3522 3523 // Note: can not assign state to continuation yet, as we have to |