I'm wondering what performance can be expected when composing many small 
MethodHandles, for example composing constant MHs at the granularity of 
"iadd" below:

  public class Instructions {
    public static int iadd(int a, int b) { return a + b; } // ie this is 
placeholder for the lonely instruction "iadd"
    . . . 
  }

The experiment thus involves piecing together all those little MHs (not 
unlike AST building) thus making up the desired functionality (the 
motivation for this is picking bytecodes for primitive types on a 
per-type-instantiation basis, but that's another story). 

Q1: Would the resulting MH be JITted down to native code without invocation 
overhead whatsover?

Q2: If not JITted (but after everything has been resolved) would the 
resulting MH perform in the worst case as the corresponding (statically 
emitted) bytecode?

Q1 and Q2: Never? Sometimes? Always? ("Sometimes" would be tricky because 
then the cost model becomes difficult to reason about).


Miguel
http://lampwww.epfl.ch/~magarcia/ScalaCompilerCornerReloaded/


-- 
You received this message because you are subscribed to the Google Groups "JVM 
Languages" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/jvm-languages/-/PvE1paHKLv4J.
To post to this group, send email to jvm-languages@googlegroups.com.
To unsubscribe from this group, send email to 
jvm-languages+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/jvm-languages?hl=en.

Reply via email to