3 ms·
That's not really true. Java linking happens very late, and so invoking methods at polymorphic call sites does have more in common with 'dynamic' languages than
by shellac 12y ago
That's not really true. Java linking happens very late, and so invoking methods at polymorphic call sites does have more in common with 'dynamic' languages than you might think. Hotspot has smalltalk roots, and features like inline caching at call sites together with optimistic fast paths, guards, deoptimisation, and other things that would be familiar from, say, a ruby implementation.
- gsnedders 12y agoYes — HotSpot does much of this, but the inability until recently to encode "call this function which expects some number of arguments" in the instruction set has historically been the limiting factor. invokedynamic helps a lot, but it adds enough levels of indirection that AIUI often enough isn't inlined for it to really solve everything. I wonder if a tracing JVM would handle it better? Probably.