Skip to content

Instantly share code, notes, and snippets.

@rkennke
Created September 20, 2024 12:30
Show Gist options
  • Save rkennke/8a57610d74fcde07a9390f268ec35738 to your computer and use it in GitHub Desktop.
Save rkennke/8a57610d74fcde07a9390f268ec35738 to your computer and use it in GitHub Desktop.
class TestC2Lilliput {
private static Object[] foo;
public static void main(String[] args) throws Exception {
int idx = Integer.parseInt(args[0]);
foo = new Object[100];
foo[idx] = new Object();
Class cls = test(idx);
System.out.println(cls);
}
static Class test(int idx) {
return foo[idx].getClass();
}
}
java -Xcomp -XX:CompileOnly=TestC2Lilliput::test -XX:-TieredCompilation -XX:+PrintAssembly -Xmx20g -XX:HeapBaseMinAddress=100G -Xlog:gc+heap+coops=Debug -XX:+UnlockExperimentalVMOptions -XX:+UseCompactObjectHeaders TestC2Lilliput
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment