Wednesday Aug 04, 2010

after the deluge: how to tidy an overflow

Joe Darcy has posted a fine note on the problem of managing integer overflow in Java. This was raised again last week at the JVM Language Summit. Joe’s blog has already attracted some good comments. Here is my comment, which has inflated itself into a blog entry of its own.

The problem is to take two machine words, do a common arithmetic operation on them, and obtain the arithmetically correct results. In particular, it means that at least one bit must be collected besides the machine word of non-overflowing result data. For example (as Joe notes), the extra bit required to report overflow could be implied by an exceptional return. In any case, there are a couple of degrees of freedom in this problem: What we will use the extra bit(s) for, and how to deliever it (or them). After examining a couple of half measures, I will enumerate about ten ways to return normally with a pair of machine words. [Read More]

Wednesday Jul 21, 2010

an experiment with generic arithmetic

Most computer languages let you add two numbers together. This is harder than it looks, since numbers come in a variety of formats, starting with fixed-point vs. floating-point. The logic for numeric addition has to classify its operands, perhaps coerce them to a common format, and then switch to the correct algorithm for that format. Invokedynamic allows the JVM to separately customize and optimize such arithmetic operations, according operand types and context. To put this theory into practice, I tried a first experiment combining invokedynamic with Kawa, a mature implementation of Scheme on the JVM... [Read More]

Thursday Jun 24, 2010

JVM Language Summit agenda is posted

… Next month, we are once again gathering a room full of language and VM developers at Oracle’s Sun Santa Clara Campus, for the three-day meeting known as the JVM Language Summit. This year (like before) we have an excellent set of speakers lined up. I have just posted the agenda…[Read More]

Wednesday Nov 25, 2009

tailcalls meet invokedynamic

It is Autumn, and tail recursion is in the air. A JSR 292 colleague, Samuele Pedroni, just raised the question of how invokedynamic might interact with a tail call feature in the JVM. Here are a few thoughts on that subject, which I hope will provoke further discussion. The first few are (I think) not very controversial, but I try to get a little crazy toward the end. Where, do you suppose, is the boundary? [Read More]

Tuesday Nov 10, 2009

VMIL paper on invokedynamic

I have written a paper for VMIL '09 on invokedynamic, which my fellow JVM and JIT geeks may find interesting:
Bytecodes meet Combinators: invokedynamic on the JVM
John Rose, VMIL '09 Workshop at OOPSLA, Orlando, October 2009

The focus of the paper is on evaluating the architectural effect of adding invokedynamic to JVM bytecodes. The description of JSR 292 is partial and provisional but I expect the part I have described is mostly stable. There is a lot of overview of (a) current implementation techniques for JVM languages, (b) how these techniques adapt to invokedynamic, and (c) how a JVM might optimize invokedynamic. The treatment is not specific to HotSpot. I hope it is useful to JVM teams and to dynamic language implementors.

Thursday Sep 17, 2009

Thursday at the Summit

Start with one generously sized conference room. Fill it to capacity with language and VM implementors. Stir vigorously for three days, folding in talks and workshops in successive layers. Garnish with professional videography. Yield: One JVM Language Summit, about 80 servings.

It's been wonderful so far, and I'm looking forward to the final day tomorrow. You can see what we've been talking about by clicking on the talk links in the agenda; most of the slide decks are uploaded there...[Read More]

Monday Jul 27, 2009

only 36 shopping days until the JVM Language Summit

If you (like me) are someone who actually enjoys contemplating the details of how languages turn into bytecodes and thence into wicked-fast machine code... If you lose sleep wondering about the joint future of programming languages and managed runtimes (especially the JVM)... If you think VM and language designers can save the world from a dystopian future of multi-core computers with no software to run on them... Please read the enclosed Call for Participation![Read More]

Thursday Jun 04, 2009

Thursday at JavaOne

Christian Thalinger, Charlie Nutter, and I just finished a talk (my last of three!), called JSR 292 Cookbook. Thanks for your help, guys!

...I have posted the slides. The code examples are also on-line.[Read More]

Tuesday Jun 02, 2009

Tuesday at JavaOne

