JWS - Problems with native compile. HELP?
I am trying to compile the native library in JavaWebServer1.1.3 using the instructions from the blackdown site. I applied the diffs by hand. When I try to compile make complains about errors in Makefile.lnx. [root@zaragoza native]# (cd native; make -f Makefile.lnx install) bash: native: No such file or directory Makefile.lnx:45: *** missing separator. Stop. Here is Makefile.lnx with line numbers: ### 1 # @(#)Makefile.sol 1.11 97/11/06 2 # 3 # Solaris-specific makefile for building optional native library support. 4 # Use this as a starting point for porting to other UNIX platforms. 5 # 6 7 # Path to top of Java Web Server distribution tree 8 TOP = .. 9 10 # Name of the library we're making (given to System.loadLibrary) 11 LIBNAME = server 12 13 # Location of Java Developer's Kit (and runtime) 14 JAVA_HOME =/usr/local/jdk117 15 16 # Java runtime flags 17 JAVAH =$(JAVA_HOME)/bin/javah 18 CLASSPATH = $(TOP)/classes:$(TOP)/lib/classes.zip:$(JAVA_HOME)/classes:$(JAVA_HOME)/lib/clas ses.zip 19 20 # OS and machine type 21 OS = genunix 22 ARCH = unknown 23 OBJ = $(OS)/$(ARCH) 24 25 # Preprocessor, compiler, linker, and related flags 26 CC = cc 27 CFLAGS = -shared -fPIC 28 CPPFLAGS = -I$(OS) -I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/$(OS) 29 LDFLAGS = #-G -h $(LIBNAME) 30 INSTALL = /usr/bin/install 31 32 LIBDIR = $(TOP)/lib/$(OBJ) 33 34 LIBRARY = $(OBJ)/lib$(LIBNAME).so 35 OBJS = $(OBJ)/server.o \ 36$(OBJ)/UNIXUser.o \ 37$(OBJ)/UNIXUserEnumeration.o \ 38$(OBJ)/com_sun_server_ServerProcess.o \ 39$(OBJ)/com_sun_server_realm_unix_UNIXUser.o \ 40$(OBJ)/com_sun_server_realm_unix_UNIXUserEnumeration.o 41 42 default all: $(LIBRARY) 43 44 $(LIBRARY): $(OBJS) 45$(LINK.c) -o $@ $(OBJS) 46 47 $(OBJ)/server.o: server.c $(OS)/com_sun_server_ServerProcess.h 48$(COMPILE.c) -o $@ server.c 49 50 $(OBJ)/UNIXUser.o: UNIXUser.c $(OS)/com_sun_server_realm_unix_UNIXUser.h 51$(COMPILE.c) -o $@ UNIXUser.c 52 53 $(OBJ)/UNIXUserEnumeration.o: UNIXUserEnumeration.c \ 54$(OS)/com_sun_server_realm_unix_UNIXUserEnumeration.h 55$(COMPILE.c) -o $@ UNIXUserEnumeration.c 56 57 58 $(OBJ)/com_sun_server_ServerProcess.o: $(OS)/com_sun_server_ServerProcess.c 59$(COMPILE.c) -o $@ $(OS)/com_sun_server_ServerProcess.c 60 61 $(OS)/com_sun_server_ServerProcess.c: 62$(JAVAH) -d $(OS) -classpath $(CLASSPATH) -stubs com.sun.server.ServerP rocess 63 64 $(OS)/com_sun_server_ServerProcess.h: 65$(JAVAH) -d $(OS) -classpath $(CLASSPATH) com.sun.server.ServerProcess 66 67 $(OBJ)/com_sun_server_realm_unix_UNIXUser.o: $(OS)/com_sun_server_realm_unix_U NIXUser.c 68$(COMPILE.c) -o $@ $(OS)/com_sun_server_realm_unix_UNIXUser.c 69 $(OS)/com_sun_server_realm_unix_UNIXUser.c: 70$(JAVAH) -d $(OS) -classpath $(CLASSPATH) \ 71-stubs com.sun.server.realm.unix.UNIXUser 72 $(OS)/com_sun_server_realm_unix_UNIXUser.h: 73$(JAVAH) -d $(OS) -classpath $(CLASSPATH) com.sun.server.realm.unix.UNI XUser 74 75 $(OBJ)/com_sun_server_realm_unix_UNIXUserEnumeration.o: \ 76$(OS)/com_sun_server_realm_unix_UNIXUserEnumeration.c 77$(COMPILE.c) -o $@ $(OS)/com_sun_server_realm_unix_UNIXUserEnumeration. c 78 $(OS)/com_sun_server_realm_unix_UNIXUserEnumeration.c: 79$(JAVAH) -d $(OS) -classpath $(CLASSPATH) \ 80-stubs com.sun.server.realm.unix.UNIXUserEnumeration 81 $(OS)/com_sun_server_realm_unix_UNIXUserEnumeration.h: 82$(JAVAH) -d $(OS) -classpath $(CLASSPATH) \ 83com.sun.server.realm.unix.UNIXUserEnumeration 84 85 install: $(LIBRARY) 86$(INSTALL) -d $(LIBDIR) 87$(INSTALL) -c $(LIBRARY) $(LIBDIR) 88 89 clean: 90rm -rf $(OS) 91 92 .INIT: 93-@mkdir -p $(OBJ) 94 95 .KEEP_STATE: 96 Does anyone see whats wrong? All comments welcome. Also, the reason I needed to apply the diffs by hand is that the jwebs-linux.diff file posted is trying to make changes to a ../../sparc-S2/bin/startup_wrapper. Doing a search on the entire JWS tree shows no startup_wrapper file. Again all comments welcome. john -- E-Mail: John N. Alegre <[EMAIL PROTECTED]> Date: 18-Jul-99 Time: 09:13:51 This message was
Re: JIT instability w.r.t. bad code?
Nathan Meyers wrote: > Nick Lawson wrote: > > > > I'm pretty sure try{}catch{} catch blocks add NO overhead to code, > > unless the exception actually gets thrown. But exceptions are > > supposed to be > > exceptional, so who cares how slow it is ? > > > > Times for attached program (JDK1.2pre2, glibc2.1, RH6, 200MHZ PPro, > 5 iterations): > > No JIT sunwjit tya > -- --- --- > With try/catch 278793 17925 33894 > Without 237905 15364 35803 > > %slower 17.2% 16.7% -5.3% > > I'd be surprised to see a zero-overhead try/catch, although tya seems to > be on to something :-). > > Results are unaffected by -O compilation. > > Nathan Ok, NO overhead for try..catch is an exaggeration. But only a small one - typically there is exactly one extra bytecode instruction per try, to branch round the catch{} clauses. Most C++ compilers produce similar code, and it would be easy for an optimizing java compiler to produce code without even this overhead (although I haven't seen one that does so yet). The byte-code produced by jdk1.2pre-v2 for the Hello program is reproduced below. Suns JDK 1.2 produces exactly the same code (of course!). The extra instructions for the try..catch are marked with a ! Theres just 3 of them, and only one gets executed if the exception is not thrown. I guess the question was whether try..catch is faster or slower than the alternatives. I think the program below is more like the sort of situation that occurs in real life. The times for this (Pentium 166, Sun Windows 95 JDK 1.2, Blackdown 1.2pre-v2 + glibc 2.1 + OpenLinux 2.2, 500,000,000 iterations): VM: kaffeSunSunBlackdownBlackdown JIT: symcjitnone sunwjitnone ---- --- With try/catch388,21212,360545,410136,207466,300 Without 396,40115,490601,000143,784508,770 %faster2%20% 9.2% 5.2% 8.3% - the last column is estimated from 50,000,000 iterations. I didn't believe the Sun VM figures either, but I tried both tests several times, and the figures are consistent, scale linearly with the number of iterations, and match wall-clock time. So it looks like symcjit is pretty smart ! Nick - import java.util.*; public class Hello2 { public static void main(String[] argv) throws Exception { int count = Integer.parseInt(argv[0]); Boolean foobar = new Boolean(false); Date date1 = new Date(); for (int i = 0; i < count;) { try { if (!foobar.booleanValue()) i++; } catch (Exception e) { System.err.println( "Oops!" ); } } Date date2 = new Date(); Date date3 = new Date(); for (int i = 0; i < count;) { if(foobar != null) { if (!foobar.booleanValue()) i++; } else { System.err.println( "Oops!" ); } } Date date4 = new Date(); System.out.println("First loop (try): " + (date2.getTime() - date1.getTime())); System.out.println("Second loop (no try): " + (date4.getTime() - date3.getTime())); } } - Bytecode from Nathans Hello.java: Code Disassembly: Addr Op Operands Code -- ... ... 0011 03 iconst_0// for( int i = 0; . 0012 36 04 istore L4 // (store i) 0014 a7 001b goto +1b = 002f try #1 0017 84 0401 iinc L4,1 // { i++; 001a 1d iload_3 001b 99 000b ifeq +b = 0026 // if( foobar ) ... 001e bb 0005 new #5 0021 59 dup 0022 b7 000b invokespecial #11 ()> 0025 bf athrow // throw ... 0026 1d iload_3 // foobar = foobar && true; 0027 3e istore_3 end try #1 ! 0028 a7 0007 goto +7 = 002f // branch around catch catch #1 (Exception) ! 002b 57 pop // start catch clause ! 002c a7 0003 goto +3 = 002f // end catch clause 002f 15 04 iload L4// } 0031 1b iload_1 0032 a1 ffe5 if_icmplt -1b = 0017// end for loop 1 ... ... 0047 03 iconst_0 // for( int i = 0; . 0048 36 07 istore L7 // (store i) 004a a7 0014 goto +14 = 005e 004d 84 0701 iinc L7,1 // { i++; 0050 1d iload_3 0051 99 000b ifeq +b = 005c //
JDK1.2.2 request (and reason)
Hello, Here's one vote for a 1.2.2 version. I don't mind that no new linux-specific bugs are fixed, I just need to JDK fixes. 1.2.2 fixes some serious RMI bugs: Are there any porters out there that would consider doing a 1.2.2 build? I'm assuming that Sun would make the source available to the java-linux porters of course...(hopefully a valid assumption). Thanks! BTW, here's a summary of the bugs that are fixed in 1.2.2 that deal with RMI: (posted by Adrian on the rmi-users list) http://archives.java.sun.com/cgi-bin/wa?A2=ind9904&L=rmi-users&F=&S=&P=901 Cheers. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: JWS - Problems with native compile. HELP?
Make sure the lines below each Makefile target use tabs as the spacing instead of spaces. If you're using an editor which is set up to convert tabs to spaces, change that preference. --Jeff "John N. Alegre" wrote: > > I am trying to compile the native library in JavaWebServer1.1.3 using the > instructions from the blackdown site. I applied the diffs by hand. When I try > to compile make complains about errors in Makefile.lnx. > > [root@zaragoza native]# (cd native; make -f Makefile.lnx install) > bash: native: No such file or directory > Makefile.lnx:45: *** missing separator. Stop. > > Here is Makefile.lnx with line numbers: > > ### > 1 # @(#)Makefile.sol 1.11 97/11/06 > 2 # > 3 # Solaris-specific makefile for building optional native library > support. > 4 # Use this as a starting point for porting to other UNIX platforms. > 5 # > 6 > 7 # Path to top of Java Web Server distribution tree > 8 TOP = .. > 9 > 10 # Name of the library we're making (given to System.loadLibrary) > 11 LIBNAME = server > 12 > 13 # Location of Java Developer's Kit (and runtime) > 14 JAVA_HOME =/usr/local/jdk117 > 15 > 16 # Java runtime flags > 17 JAVAH =$(JAVA_HOME)/bin/javah > 18 CLASSPATH = > $(TOP)/classes:$(TOP)/lib/classes.zip:$(JAVA_HOME)/classes:$(JAVA_HOME)/lib/clas > ses.zip > 19 > 20 # OS and machine type > 21 OS = genunix > 22 ARCH = unknown > 23 OBJ = $(OS)/$(ARCH) > 24 > 25 # Preprocessor, compiler, linker, and related flags > 26 CC = cc > 27 CFLAGS = -shared -fPIC > 28 CPPFLAGS = -I$(OS) -I$(JAVA_HOME)/include > -I$(JAVA_HOME)/include/$(OS) > 29 LDFLAGS = #-G -h $(LIBNAME) > 30 INSTALL = /usr/bin/install > 31 > 32 LIBDIR = $(TOP)/lib/$(OBJ) > 33 > 34 LIBRARY = $(OBJ)/lib$(LIBNAME).so > 35 OBJS = $(OBJ)/server.o \ > 36$(OBJ)/UNIXUser.o \ > 37$(OBJ)/UNIXUserEnumeration.o \ > 38$(OBJ)/com_sun_server_ServerProcess.o \ > 39$(OBJ)/com_sun_server_realm_unix_UNIXUser.o \ > 40$(OBJ)/com_sun_server_realm_unix_UNIXUserEnumeration.o > 41 > 42 default all: $(LIBRARY) > 43 > 44 $(LIBRARY): $(OBJS) > 45$(LINK.c) -o $@ $(OBJS) > 46 > 47 $(OBJ)/server.o: server.c $(OS)/com_sun_server_ServerProcess.h > 48$(COMPILE.c) -o $@ server.c > 49 > 50 $(OBJ)/UNIXUser.o: UNIXUser.c $(OS)/com_sun_server_realm_unix_UNIXUser.h > 51$(COMPILE.c) -o $@ UNIXUser.c > 52 > 53 $(OBJ)/UNIXUserEnumeration.o: UNIXUserEnumeration.c \ > 54$(OS)/com_sun_server_realm_unix_UNIXUserEnumeration.h > 55$(COMPILE.c) -o $@ UNIXUserEnumeration.c > 56 > 57 > 58 $(OBJ)/com_sun_server_ServerProcess.o: > $(OS)/com_sun_server_ServerProcess.c > 59$(COMPILE.c) -o $@ $(OS)/com_sun_server_ServerProcess.c > 60 > 61 $(OS)/com_sun_server_ServerProcess.c: > 62$(JAVAH) -d $(OS) -classpath $(CLASSPATH) -stubs > com.sun.server.ServerP rocess > 63 > 64 $(OS)/com_sun_server_ServerProcess.h: > 65$(JAVAH) -d $(OS) -classpath $(CLASSPATH) > com.sun.server.ServerProcess > 66 > 67 $(OBJ)/com_sun_server_realm_unix_UNIXUser.o: > $(OS)/com_sun_server_realm_unix_U NIXUser.c > 68$(COMPILE.c) -o $@ $(OS)/com_sun_server_realm_unix_UNIXUser.c > 69 $(OS)/com_sun_server_realm_unix_UNIXUser.c: > 70$(JAVAH) -d $(OS) -classpath $(CLASSPATH) \ > 71-stubs com.sun.server.realm.unix.UNIXUser > 72 $(OS)/com_sun_server_realm_unix_UNIXUser.h: > 73$(JAVAH) -d $(OS) -classpath $(CLASSPATH) > com.sun.server.realm.unix.UNI XUser > 74 > 75 $(OBJ)/com_sun_server_realm_unix_UNIXUserEnumeration.o: \ > 76$(OS)/com_sun_server_realm_unix_UNIXUserEnumeration.c > 77$(COMPILE.c) -o $@ > $(OS)/com_sun_server_realm_unix_UNIXUserEnumeration. c > 78 $(OS)/com_sun_server_realm_unix_UNIXUserEnumeration.c: > 79$(JAVAH) -d $(OS) -classpath $(CLASSPATH) \ > 80-stubs com.sun.server.realm.unix.UNIXUserEnumeration > 81 $(OS)/com_sun_server_realm_unix_UNIXUserEnumeration.h: > 82$(JAVAH) -d $(OS) -classpath $(CLASSPATH) \ > 83com.sun.server.realm.unix.UNIXUserEnumeration > 84 > 85 install: $(LIBRARY) > 86$(INSTALL) -d $(LIBDIR) > 87$(INSTALL) -c $(LIBRARY) $(LIBDIR) > 88 > 89 clean: > 90rm -rf $(OS) > 91 > 92 .INIT: > 93-@mkdir -p $(OBJ) > 94 > 95 .KEEP_STATE: > 96 > > Does anyone se
Re: JIT instability w.r.t. bad code?
Nick Lawson wrote: > Ok, NO overhead for try..catch is an exaggeration. But only a small one > - typically there is exactly one extra bytecode instruction per try, > to branch round the catch{} clauses > > I guess the question was whether try..catch is faster or slower > than the alternatives. I think the program below is more > like the sort of situation that occurs in real life. To which the answer turns out to be highly dependent on the app. In the case of our examples, the exceptional condition truly is exceptional (given its 0% probability), and the best solution is a try/catch outside of the inner loop and no test. I tried to get a closer look at where time was being spent, by running my example with -Xrunhprof:samples. Blackdown reported that all of the time was spent in the Date() assignments immediately before each loop, suggesting some flaws with the profiling implementation and/or reporting. Pretty impressive optimization on symcjit, though it smells a bit like a compiler that's been tuned to the benchmarks. Does it perform that well on real applications? Nathan > The times for this (Pentium 166, Sun Windows 95 JDK 1.2, Blackdown 1.2pre-v2 > + glibc 2.1 + OpenLinux 2.2, > 500,000,000 iterations): > > VM: kaffeSunSunBlackdownBlackdown > JIT: symcjitnone sunwjitnone > ---- --- > With try/catch388,21212,360545,410136,207466,300 > Without 396,40115,490601,000143,784508,770 > > %faster2%20% 9.2% 5.2% 8.3% > > - the last column is estimated from 50,000,000 iterations. > > . > . > . -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: JIT instability w.r.t. bad code?
Nick Lawson wrote: > > The times for this (Pentium 166, Sun Windows 95 JDK 1.2, Blackdown 1.2pre-v2 > + glibc 2.1 + OpenLinux 2.2, > 500,000,000 iterations): > > VM: kaffeSunSunBlackdownBlackdown > JIT: symcjitnone sunwjitnone > ---- --- > With try/catch388,21212,360545,410136,207466,300 > Without 396,40115,490601,000143,784508,770 > > %faster2%20% 9.2% 5.2% 8.3% > > - the last column is estimated from 50,000,000 iterations. My results for 50M iterations in a PII-350/RH5.2/2.2.9/J12-pre2-glibc2.0/tya1.4: First loop (try): 11136 Second loop (no try): 11603 (This is an average of 10 runs) It seems that there is a real performance increase (4-5%) when using exception handling correctly... In my experience this is the general situation with correct use of exception handling: The code is cleaner and runs faster ;-} -- dimitris -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: JWS - Problems with native compile. HELP?
Jeff, (Sound of hand slapping forehead) Thanks for the HELLO. Isn't Java grand. Just sweeps all that legacy crap right out of mind. Haven't dealt with a Makefile in two years. All is now well. JWS up and running. Peace john On 18-Jul-99 Jeff Galyan wrote: > Make sure the lines below each Makefile target use tabs as the spacing > instead of spaces. If you're using an editor which is set up to convert > tabs to spaces, change that preference. > > --Jeff > > > "John N. Alegre" wrote: >> >> I am trying to compile the native library in JavaWebServer1.1.3 using the >> instructions from the blackdown site. I applied the diffs by hand. When I >> try >> to compile make complains about errors in Makefile.lnx. >> >> [root@zaragoza native]# (cd native; make -f Makefile.lnx install) >> bash: native: No such file or directory >> Makefile.lnx:45: *** missing separator. Stop. >> >> Here is Makefile.lnx with line numbers: >> >> ### >> 1 # @(#)Makefile.sol 1.11 97/11/06 >> 2 # >> 3 # Solaris-specific makefile for building optional native library >> support. >> 4 # Use this as a starting point for porting to other UNIX platforms. >> 5 # >> 6 >> 7 # Path to top of Java Web Server distribution tree >> 8 TOP = .. >> 9 >> 10 # Name of the library we're making (given to System.loadLibrary) >> 11 LIBNAME = server >> 12 >> 13 # Location of Java Developer's Kit (and runtime) >> 14 JAVA_HOME =/usr/local/jdk117 >> 15 >> 16 # Java runtime flags >> 17 JAVAH =$(JAVA_HOME)/bin/javah >> 18 CLASSPATH = >> $(TOP)/classes:$(TOP)/lib/classes.zip:$(JAVA_HOME)/classes:$(JAVA_HOME)/lib/c >> las >> ses.zip >> 19 >> 20 # OS and machine type >> 21 OS = genunix >> 22 ARCH = unknown >> 23 OBJ = $(OS)/$(ARCH) >> 24 >> 25 # Preprocessor, compiler, linker, and related flags >> 26 CC = cc >> 27 CFLAGS = -shared -fPIC >> 28 CPPFLAGS = -I$(OS) -I$(JAVA_HOME)/include >> -I$(JAVA_HOME)/include/$(OS) >> 29 LDFLAGS = #-G -h $(LIBNAME) >> 30 INSTALL = /usr/bin/install >> 31 >> 32 LIBDIR = $(TOP)/lib/$(OBJ) >> 33 >> 34 LIBRARY = $(OBJ)/lib$(LIBNAME).so >> 35 OBJS = $(OBJ)/server.o \ >> 36$(OBJ)/UNIXUser.o \ >> 37$(OBJ)/UNIXUserEnumeration.o \ >> 38$(OBJ)/com_sun_server_ServerProcess.o \ >> 39$(OBJ)/com_sun_server_realm_unix_UNIXUser.o \ >> 40 >> $(OBJ)/com_sun_server_realm_unix_UNIXUserEnumeration.o >> 41 >> 42 default all: $(LIBRARY) >> 43 >> 44 $(LIBRARY): $(OBJS) >> 45$(LINK.c) -o $@ $(OBJS) >> 46 >> 47 $(OBJ)/server.o: server.c $(OS)/com_sun_server_ServerProcess.h >> 48$(COMPILE.c) -o $@ server.c >> 49 >> 50 $(OBJ)/UNIXUser.o: UNIXUser.c >> $(OS)/com_sun_server_realm_unix_UNIXUser.h >> 51$(COMPILE.c) -o $@ UNIXUser.c >> 52 >> 53 $(OBJ)/UNIXUserEnumeration.o: UNIXUserEnumeration.c \ >> 54$(OS)/com_sun_server_realm_unix_UNIXUserEnumeration.h >> 55$(COMPILE.c) -o $@ UNIXUserEnumeration.c >> 56 >> 57 >> 58 $(OBJ)/com_sun_server_ServerProcess.o: >> $(OS)/com_sun_server_ServerProcess.c >> 59$(COMPILE.c) -o $@ $(OS)/com_sun_server_ServerProcess.c >> 60 >> 61 $(OS)/com_sun_server_ServerProcess.c: >> 62$(JAVAH) -d $(OS) -classpath $(CLASSPATH) -stubs >> com.sun.server.ServerP rocess >> 63 >> 64 $(OS)/com_sun_server_ServerProcess.h: >> 65$(JAVAH) -d $(OS) -classpath $(CLASSPATH) >> com.sun.server.ServerProcess >> 66 >> 67 $(OBJ)/com_sun_server_realm_unix_UNIXUser.o: >> $(OS)/com_sun_server_realm_unix_U NIXUser.c >> 68$(COMPILE.c) -o $@ $(OS)/com_sun_server_realm_unix_UNIXUser.c >> 69 $(OS)/com_sun_server_realm_unix_UNIXUser.c: >> 70$(JAVAH) -d $(OS) -classpath $(CLASSPATH) \ >> 71-stubs com.sun.server.realm.unix.UNIXUser >> 72 $(OS)/com_sun_server_realm_unix_UNIXUser.h: >> 73$(JAVAH) -d $(OS) -classpath $(CLASSPATH) >> com.sun.server.realm.unix.UNI XUser >> 74 >> 75 $(OBJ)/com_sun_server_realm_unix_UNIXUserEnumeration.o: \ >> 76$(OS)/com_sun_server_realm_unix_UNIXUserEnumeration.c >> 77$(COMPILE.c) -o $@ >> $(OS)/com_sun_server_realm_unix_UNIXUserEnumeration. c >> 78 $(OS)/com_sun_server_realm_unix_UNIXUserEnumeration.c: >> 79$(JAVAH) -d $(OS) -classpath $(CLASSPATH) \ >> 80-stubs com.sun.server.realm.unix.UNIXUserEnumeration >> 81 $(OS)/com_sun_server_realm_unix_UNIXUserEnumeration.h: >> 82$(JAVAH) -d $(OS) -cla
Re: Text Editor
> I there anyone out there who knows how I could go about implementing atext > editor using maybe the TextArea which writes from right to left and deletes > backwards(the right key). > > Do I define a cursor, and play around with that? Or do I use the getRows and > getColumns methods/ Use Swing instead of AWT. Daniel -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: JIT instability w.r.t. bad code?
I have a (Java) program that does this, although I added the comments by hand. Writing a decompiler seemed like a good way to learn jvm. I didn't originally intend to decompile byte codes, by as usual I got carried away Nick Chris Abbey wrote: > Nick, what program did you use to generate the listing? or did you build > it by hand from javap output? -=Chris > > At 03:17 PM 7/18/99 +0100, you wrote: > [...] > >- > >Bytecode from Nathans Hello.java: > >Code Disassembly: > > > > Addr Op Operands Code > > -- > > > >... > >... > > 0011 03 iconst_0// for( int i = 0; . > > 0012 36 04 istore L4 // (store i) > > 0014 a7 001b goto +1b = 002f > >try #1 > > 0017 84 0401 iinc L4,1 // { i++; > > 001a 1d iload_3 > > 001b 99 000b ifeq +b = 0026 // if( foobar ) ... > > 001e bb 0005 new #5 > > 0021 59 dup > > 0022 b7 000b invokespecial #11 ()> > > 0025 bf athrow // throw ... > > 0026 1d iload_3 // foobar = foobar && > >true; > > 0027 3e istore_3 > >end try #1 > >! 0028 a7 0007 goto +7 = 002f // branch around catch > >catch #1 (Exception) > >! 002b 57 pop // start catch clause > >! 002c a7 0003 goto +3 = 002f // end catch clause > > 002f 15 04 iload L4// } > > 0031 1b iload_1 > > 0032 a1 ffe5 if_icmplt -1b = 0017// end for loop 1 > >... > >... > > 0047 03 iconst_0 // for( int i = 0; . > > 0048 36 07 istore L7 // (store i) > > 004a a7 0014 goto +14 = 005e > > 004d 84 0701 iinc L7,1 // { i++; > > 0050 1d iload_3 > > 0051 99 000b ifeq +b = 005c // if( foobar ) ... > > 0054 bb 0005 new #5 > > 0057 59 dup > > 0058 b7 000b invokespecial #11 ()> > > 005b bf athrow // throw ... > > 005c 1d iload_3 > > 005d 3e istore_3 // foobar = foobar && > >true; > > 005e 15 07 iload L7 // } > > 0060 1b iload_1 > > 0061 a1 ffec if_icmplt -14 = 004d // end for loop 2 > >... > > cabbey at home dot net <*> http://members.home.net/cabbey >I want a binary interface to the brain! > Today's opto-mechanical digital interfaces are just too slow! -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: JIT instability w.r.t. bad code?
Nathan Meyers wrote: > Nick Lawson wrote: > > > > Pretty impressive optimization on symcjit, though it smells a bit like a > compiler that's been tuned to the benchmarks. Does it perform that well > on real applications? > > Nathan > I can only comment on one real application - matrix diagonalization, which is heavy floating point stuff. One method, theres no real difference between sunwjit and symcjit, a second method symcjit is about 3 times faster. These methods are copied from Numerical Algorithms in C, so maybe your point about benchmarks could still apply . although I had to de-optimize the C code in order to understand it ! Nick > > > The times for this (Pentium 166, Sun Windows 95 JDK 1.2, Blackdown 1.2pre-v2 > > + glibc 2.1 + OpenLinux 2.2, > > 500,000,000 iterations): > > > > VM: kaffeSunSunBlackdownBlackdown > > JIT: symcjitnone sunwjitnone > > ---- --- > > With try/catch388,21212,360545,410136,207466,300 > > Without 396,40115,490601,000143,784508,770 > > > > %faster2%20% 9.2% 5.2% 8.3% > > > -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]