uschindler commented on PR #14597:
URL: https://github.com/apache/lucene/pull/14597#issuecomment-2843271854

   > Looks great! It seems like ASM translated relatively well (in this case) 
to the ClassFile API (much of it was just changing imports/methods to call but 
looks very similar).
   
   The hard part was more to understand and figure out how it works. After that 
transforming the Antlr visitor to Classfile API was trivial.
   
   Very hard was that I was unable to figure out how to get a `ConstantDesc` 
which is needed for the bootstrapper from a `String` or `Integer`. I had to 
figure out first that all those classes implement `ConstantDesc` so you can 
just pass the `String` instance as parameter where type `ConstantDesc` is 
expected: 
https://github.com/apache/lucene/blob/938be2a1c313787bb31c6a5b9fde61b1e0025161/lucene/expressions/src/java/org/apache/lucene/expressions/js/JavascriptCompiler.java#L436
   
   
![image](https://github.com/user-attachments/assets/c40eb0d9-0c7d-4020-a6cb-fcbf7d405897)
   
   There are still some nice goodies missing in Classfile API:
   - No replacement for `GeneratorAdaptor#loadArgs` and a better named function 
like `GeneratorAdaptor#loadThis` (as synonmy for `aload(0)`). This would make 
the typical pass all parameters automatically to the invoke super call in ctors 
or overridden methods.
   - More methods with `TypeKind` to also generate compare code without knowing 
the exact tyes.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to