Details
-
Type:
Task
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Completed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
The red black tree balance pattern mentioned by tgk generates enough code that the JVM will not inline it. Maranget's algorithm basically implements backtracking by passing along wildcard matches with actual matches. For non-overlapping patterns like the red black tree balance pattern this means exponential code size.
For such patterns where none of the actions involve recur we could implement backtracking with a pre-allocated exception.
http://blogs.oracle.com/jrose/entry/longjumps_considered_inexpensive
Fixed now in master.