• Icon: Sub-task Sub-task
    • Resolution: Fixed
    • Icon: P2 P2
    • 8
    • 8
    • core-libs
    • 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.

            hannesw Hannes Wallnoefer
            jlaskey Jim Laskey
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: