Self-host: Can't require cljs.js in script/nashornrepljs on Java 9

Description

The below works under Java 8, but not 9:

Likely closely related to CLJS-2530.

Environment

None

Activity

Show:
Mike Fikes
March 23, 2018, 4:51 AM

With Java 10, perhaps another bit was used up:

Mike Fikes
February 19, 2018, 12:20 AM

The JavaScript code produced for (dump-core) is evidently large enough to cause us to hit a limit that existed in JDK 8 but is now more easy to hit with JDK 9:

Specifically see

http://hg.openjdk.java.net/jdk9/jdk9/nashorn/file/17cc754c8936/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/codegen/ProgramPoints.java#l57

and

http://hg.openjdk.java.net/jdk9/jdk9/nashorn/file/17cc754c8936/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/NashornCallSiteDescriptor.java#l156

The limit in question was revised in this changeset http://hg.openjdk.java.net/jdk9/jdk9/nashorn/rev/7cb19fa78763#l48.108

where CALLSITE_PROGRAM_POINT_SHIFT was increased from 11 to 14, reducing MAX_PROGRAM_POINT_VALUE from 21 bits to 18 bits. (2^18 - 1 = 262143)

This is associated with this ticket https://bugs.java.com/view_bug.do?bug_id=8139931

Note that if you read the comments in the JDK code, you can see that there is an assumption that a JavaScript method splitter will have taken a large function and broken it down to sufficiently small chunks to fit within the limits. Perhaps the function generated by ClojureScript isn't amenable to splitting.

Assignee

Unassigned

Reporter

Mike Fikes

Labels