Re: Java (bytecode) execution speed



On Apr 30, 3:48 pm, Lee <l...@xxxxxxxxx> wrote:
I had thought that bytcode was, so to speak,
the "machine code" of the Java Virtual machime.

It is.


If that were true, I can't see how there would be any room


The Java Virtual Machine Specification is a precise document
on the meaning of bytecodes. So JIT compilers simply
attempt to produce native binaries that have the same behavior
as the bytecode.

I don't see how the JVMS prevents that.


(or any need) for further compilation of the byte code.


The need is speed. Interpretation is much slower
than native execution.

But if the bytecode were just a portable abstraction, something "above"
the JVM's machine language but "below" the java source language

No. The byte code is the native machine code of the JVM.

My problem is that in my conception, when it is a question of running a
virtual machine, the "compilation" would be to that vm's "machine"
language

The JIT does not compile to to the VM's machine language.
In fact, the JIT always compiles to the CPU's machine language.


and thats as "low" as you could go.


Why? The JVM itself has full access to the Operating System
that the JVM is running on. Whenever you have native methods
(eg. some of the GUI methods and the IO methods...), the JVM
will have to invoke the corresponding services from the Operating
System.

So, a JVM could invoke a JIT to translate frequently-executed code
into a suitable binary format that the OS can execute.

I see no problem there. (And as you noted, there are many
powerful Java JIT out there)

- JT


.



Relevant Pages

  • Re: Making Lisp popular - can it be done?
    ... native code compilers. ... Lisp conference/meeting. ... My Clojure program took around 105 msecs and the Java code did the job ... I would like to run my tests in that JVM then. ...
    (comp.lang.lisp)
  • Re: Genetic Programming and Machine Language
    ... around with genetic programming a bit. ... performance gains associated with working directly with machine language ... generated JVM instruction sequences. ... on information helping the developer track down the cause. ...
    (comp.lang.java.programmer)
  • Re: Java (bytecode) execution speed
    ... Java Virtual machime. ... Early implementations of Java interpreted it; ... native machine language, and let the processor run that native machine ... There is no JVM machine language. ...
    (comp.lang.java.programmer)
  • Re: Making Lisp popular - can it be done?
    ... The JVM can potentially outperform native compilers. ... and rewrite the code in such a way that it will perform better. ... Currently I haven't seen a JVM based Lisp ...
    (comp.lang.lisp)
  • Re: a history question
    ... >> compile to Intel's machine language and execute on Microsoft's ... Microsoft wrote their own JVM, ...
    (comp.lang.cobol)