Thread: [Sablevm-developer] Porting sablevm to powerpc
Brought to you by:
egagnon
From: Mark W. <ma...@kl...> - 2002-08-15 20:43:54
|
Hi (reply to sablevm-developer original message was on debian lists), On Thu, 2002-08-15 at 02:14, Grzegorz Prokopski wrote: > > So I took some time to check what that "easily portable" means in > practise - and started porting this JVM to alpha. > > It was my first time I was doing a port and I never wrote in alpha's > assembler, so it took very long - about 24 hours and resulted (of > mostly learning) in small diff (around 100 lines, but there was some > code reorganizing in it too, so real diff was around 25 lines!) > > <blink><B>25 lines to port JVM to new architecture</B></blink> > > Anyway - now SableVM JVM supports ia32 and alpha. > Official 1.0.2 release will be made soon. > > More arches will come. Impressive! I am very interested in a VM that uses GNU Classpath and that I can use on powerpc (Debian GNU/Linux system). What 25 lines of code do I have to look at? I have no experience with powerpc assembly so if anybody has references that would be greatly appreciated. I would use it to finally setup a autobuilder/tester for Classpath CVS as I have currently running (on that powerpc machine) for libgcj (which has still a long way to go for being completely merged with GNU Classpath). Cheers, Mark |
From: Etienne M. G. <eti...@uq...> - 2002-08-15 21:54:52
|
Hi Mark. Grzegorz told me he would be away from his email for a few days, (I should be too, very soon), so I will reply to your message, as I think this reply might benefit other potential porters.. On Thu, Aug 15, 2002 at 10:43:05PM +0200, Mark Wielaard wrote: > Impressive! I am very interested in a VM that uses GNU Classpath and > that I can use on powerpc (Debian GNU/Linux system). > What 25 lines of code do I have to look at? You have to look at the following files: src/libsablevm/include/jni_system_specific.h src/libsablevm/system.h src/libsablevm/system.c The easiest would be to forget about inline-threaded engine for now. It should take me at most a few minutes to fix it on the powerpc, once the remaining is in place; I have to add calls to _svmf_iflush in _svmf_get_sequence. _svmf_iflush already has a draft implementation for powerpc. I have already setup the configure.ac stuff to select the direct-threaded engine by default for non i*86-*-gnu systems. The single most difficult part of porting SableVM to a new system, is implementing the _svmh_compare_and_swap function, which ***MUST*** be an *ATOMIC* operation. [Note: You also have to worry about the _svmf_iflush stuff when you want to run the inline-threaded engine on processors with distinct instruction and data caches.] I hope this helps. Etienne -- Etienne M. Gagnon http://www.info.uqam.ca/~egagnon/ SableVM: http://www.sablevm.org/ SableCC: http://www.sablecc.org/ |
From: Mark W. <ma...@kl...> - 2002-08-18 00:03:40
|
Hi, On Thu, 2002-08-15 at 23:46, Etienne M. Gagnon wrote: > On Thu, Aug 15, 2002 at 10:43:05PM +0200, Mark Wielaard wrote: > > Impressive! I am very interested in a VM that uses GNU Classpath and > > that I can use on powerpc (Debian GNU/Linux system). > > What 25 lines of code do I have to look at? > > You have to look at the following files: > > src/libsablevm/include/jni_system_specific.h > src/libsablevm/system.h > src/libsablevm/system.c OK, after spending a couple of hours learning powerpc assembly and the gcc asm constraints I think that I have something that might be what is needed for powerpc. Unfortunately it doesn't work correctly yet, but looking at the output of --verbose I get the impression that we are almost there. Here are the last 15 lines for sablevm --verbose Hello: [verbose class: creating "[Ljava/util/Hashtable$HashEntry;"] [verbose class: loading "java/util/StringTokenizer"] [verbose class: loading "java/util/Enumeration"] [verbose class: creating "[Ljava/lang/String;"] [verbose class: loading "java/lang/StringBuffer"] [verbose class: loading "java/lang/VMSecurityManager"] [verbose class: loading "java/util/WeakHashMap$WeakBucket$WeakEntry"] [verbose class: loading "java/io/BufferedInputStream"] [verbose class: loading "java/io/FilterInputStream"] [verbose class: loading "java/io/InputStream"] [verbose class: loading "java/io/FileInputStream"] [verbose class: loading "java/io/FileDescriptor"] [verbose class: loading "java/lang/SecurityException"] java/lang/ExceptionInInitializerError [verbose gc: total gc time = 0 sec 0 usec] Attached are my versions of the above files. If there is someone with some powerpc knowledge on the list then I would highly appreciate it if you could take a look. Have to get some sleep now. Cheers, Mark |
From: Grzegorz P. <ga...@de...> - 2002-08-20 00:21:10
|
W li=B6cie z nie, 18-08-2002, godz. 02:02, Mark Wielaard pisze:=20 > OK, after spending a couple of hours learning powerpc assembly and the > gcc asm constraints I think that I have something that might be what is > needed for powerpc. Unfortunately it doesn't work correctly yet, but > looking at the output of --verbose I get the impression that we are > almost there. Here are the last 15 lines for sablevm --verbose Hello: It looks like PowerPC is the first big-endian system SableVM is being compiled on. We can suspect that it is causing some problems. Don't know exactly how's that about PowerPC accepting both big and low-endian data[1] in Linux. I checked data sizes for types used in jni_system_specific.h - they _are_ the same as for ia32 and alpha, so no mistake there. page size _is_ 4 kb according to [2]. about your assembler code - if you're not sure if it works: 1) ask at some devel/port list, for ex. debian-powerpc@l.d.o. 2) you could also _for testing only_ disable assembler stuff and put "C" version there. If it sometimes goes beyond the point it is now - then it's sth. wrong with this assembler part. Keep in mind that if you do that - SableVM will probably randomly break in different places or sth. I have requested installation of build-depends of SableVM on PowerPC(unstable), ia64(woody) and hppa(woody) debian developer's machines. PowerPC - because you started it and I'd like to test it too. ia64 - because it's crucial to get _this_ arch working - we all will be using it (at some point in the future) hppa - because it's already using gcc 3.x - and there can be some interesting differences to work out (may be), however I don't expect too much of them. Anyway - transition to gcc 3.2 for all debian arches will start soon. I'll send a status report as soon as I have sth interesting ;-) That's really great you started the PowerPC port. Keep up with it! Regards Grzegorz B. Prokopski [1] http://developer.apple.com/techpubs/hardware/DeviceManagers/pci_srvcs/pci_c= ards_drivers/PCI_BOOK.24e.html [2] http://www.cwi.nl/~manegold/Calibrator/DB/DB.shtml |