comparison src/share/vm/opto/library_call.cpp @ 5927:b40ac3579043

6658428: C2 doesn't inline java method if corresponding intrinsic failed to inline. Summary: Allow fallback to non-intrinsic inline case Reviewed-by: kvn, jrose, never Contributed-by: nils.eliasson@oracle.com
author never
date Mon, 05 Mar 2012 18:10:31 -0800
parents f174909614bd
children 61b82be3b1ff
comparison
equal deleted inserted replaced
5926:e5f73be4c7f1 5927:b40ac3579043
336 if (!InlineReflectionGetCallerClass) return NULL; 336 if (!InlineReflectionGetCallerClass) return NULL;
337 if (!JDK_Version::is_gte_jdk14x_version()) return NULL; 337 if (!JDK_Version::is_gte_jdk14x_version()) return NULL;
338 break; 338 break;
339 339
340 case vmIntrinsics::_bitCount_i: 340 case vmIntrinsics::_bitCount_i:
341 if (!Matcher::has_match_rule(Op_PopCountI)) return NULL;
342 break;
343
341 case vmIntrinsics::_bitCount_l: 344 case vmIntrinsics::_bitCount_l:
342 if (!UsePopCountInstruction) return NULL; 345 if (!Matcher::has_match_rule(Op_PopCountL)) return NULL;
346 break;
347
348 case vmIntrinsics::_numberOfLeadingZeros_i:
349 if (!Matcher::match_rule_supported(Op_CountLeadingZerosI)) return NULL;
350 break;
351
352 case vmIntrinsics::_numberOfLeadingZeros_l:
353 if (!Matcher::match_rule_supported(Op_CountLeadingZerosL)) return NULL;
354 break;
355
356 case vmIntrinsics::_numberOfTrailingZeros_i:
357 if (!Matcher::match_rule_supported(Op_CountTrailingZerosI)) return NULL;
358 break;
359
360 case vmIntrinsics::_numberOfTrailingZeros_l:
361 if (!Matcher::match_rule_supported(Op_CountTrailingZerosL)) return NULL;
343 break; 362 break;
344 363
345 case vmIntrinsics::_Reference_get: 364 case vmIntrinsics::_Reference_get:
346 // It is only when G1 is enabled that we absolutely 365 // It is only when G1 is enabled that we absolutely
347 // need to use the intrinsic version of Reference.get() 366 // need to use the intrinsic version of Reference.get()
414 C->unique() - nodes); 433 C->unique() - nodes);
415 } 434 }
416 return kit.transfer_exceptions_into_jvms(); 435 return kit.transfer_exceptions_into_jvms();
417 } 436 }
418 437
419 if (PrintIntrinsics) { 438 // The intrinsic bailed out
439 if (PrintIntrinsics || PrintInlining NOT_PRODUCT( || PrintOptoInlining) ) {
420 if (jvms->has_method()) { 440 if (jvms->has_method()) {
421 // Not a root compile. 441 // Not a root compile.
422 tty->print("Did not inline intrinsic %s%s at bci:%d in", 442 const char* msg = is_virtual() ? "failed to inline (intrinsic, virtual)" : "failed to inline (intrinsic)";
423 vmIntrinsics::name_at(intrinsic_id()), 443 CompileTask::print_inlining(kit.callee(), jvms->depth() - 1, kit.bci(), msg);
424 (is_virtual() ? " (virtual)" : ""), kit.bci());
425 kit.caller()->print_short_name(tty);
426 tty->print_cr(" (%d bytes)", kit.caller()->code_size());
427 } else { 444 } else {
428 // Root compile 445 // Root compile
429 tty->print("Did not generate intrinsic %s%s at bci:%d in", 446 tty->print("Did not generate intrinsic %s%s at bci:%d in",
430 vmIntrinsics::name_at(intrinsic_id()), 447 vmIntrinsics::name_at(intrinsic_id()),
431 (is_virtual() ? " (virtual)" : ""), kit.bci()); 448 (is_virtual() ? " (virtual)" : ""), kit.bci());
5451 T_OBJECT); 5468 T_OBJECT);
5452 5469
5453 push(result); 5470 push(result);
5454 return true; 5471 return true;
5455 } 5472 }
5456