Should C1 respect CompilerCommand "dontinline"?

Krystal Mok rednaxelafx at
Wed Jun 15 20:31:23 PDT 2011

Hi all,

Someone asked why he ran tests and found that the compiler command
"dontinline" doesn't work, here:

It's clear that he's using HotSpot Client VM, so it's C1 in action. I found
that C1's graph builder doesn't check
whether a method has been tagged as "dontinline" by the CompilerOracle,

src/share/vm/c1/c1_GraphBuilder.cpp, line 2984
bool GraphBuilder::try_inline(ciMethod* callee, bool holder_known) {
  // Clear out any existing inline bailout condition

  if (callee->should_exclude()) {
    // callee is excluded
    INLINE_BAILOUT("excluded by CompilerOracle")
  } else if (!callee->can_be_compiled()) {
    // callee is not compilable (prob. has breakpoints)
    INLINE_BAILOUT("not compilable")
  } else if (callee->intrinsic_id() != vmIntrinsics::_none &&
try_inline_intrinsics(callee)) {
    // intrinsics can be native or not
    return true;
  } else if (callee->is_native()) {
    // non-intrinsic natives cannot be inlined
    INLINE_BAILOUT("non-intrinsic native")
  } else if (callee->is_abstract()) {
  } else {
    return try_inline_full(callee, holder_known);

Should there be a check to callee->should_not_inline() after the
should_exclude() branch, so that C1 respects
the "dontinline" command? And perhaps another check to
callee->should_inline() in GraphBuilder::try_inline_full() ?

P.S. The code I'm using is from hsx/hsx20/baseline. It's the same on the tip
of hsx/hotspot-comp

Kris Mok
-------------- next part --------------
An HTML attachment was scrubbed...

More information about the hotspot-compiler-dev mailing list