4 ms·
This isn't regular code. This is code for the groovy runtime.
by chrisbroadfoot 16y ago
This isn't regular code. This is code for the groovy runtime.
- Groxx 16y agoSo, why don't the Groovy runtime programmers just write `new Object[]{arg1, arg2...}` ?
- tedunangst 16y agoI suspect this is code meant to be called by generated bytecode, and generating the bytecode to call said function is easier than generating the bytecode to make a new object[]?
- wlievens 16y agoIt's been a while since I generated JVM bytecode (oh my, five years), but I don't recall there being array initializer instructions. In other words, the new Object[] {...} statement probably translates to a whole bunch of array-write operations on the caller side whereas with a method call you just push them all on the stack and invoke the utility method.