Skip to content

Instantly share code, notes, and snippets.

@schmee
Last active April 25, 2018 18:56
Show Gist options
  • Save schmee/3bb6b0dc95073ab5eadb1cc6dcd0f24a to your computer and use it in GitHub Desktop.
Save schmee/3bb6b0dc95073ab5eadb1cc6dcd0f24a to your computer and use it in GitHub Desktop.
Graal escape analysis test
function add(a, b) {
c = new();
c.x = a.x + b.x;
c.y = a.y + b.y;
return c;
}
function main() {
a = new();
a.x = 1;
a.y = 2;
b = new();
b.x = 2;
b.y = 4;
i = 0;
while (i < 100000000) {
a = add(a, add(a,b));
i = i + 1;
}
println(a.x);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment