flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
TmX 08 Mar 2007, 09:55
I don't think there is such assembler, since Java prog runs on JVM. But who knows ??
|
|||
![]() |
|
f0dder 08 Mar 2007, 11:13
There's a GCC frontend for compiling JAVA to native code... but... ugh
![]() |
|||
![]() |
|
TmX 08 Mar 2007, 11:19
ah you mean GCJ ?
ah I almost forget that ... Let's see ... This is a simple code Code: public class Foo { public static void main(String args[]) { for (int x = 0; x < 10; x++) System.out.println("Blah blah blah"); } } Compiled using : gcj -S Foo.java, the result is : Code: .file "Foo.java" .stabs "/cygdrive/d/",100,0,0,Ltext0 .stabs "Foo.java",100,0,0,Ltext0 .text Ltext0: .stabs "gcc2_compiled.",60,0,0,0 .stabs "java.lang.Class:T(0,1)=s120!1,020,(0,2)=xsjava.lang.Object:;next:/0(0,3)=*(0,1),32,32;name:/0(0,4)=*(0,5)=s4hash:(0,6)=@s16;r(0,6);0;65535;,0,16;length:(0,6),16,16;;,64,32;accflags:/0(0,6),96,16;superclass:/0(0,3),128,32;constants:/0(0,7)=s12size:(0, uuuhhh ..... ![]() |
|||
![]() |
|
f0dder 08 Mar 2007, 11:37
Yeah, there's a reason I said "ugh"
![]() |
|||
![]() |
|
r22 08 Mar 2007, 14:38
I'd think compiling java into native code wouldn't be too optimal *OF course it would be faster than JVM run code but* all of the packages and cann'd libraries java uses for linkedlists and what not probably aren't the most efficient when the are converted from java straight to native code.
When I was working on radixsort my initial implementation was in java then I ported it to assembly. (so I ended up with the fastest unsigned integer sorts in java and x86 asm). |
|||
![]() |
|
f0dder 08 Mar 2007, 15:47
Why "of course"?
While current implementations might not be "quite there yet", hotspot JITting can at least theoretically be done pretty well... |
|||
![]() |
|
r22 08 Mar 2007, 21:38
When theory turns into practice I'll make an effort to retract my statement
![]() I was simply speaking from my own experience on the subject. I've coded things in java then directly ported them to assembler, what may be the fastest possible java implementation doesn't equal the fastest native code. BUT even if the assembler code had A LOT of room for improvement it would still run at least 3x faster than the java code. In an automated system, this problem is pretty much dependent on the optimization logic of the JIT compiler. To make sense of that rambling, I library coded natively will ALMOST ALWAYS IMHO run faster than a java library compiled into native code. Say your taking java source files or even java bytecode and running it through a java 2 native code compiler. The src/bytecode won't have any compiler hints so it'd be very difficult for the compiler to optimize the code to it's best ability. This is true even now with c/c++ with parallel execution, SIMD, or even loop unrolling. |
|||
![]() |
|
radoslavkirilov 10 Mar 2007, 11:24
Maybe a .java to .exe compiler will use a java to assembler procedures as a part of creating a real executable.
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.