-
Sub-task
-
Resolution: Fixed
-
P2
-
8
-
None
-
b100
-
generic
-
generic
-
Verified
Using jjs to generate code with
function name(i) {
var n = "";
do {
n = "abcdefghijklmnopqrstuvwxyz".charAt((i - 1) % 26) + n;
i = Math.floor(i / 26);
} while (i != 0);
return n;
}
print("var x = {");
for (var i = 1; i < 26*26*26; i++) {
print(" " + name(i) + ": " + i + ",");
}
print("};");
print("print(x.aaa);");
It's easy to create a test that yields
Exception in thread "main" java.lang.RuntimeException: Method code too large!
We should at least see if we can address this by splitting the literal initialization across methods. Also fails on Rhino, but okay on V8.
function name(i) {
var n = "";
do {
n = "abcdefghijklmnopqrstuvwxyz".charAt((i - 1) % 26) + n;
i = Math.floor(i / 26);
} while (i != 0);
return n;
}
print("var x = {");
for (var i = 1; i < 26*26*26; i++) {
print(" " + name(i) + ": " + i + ",");
}
print("};");
print("print(x.aaa);");
It's easy to create a test that yields
Exception in thread "main" java.lang.RuntimeException: Method code too large!
We should at least see if we can address this by splitting the literal initialization across methods. Also fails on Rhino, but okay on V8.