2005/5/11, 王在祥 <[EMAIL PROTECTED]>: > > ok. the JIT output native machine code, then it is the JVM runtime to > execute it. > > JVM = (Java Source) --compile-to- (byecode) -- precompile-to- (Nativecode) > > (User Java Code) --compile-to- (Bytecode) > > the JVM now load bytecode, calls the JIT to translate it native code, and > execute the native code. > > So how the JVM execute the native code? it is compiled by the JIT compiler > also, but it looks that it is something magic. >
Hi, I'm new here... AFAIK, this is the process: javac = (Java Source) --compile-to-- (Bytecode) java (no-jit) = (Bytecode [classes]) --compile-to-- (Native code) java (jit) = (Bytecode [methods]) --compile-to- (Native code) --when-needed-- The difference is that non-JIT VM will compile to native code an entire class as soon as it's loaded, while JIT VM will compile to native code only single methods when some one use them. In both cases, at this time you will have inside the VM a piece of native code, wich is not so different from a classic c/c++ compiled executable. It will be loaded in memory, and executed. best regards Raffaele
