Should C1 respect CompilerCommand "dontinline"?
Krystal Mok
rednaxelafx at gmail.com
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:
http://hllvm.group.iteye.com/group/topic/26381
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
clear_inline_bailout();
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()) {
INLINE_BAILOUT("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
Regards,
Kris Mok
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.openjdk.java.net/pipermail/hotspot-compiler-dev/attachments/20110616/cb7da23d/attachment.html
More information about the hotspot-compiler-dev
mailing list