The Great Startup Problem

Mark Roos mroos at roos.com
Sun Aug 24 21:10:47 UTC 2014


I am more of the side that invoke dynamic is awesome for enabling dynamic 
languages on the
JVM.  Given that there are two areas where I can see some help for my use 
case which
is a true Smalltalk on the JVM.

First like Charles I do have a few dependencies on plain old Java methods 
during startup
and run.  The most obvious one is the code which takes the Smalltalk byte 
codes and
converts them to a Java method using ASM.  I doubt that this is ever 
considered hot
but it shows up as a chunk of time every time a method is invoked the 
first time.  This
would probably be solved by an annotation which told hotspot that this POJ 
was always
hot.

Second, my pet request, is for a 'Callsite with PIC' construct in 
invokeDyanmic.  A brief
description of how it would work in my (Rtalk  non Java stack organization 
) would be:
  First extract the methodLookup object from the call stack
   For Rtalk this is a field in the object at the top of the stack.  As 
this is airity
   dependent I provide a pre generated method handle per airity.
  Then walk a list of key values looking for reference match to the 
methodLookup in the keys
   If I find a match jump to that method in the value with the current 
stack
   if no match but the list is not yet full ( I limit it to 10) 
     call the fallback method with the methodLookup and the methodSelector 

     ( a string in my case for the method name) which returns the method 
to call
     insert the method into the list and jump to the method
   If no match and the list if full just drop the list and start over.

>From the Callsite constructor I would provide a methodHandle to extract 
the methodLookup,
a fallback to get the requested method and the selector.   Of course hot 
spot would
inline this from the start.

Currently I implement this with chained GWTs.  I am curious if others pics 
are similar and
could benefit from such a construct

regards
mark


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/mlvm-dev/attachments/20140824/d6f8c054/attachment.html>


More information about the mlvm-dev mailing list