Skip to content

Instantly share code, notes, and snippets.

@navyxliu
Created January 29, 2021 20:46
Show Gist options
  • Save navyxliu/26d46b26fd58086014dbf0576154d23d to your computer and use it in GitHub Desktop.
Save navyxliu/26d46b26fd58086014dbf0576154d23d to your computer and use it in GitHub Desktop.
//java -XX:+PrintCompilation -XX:CompileOnly=OSR::main -XX:CompileCommand=quiet -XX:-TieredCompilation OSR
import java.io.FileWriter; // Import the FileWriter class
import java.io.IOException; // Import the IOException class to handle errors
class OSR {
public static void main(String[] args) throws IOException {
FileWriter writer = new FileWriter("/dev/null");
for (int i=0; i<3_000_000; ++i) {
writer.write(".");
}
writer.close();
}
}
@navyxliu
Copy link
Author

java -XX:+PrintCompilation -XX:CompileOnly=OSR::main -XX:CompileCommand=quiet OSR
325 1 % 3 OSR::main @ 12 (35 bytes)
330 2 3 OSR::main (35 bytes)
521 3 % 4 OSR::main @ 12 (35 bytes)
536 1 % 3 OSR::main @ 12 (35 bytes) made not entrant
6113 3 % 4 OSR::main @ 12 (35 bytes) made not entrant

@navyxliu
Copy link
Author

here is c2-only case. only OSR compilation happens.

java -XX:+PrintCompilation -XX:CompileOnly=OSR::main -XX:CompileCommand=quiet -XX:-TieredCompilation OSR
105 1 % OSR::main @ 12 (35 bytes)
6142 1 % OSR::main @ 12 (35 bytes) made not entrant

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment