Da Vinci Machine - Architecture

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. 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.

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.

Read more about this topic:  Da Vinci Machine

Famous quotes containing the word architecture:

    Poetry is not only dream and vision; it is the skeleton architecture of our lives. It lays the foundations for a future of change, a bridge across our fears of what has never been before.
    Audre Lorde (1934–1992)

    The two elements the traveler first captures in the big city are extrahuman architecture and furious rhythm. Geometry and anguish. At first glance, the rhythm may be confused with gaiety, but when you look more closely at the mechanism of social life and the painful slavery of both men and machines, you see that it is nothing but a kind of typical, empty anguish that makes even crime and gangs forgivable means of escape.
    Federico García Lorca (1898–1936)

    All architecture is great architecture after sunset; perhaps architecture is really a nocturnal art, like the art of fireworks.
    Gilbert Keith Chesterton (1874–1936)