It has been a busy day, of course. For those interested, I have posted the talk Brian Goetz and I gave on the Da Vinci Machine Project. We divided our attention between a “grand vision” of what VMs are and where they are going, and the exciting particulars of how invokedynamic and method handles work...[Read More]

Monday Jun 01, 2009

at CommunityOne

Today’s talk at CommunityOne (San Francisco) about the Da Vinci Machine Project surveyed the history and status of the project to date. In the same spirit, I have updated the project page to include more pointers to recent talks, including my three talks this week at JavaOne. See you there!

Wednesday Apr 15, 2009

Lang.NET Symposium

I'm enjoying Microsoft's Lang.NET Symposium. Lars Bak just told us about the V8 JavaScript engine. As usual with his work, the virtues are overall simplicity, with a few careful choices about what to optimize. (The recipe is fixnums + stateful Self-like hidden classes + monomorphic inline caches + generational GC + simple JIT.) Here's the slide deck for my talk (up next) on new JVM features.

May 8 update: After the conference I enjoyed a video chat with Charles Torre of Microsoft Channel 9 about the Da Vinci Machine Project. Charles has posted a number of very good interviews from Lang.NET; check out those with Lars, Gilad, Anders, and Erik. Also, the Lang.NET organizers have posted synchronized slides and audio of the talks.

Wednesday Mar 25, 2009

PyCon VM summit

I was at the PyCon VM summit; it was great! There were about 20 talks (in the 10-20 minute range). Since "Sun" comes late in the alphabet, I had the pleasure of watching my fellow summiteers go first. When everybody was good and tired, I gave a presentation on the Da Vinci Machine Project. Here are some notes on a few of the other talks...[Read More]

Monday Feb 16, 2009

simple Java linkage: an invokedynamic apéritif

JSR 292 is adding a fifth invocation instruction, invokedynamic. Like the other four invocation instructions, it is statically typed. What is new is that an invokedynamic instruction is dynamically linked under program control. In this blog, I will be giving “recipes” to demonstrate some of its applications. For today, here is a light aperitif showing how invokedynamic could be used to simulate the other invocation instructions. Caution: This blog post is for people who enjoy their bytecodes full strength and without mixers.[Read More]

Wednesday Oct 01, 2008

the view from the Summit

Last week some Sun engineers and I invited our colleagues over to Sun Santa Clara to talk about the future of VMs and languages. We called the meeting the JVM Language Summit. It was a blast; I’d like to tell you why, and what I learned.

Pizza with extra MOP

Here are my top-level takeaways:

  • The invokedynamic design is sound, but the exposition needs more work.
  • The synergy of JSR 292 with Attila Szegedi’s MOP looks very promising.
  • Interface injection is going to be helpful to a lot of people, and it is not hard to implement (on top of method handles).
  • Tailcall and value types will never go away. We have to plan for them.
  • Unless we do this sort of innovation on the JVM, crucial multicore research will move elsewhere.
  • We have to do this again next year.
[Read More]

Tuesday Aug 26, 2008

Happy International Invokedynamic Day!

I have been working furiously this summer, patching the OpenJDK HotSpot JVM for the JSR 292 implementation of dynamic invocation.

In the wee hours of this morning, the JVM has for the first time processed a full bootstrap cycle for invokedynamic instructions, linking the constant pool entries, creating the reified call site object, finding and calling the per-class bootstrap method, linking the reified call site to a method handle, and then calling the linked call site 999 more times through the method handle, at full speed. The method names mentioned by the caller and the callee were different, though the signatures were the same. The linkage was done by random, hand-written Java code inside the bootstrap methdod.

The Email thread of the announcement is truly international, since Guillaume Laforge celebrated by sending virtual champagne.

The example code is included in the Email, and also posted (as a truly rebarbative test in a NetBeans project) with the patches. As for the JVM code, it only works on x86/32; the next step is to move the assembler code into the right files, and finish the support for x86/64 and SPARC.

Happy International Invokedynamic Day!

(And by a curious anagrammatic permutation of letters, it could also be International Davinci-Monkey Day. My co-workers, who watched me pounding on my keyboard all summer, claim to see some significance in this.)


John R. Rose

Java maven, HotSpot developer, Mac user, Scheme refugee.

Once Sun and present Oracle engineer.


« July 2016