JDK-8237946 : CTW: C2 compilation bails with "unsupported incoming calling sequence" due to too many method arguments
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: 15
  • Priority: P4
  • Status: Closed
  • Resolution: Not an Issue
  • Submitted: 2020-01-28
  • Updated: 2020-02-14
  • Resolved: 2020-02-14
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 15
15Resolved
Related Reports
Relates :  
Description
$ cd test/hotspot/jtreg/testlibrary/ctw
$ make
$ cd dist
$ wget https://repo1.maven.org/maven2/io/cloudslang/content/cs-jclouds/0.0.9/cs-jclouds-0.0.9.jar
$ JAVA_OPTIONS="-XX:+AbortVMOnCompilationFailure" ./ctw.sh cs-jclouds-0.0.9.jar

#  Internal Error (/home/shade/trunks/jdk-jdk/src/hotspot/share/compiler/compileBroker.cpp:2009), pid=17120, tid=17132
#  fatal error: Not compilable at tier 4: unsupported incoming calling sequence
#
# JRE version: OpenJDK Runtime Environment (15.0) (fastdebug build 15-internal+0-adhoc.shade.jdk-jdk)
# Java VM: OpenJDK 64-Bit Server VM (fastdebug 15-internal+0-adhoc.shade.jdk-jdk, mixed mode, sharing, tiered, compressed oops, g1 gc, linux-amd64)
# Problematic frame:
# V  [libjvm.so+0x882133]  CompileBroker::post_compile(CompilerThread*, CompileTask*, bool, ciEnv*, int, char const*)+0x1b3

Comments
Looks good, thank you for the additional logs!
14-02-2020

Yup. Wrapping call to instance.test(...) makes it even more pronounced. Tiered policy would recompile it on tier 1 (C1). Non-tiered policy would bail to interpreter. $ java -XX:+PrintCompilation -Xbatch -Xcomp Test | grep Test::test 1201 1351 % b 4 Test::test @ 7 (30 bytes) 1202 1352 b 2 Test::test (30 bytes) 1203 1353 b 4 Test::test (30 bytes) 1203 1353 b 4 Test::test (30 bytes) COMPILE SKIPPED: unsupported incoming calling sequence (retry at different tier) 1203 1354 b 1 Test::test (30 bytes) 1204 1352 2 Test::test (30 bytes) made not entrant $ java -XX:+PrintCompilation -XX:-TieredCompilation -Xbatch -Xcomp Test | grep Test::test 1898 1155 b Test::test (30 bytes) 1898 1155 b Test::test (30 bytes) COMPILE SKIPPED: unsupported incoming calling sequence (not retryable)
14-02-2020

Only happens with -XX:+AbortVMOnCompilationFailure when C2 bails out of the compilation at [1] due to too many method arguments. This is expected since C2 reaches the maximum number of allowed stack arguments/slots. Looking at the declaration of io.cloudslang.content.jclouds.actions.instances.DescribeInstancesAction, we can see that it defines 90 String parameters which are simply too many to handle by C2 and it bails out. This bailout behavior can also be verified by running the small test program below with -Xcomp and -XX:CompileCommand=compileonly,Test::test. C2 bails out when compiling Test::test(), which only defines 60 parameters, with "Not compilable at tier 4: unsupported incoming calling sequence". I'm closing this as not an issue. [1] http://hg.openjdk.java.net/jdk/jdk/file/f82f59ef79f0/src/hotspot/share/opto/matcher.cpp#l134 public class Test { public static void main(String[] strArr) { Test instance = new Test(); instance.test(null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null); } public int test(A a0, A a1, A a2, A a3, A a4, A a5, A a6, A a7, A a8, A a9, A a10, A a11, A a12, A a13, A a14, A a15, A a16, A a17, A a18, A a19, A a20, A a21, A a22, A a23, A a24, A a25, A a26, A a27, A a28, A a29, A a30, A a31, A a32, A a33, A a34, A a35, A a36, A a37, A a38, A a39, A a40, A a41, A a42, A a43, A a44, A a45, A a46, A a47, A a48, A a49, A a50, A a51, A a52, A a53, A a54, A a55, A a56, A a57, A a58, A a59) { int a = 10; for (int i = 0; i < 10; i++) { a += i; } return a; } } class A { }
14-02-2020