-
Bug
-
Resolution: Fixed
-
P3
-
8, 9
-
None
-
b37
-
generic
-
generic
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8194592 | 11 | Hannes Wallnoefer | P3 | Resolved | Fixed | b01 |
Nashorn has the capability to split initialization of large object and array literals into multiple parts to work around the method size limit in Java. Optimistic types are not supported in initialization of split literals. However, optimistic type assignment currently walks over split literals and assign optimistic types to expressions contained therein. Since generation of optimistic operations within split literals is suppressed in codegen, this leads to failed optimism failing silently at runtime.
The quick fix for this is not to do optimistic type assignment within split literals. A better fix might be to implement split literal initialization using JavaScript functions similar to the way it is done for ordinary code splitting, which would allow us to support optimistic types.
Another lesson from this is that we should have an assertion against optimistic operations being used in a non-optimistic context.
The quick fix for this is not to do optimistic type assignment within split literals. A better fix might be to implement split literal initialization using JavaScript functions similar to the way it is done for ordinary code splitting, which would allow us to support optimistic types.
Another lesson from this is that we should have an assertion against optimistic operations being used in a non-optimistic context.
- backported by
-
JDK-8194592 Expressions in split literals must never be optimistic
-
- Resolved
-