Please sign in to comment.
Compiler+genclass: emit jdk8 classfiles
Enabling JDK7+ bytecode requires stack map frames to be emitted. ASM generates these automatically when given a flag. To enable faster single pass verification, java uses stack map frames, which record stack contents at just before the first instruction at a target branch. The verifier easily tracks stack content within a basic blocks. ASM requires that you override getCommonSuperClass(t1, t2) as its default implementation does classloading and does not work for Clojure. If you have code like so: (or (seq coll) ()) :foo immediately before :foo control flow merges with two different types on the stack depending on the result of the or branch. ASM calls getCommonSuperClass() to record into the stack map frame. Luckily, because Clojure emits checkcasts conservatively before subsequent calls, we do not have to provide maximally specific answers to getCommonSuperClass(), instead we can return Object every time. We may want to revisit this when LWorld value types happen, or when generic specialization is available. Signed-off-by: Stuart Halloway <email@example.com>
- Loading branch information...
Showing with 24 additions and 11 deletions.