Use invokedynamic to implement multiple dispatch

后端 未结 2 525
长情又很酷
长情又很酷 2021-02-06 04:29

I wondered if Java7\'s new invokedynamic bytecode instruction could be used to implement multiple dispatch for the Java language. Would the new API under java.lang.

2条回答
  •  执念已碎
    2021-02-06 05:10

    Since I have no experience with invokedynamic, I do not know how good the performance and type-safety would be, but can only give some pointers:

    • the Da Vinci Machine Project offers multiple dispatch via invokedynamic (see Multiple Dispatch/src/invokedynamicmultipledispatch/);
    • Charles Oliver Natter has talked about applications of invokedynamic on JAX2012. The slides do not go into details at all, but I think I came across more details in a video or podcast talking about JAX2012, which I cannot find right now.
    • Christopher Dutchyn's JVM Multiple Dispatch is an alternative approach without invokedynamic. His COOTS '01 Paper and these slides have a lot of performance information/benchmarking (and are a good read after you've finished your disseration ;)

提交回复
热议问题