Re: where is the LINK/LOAD module when using Java

From: John C. Bollinger (jobollin_at_indiana.edu)
Date: 02/27/05


Date: Sun, 27 Feb 2005 14:51:35 -0500

TonY wrote:

> Theoritically, the files get translated into object code by the
> compiler, the linker then group all the object modules into one
> module, the loader load it into the memory.

Whose theory is that? Yours? You describe a very common language
implementation pattern, but it is by no means universal and it has
nothing to do with theory. Consider interpreted languages. Or, as it
happens, Java (see below).

> however, when i compile java files, i find only .class (thus,more and
> less, object files), but no trace to the linked module and load
> module.

Well, yes, a .class file is the closest approximation to an object file
that is a standard output of a Java implementation. It is _not_ an
object file, however, as it does not contain instructions directly
interpretable by the platform CPU.

> will this be done automatically later by the interpreter and/or JIT?

Modern Java virtual machines are not well described as interpreters, in
part because they do perform JIT compilation.

Runtime class loading and linking is the specified behavior of a
compliant Java implementation, so to that extent, yes, the VM performs
these operations, but you will not typically find a persistent
representation of a "link module" or a "load module". You will also
find, if you read the Language and VM specs, that "linking" and
"loading" may not mean precisely the same thing in a Java context that
they do in, for example, a compiled C++ context.

> why such JAVA implementation?

It supports Java's goal of being cross-platform. It provides excellent
modularity. It makes the VM a central point of optimization so that
improving the VM can improve the performance of all programs that run on
it, immediately, without change to the programs themselves. Probably
other reasons as well.

> With C++, we can find link module, and
> load module

So? Your point is that C++ is different from Java? That's no news here.

-- 
John Bollinger
jobollin@indiana.edu


Relevant Pages

  • Off Topic: linker: does it skip unused functions?
    ... The typical link editor will load ... The typical link editor loads the entire object file. ... Please tell us which compiler and operating system you are using ...
    (comp.lang.c)
  • Re: Cpp Considered Harmful
    ... >> programming language, the compiler, the IDE, the libraries, etc. ... source file, the implementation shall locate the declaration, (and ... to name one of the defining source files on the command line that initiates ... The counterpart to this in Java is accomplished using the following: ...
    (comp.lang.cpp)
  • Re: wie Array für statische Methoden
    ... > auf gar keinen Fall Java empfehlen;) ... Ich hab mal mit virtuellen Methoden auf einem Microkontroller experimentiert und bin zu dem Schluss gekommen: ... > Es ist ja gerade der Vorteil bei Java einen Compiler ... > Dinge zu optimieren, ...
    (de.comp.lang.java)
  • Re: What is the fastest method of parsing scheme?
    ... These issues can be eliminated by the use of custom memory allocators ... Any other ideas why Scheme would be faster than C++ and Java for heap ... For example, in my compiler, the procedure ) ...
    (comp.lang.scheme)
  • Re: A 21st Century Apple II?
    ... Java 6 -Xms64m 24.00s ... Which is actually 9.6% better than the C++ Intel compiler. ... I'm sure in some cases the GNU compiler produces better results. ...
    (comp.sys.apple2)