4 ms·
I don't know much about compilers, but basically the ones don't have anywhere else to put the context of a closure.
by recursive 7y ago
I don't know much about compilers, but basically the ones don't have anywhere else to put the context of a closure.
- pvg 7y agoI don't think that's what happens in the JVM, you can google up the invokevitual + other supporting gunk/mechanism for this.
- recursive 7y agohttps://docs.oracle.com/javase/specs/jvms/se7/html/jvms-6.html#jvms-6.5.invokevirtual https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-6.ht... makes plenty of references to dispatching based on class.
- pvg 7y agoD'oh, sorry I sent you on a wild goose chase - you want invokedynamic. Invokedynamic and lambdas.