Setup for the lab
Try to get the following setup to run on your computer. If you encounter any issues and get stuck, I will try to help at the beginning of the lecture.
You will need the following:
-
GraalVM JDK. Both community edition (CE) or enterprise edition (EE) will work fine. Change the Java SDK setting in your IDE to point to the GraalVM installation. IntelliJ can download and setup GraalVM CE directly from the settings dialog (Open settings with CTRL+ALT+S, seach for string “SDK”, choose to download GraalVM CE, see also the guide to running Java applications on GraalVM from an IDE).
-
Ideal Graph Visualizer. Use this download link. An open-source alternative is Seafoam.
To try the example from the last lecture, put the following java code in compilation.java
:
class Program {
public static void main(String[] args) {
int a = 0;
while (true) {
workload();
}
}
private static int workload(int a, int b) {
return a + b * 2;
}
}
And then run the following command:
/path/where/I/installed/GraalVM/bin/java -XX:+PrintCompilation -XX:CompileOnly=Program::workload -XX:-Inline -Dgraal.Dump=:1 -Dgraal.PrintGraph=Network compilation.java
Coding task
The coding task for this lab is to implement the RootNodeExplodeLoopAndFold.execute()
and
the RootNodeProfileCondition.execute()
methods according to the JavaDoc documentation in
those classes.
This assignment is worth 4 points and will be assessed by a human, but you can use the IGV tool to verify that the compiler graphs produced from the code match the specification.
If you have any questions regarding the coding task, feel free to post an issue in the Forum.
The deadline for completing the implementation is Tuesday, April 4 2023, 14:00.