Created
June 9, 2015 21:00
-
-
Save chriswhocodes/bfe139592adb846967d8 to your computer and use it in GitHub Desktop.
Example JavaScript that dumps different bytecode with Nashorn 8u60b18 and 9b67
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sum = 0; | |
for (var i = 0; i < 1000000; i++) | |
{ | |
sum = addOne(sum); | |
sum = addTwo(sum); | |
} | |
print(sum); | |
function addOne(number) | |
{ | |
return add(number, 1); | |
} | |
function addTwo(number) | |
{ | |
return add(number, 2); | |
} | |
function add(x, y) | |
{ | |
return x + y; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment