Da Vinci Machine

Da Vinci Machine
Multi Language Virtual Machine
Developer(s) Sun Microsystems
Operating system Cross-platform
Type Library
License GPL+linking exception
Website openjdk.java.net/projects/mlvm

The Da Vinci Machine, also called the Multi Language Virtual Machine is a Sun Microsystems project aiming to prototype the extension of the Java Virtual Machine to add support for dynamic languages.

It is already possible to run dynamic languages on top of the JVM, but the goal is to ease new dynamic language implementations and increase their performance. This project is the reference implementation of JSR 292 (Supporting Dynamically Typed Languages on the Java Platform)[1].

Contents

History

Java virtual machine architecture.svg

The Java Virtual Machine currently has no built-in support for dynamically typed languages:

JSR 292 (Supporting Dynamically Typed Languages on the Java Platform)[1] proposes to:

  • add a new invokedynamic instruction at the JVM level, to allow method invocation relying on dynamic Type checking[3],
  • to be able to change classes and methods at runtime dynamically in a production environment.

Following the success of the JRuby Java implementation, the Da Vinci project was started at the end of January 2008.[4] The capabilities experimented by Da Vinci are planned to be added to Java 7. It aims to prototype this JSR, but also other lower-priority extensions.[5] The first working prototype, developed as a patch on OpenJDK, was announced and made available on end of August 2008.[6][7][8]

Since then, the JRuby team has successfully wired dynamic invocation in their codebase. Dynamic invocation shipped with the 1.1.5 release, and will be disabled on JVMs without invokedynamic capabilities.[9]

Since then, part of the project has already been integrated in the upcoming JDK 7 codebase.[10] and integrated in the Java 7 release.

Architecture

Dynamic invocation is built on the fact that, even if Java is a strongly static language at the language level, the type information is much less prevalent at the bytecode level.

However, dynamic languages implementations need to be able to use Just-in-time compilation (rather than reflection) to achieve a good performance, and so to compile scripts to bytecode at runtime.[citation needed] To be allowed to be run by the Java Virtual Machine, these bytecodes must be verified prior to the execution, and the verifier check that the types are static throughout the code. It leads to these implementations having to create many different bytecodes for the different contexts of a method call, each time the signature of the arguments change.

This not only uses a lot of memory, but also fills a memory area called Permanent Generation, a part of the heap used by the JVM to store information about Classes. Memory used in this area is never Garbage collected because it stores immutable data in the context of Java programs; and because of that, dynamic languages implementations can only compile a small part of the scripts[11].

JSR 292 proposes to:

  • provide a mechanism whereby an existing class can be loaded and modified, producing a new class with those modifications but sharing the rest of its structure and data, thus not filling the Permanent Generation space,
  • provide the new invokedynamic bytecode which allows the JVM to optimize these kind of calls[3].

See also

References

  1. ^ a b see JSR 292
  2. ^ Nutter, Charles (2007-01-03). "InvokeDynamic: Actually Useful?". http://headius.blogspot.com/2007/01/invokedynamic-actually-useful.html. Retrieved 2008-02-06. 
  3. ^ a b Ed Ort (July 2009). "New JDK 7 Feature: Support for Dynamically Typed Languages in the Java Virtual Machine". http://java.sun.com/developer/technicalArticles/DynTypeLang/index.html. Retrieved 2009-07-26. 
  4. ^ Krill, Paul (2008-01-31). "Sun's Da Vinci Machine broadens JVM coverage". http://www.infoworld.com/article/08/01/31/davinci-machine_1.html. Retrieved 2008-02-06. 
  5. ^ "Sub-Projects and Investigations". Sun Microsystems. 2007. http://openjdk.java.net/projects/mlvm/subprojects.html. Retrieved 2008-02-06. 
  6. ^ Rose, John (2008-08-26). "Happy International Invokedynamic Day!". http://blogs.sun.com/jrose/entry/international_invokedynamic_day. Retrieved 2008-09-03. 
  7. ^ Rose, John (2008-09-02). "Happy International Invokedynamic Day!". http://mail.openjdk.java.net/pipermail/mlvm-dev/2008-September/000190.html. Retrieved 2008-09-07. 
  8. ^ Lorimer, R.J. (2008-09-01). "Dynamic Invocation Runs on OpenJDK". infoq.com. http://www.infoq.com/news/2008/09/invokedynamic_day. Retrieved 2008-09-03. 
  9. ^ Nutter, Charles (2008-09-11). "A First Taste of InvokeDynamic". http://blog.headius.com/2008/09/first-taste-of-invokedynamic.html. Retrieved 2008-09-13. "I managed to successfully wire InvokeDynamic directly into JRuby's dispatch process! Such excitement! The code is already in JRuby's trunk, and will ship with JRuby 1.1.5 (though it obviously will be disabled on JVMs without InvokeDynamic)." 
  10. ^ Rose, John (2009-04-22). "progress: indy.patch -> JDK7". http://mail.openjdk.java.net/pipermail/mlvm-dev/2009-April/000475.html. Retrieved 2009-04-30. "The majority of indy.patch has entered the JDK7 VM at my workgroup's integration repo, today at about 4:00AM PDT:" 
  11. ^ Nutter, Charles (2008-09-11). "A First Taste of InvokeDynamic". http://blog.headius.com/2008/09/first-taste-of-invokedynamic.html. Retrieved 2008-02-06. "The dirty secret of several JVM implementations, Hotspot included, is that there's a separate heap (or a separate generation of the heap) used for special types of data like class definitions, class metadata, and sometimes bytecode or JITted native code. And it couldn't have a scarier name: The Permanent Generation. Except in rare cases, objects loaded into the PermGen are never garbage collected (because they're supposed to be permanent, get it?) and if not used very, very carefully, it will fill up(...)" 

External links


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • Machine gun — [ thumb|200px|An illustration of later model 19th century Gatling gun. It was a multi barreled rotary machine gun fired via a manual crank, which mechanically loaded and primed cartridges from the hopper above the gun] : For other uses of the… …   Wikipedia

  • Machine de l'Île — Les Machines de l île 47°12′22,11″N 1°33′51,70″O / <span class= geo dec geo title= Cartes, vues aériennes et autres données pour Erreur d’expression : caractère de ponctuation « , » non reconnu Erreur d’expression :… …   Wikipédia en Français

  • Da Vinci (disambiguation) — Da Vinci usually refers to Leonardo da Vinci (1452–1519), Italian Renaissance polymath. It may also refer to: Contents 1 Places 2 Ships 3 Television 4 Technology …   Wikipedia

  • Java Virtual Machine — A Java Virtual Machine (JVM) is a set of computer software programs and data structures which use a virtual machine model for the execution of other computer programs and scripts. The model used by a JVM accepts a form of computer intermediate… …   Wikipedia

  • De vinci — Léonard de Vinci Pour les articles homonymes, voir Vinci. Léonard de Vinci …   Wikipédia en Français

  • Leonard De Vinci — Léonard de Vinci Pour les articles homonymes, voir Vinci. Léonard de Vinci …   Wikipédia en Français

  • Leonard de Vinci — Léonard de Vinci Pour les articles homonymes, voir Vinci. Léonard de Vinci …   Wikipédia en Français

  • Leonardo Da Vinci — Léonard de Vinci Pour les articles homonymes, voir Vinci. Léonard de Vinci …   Wikipédia en Français

  • Leonardo da Vinci — Léonard de Vinci Pour les articles homonymes, voir Vinci. Léonard de Vinci …   Wikipédia en Français

  • Léonard De Vinci — Pour les articles homonymes, voir Vinci. Léonard de Vinci …   Wikipédia en Français

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”