faq
flatforty
contribute
subscribe
configure
search
rdf
main
parent
thread
|
Re: Native code FUD
by Rayiner Hashem on Sunday 08/Aug/2004, @15:30
|
<i>Dynamic compilers do not have such boundaries for optimization. All code is equal for them, because all code is stored in the prefered way for optimization.</i>
Good static compilers have no such boundries either --- LLVM will do inter-library optimization at link time. Also, java or CLR bytecodes are a terrible representation for optimization. Before doing any optimzation on CLR code, Mono first converts it from the stack-oriented CLR model to a virtual-register oriented SSA form.
<i>For example the JavaVM checks whether a virtual method is actually overridden by a class.</i>
Static compilers do this too. For high-performance native compilers for Lisp or Smalltalk, such optimzations are standard operating procedure.
<i>A static compiler can't do optimizations like this, it always has to optimize for the worst case.</i>
No it doesn't. The capability to do optimization in the precense of dynamic code has nothing to do with native code and everything to do with having a compiler available at runtime. Static compilers for Lisp can do these sorts of optimizations, even though they generate native code. |
|
|
The Fine Print: The following comments
are owned by whomever posted them.
( Reply )
|
Re: Native code FUD
by Tim Jansen on Sunday 08/Aug/2004, @15:46
|
"Good static compilers have no such boundries either --- LLVM will do inter-library optimization at link time."
Hmm? I don't know LLVM very well, but I'd call LLVM a dynamic compiler with managed code (their virtual instruction set).
"<i>A static compiler can't do optimizations like this, it always has to optimize for the worst case.</i>
No it doesn't. The capability to do optimization in the precense of dynamic code has nothing to do with native code and everything to do with having a compiler available at runtime."
If they can compile at runtime, I would call them dynamic compilers with managed code. The only difference may be that they don't use an intermediate language, but work directly on the source code.
|
[
Reply To This | View ]
|
Re: Native code FUD
by Rayiner Hashem on Sunday 08/Aug/2004, @18:19
|
"Managed code" and "native code" have rather precise definitions. Managed code is stored as an abstract bytecode, and compiled *on-the-fly* to machine code. Native code is stored as machine code, and executed directly. JIT's and compilers available at runtime blur the lines, but the fundemental distinction is still that JIT's compile on the fly by default, and cache native code as an optimization, while native compilers use native code by default, but make it possible to regenerate that code. Certainly, using the accepted definitions of "native code compiler" and "managed code compiler," Java/C# are managed code platforms, while LLVM/CMUCL/etc are native code platforms.
|
[
Reply To This | View ]
|
|
The Fine Print: The previous
comments are owned by whomever posted them.
( Reply )
|
|