This repository has been archived by the owner on May 10, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.original
199 lines (144 loc) · 7.18 KB
/
README.original
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
JamVM 1.5.4
===========
Welcome to the twenty-seventh release of JamVM!
JamVM is a Java Virtual Machine which conforms to the JVM
specification version 2 (blue book). In comparison to most other
VM's (free and commercial) it is extremely small, with a stripped
executable on PowerPC of only ~220K, and Intel 200K. However, unlike
other small VMs (e.g. KVM) it is designed to support the full
specification, and includes support for object finalisation,
soft/weak/phantom references, the Java Native Interface (JNI) and
the Reflection API.
Supported Architectures
=======================
JamVM is easy to port to new architectures as most of the code
is written in C (only a small amount of assembler code is required).
So far, JamVM has been built and tested on :
Linux
-----
- PowerPC: for many years my main platform, so this was well tested.
Built and tested on G3 and G4 systems.
- i386: built and tested on i586, i686 (Pentium III), Pentium 4,
Athlon and Core 2 Duo. At least an i486 is needed because
JamVM uses the cmpxchg instruction, which was first introduced
on the i486.
- ARM: Originally ported and tested on the iPAQ running Linux (3950,
with xscale PXA250 processor, though it should work on StrongARM).
Later development on Neo1973 (ARM920T core), and Beagle Board
(Cortex A8). Little and Big Endian machines are supported,
soft/kernel FP emulation, and OABI or EABI.
- AMD64: built and tested on AMD Athlon 64, Phenom, Phenom II, Pentium 4
and Core 2 Duo (using EM64T).
- MIPS: built and tested on mipsel using the O32 ABI. The system
was an embedded wireless router.
Mac OS X/Darwin
---------------
- PowerPC: built and tested on Mac OS X 10.3 (Panther) and 10.4
(Tiger) on G3, G4 and G5 systems. It should also work
on 10.2, but you may need to install Fink. Note, gcc-3.3
gives better performance than gcc-4.0.
- PowerPC64 (a.k.a G5):
to build a 64-bit executable CFLAGS must include
the flag -arch ppc64. If no option is given a 32-bit
executable is built by default.
- i386: JamVM has been built and tested on the Apple MacBook Pro
(Intel Core Duo and Core 2 Duo), running Mac OS X 10.4 and
10.5.
- ARM: iPhone (jailbroken)
BSD Variants
------------
FreeBSD : i386, powerpc, ARM, AMD64 (x86_64), Sparc.
OpenBSD : i386, powerpc, ARM, AMD64 (x86_64).
KFreeBSD : i386
Solaris/OpenSolaris
-------------------
x86 : Solaris/OpenSolaris on x86 is combined, with only one OS for both
i386 and AMD64. By default, JamVM will be built in 32-bit mode.
To build in 64-bit mode, you must specify CFLAGS when configuring
and include -m64.
Class Libraries
===============
JamVM is designed to use the GNU classpath Java class library (see
http://www.gnu.org/software/classpath). A number of classes are
reference classes which must be modified for a particular VM. These are
provided and built along with JamVM (see INSTALL). JamVM 1.5.4 works with
Classpath version 0.98 (the latest development snapshot). It should also
work with the latest version direct from CVS (but check the Classpath
mailing lists for possible patches). Later snapshots of Classpath may
also work, if no modifications have been made to the VM interface.
Note, JamVM 1.5.4 will not work with versions of Classpath earlier than
0.98, nor will it work with the class library from Sun or IBM's Virtual
Machines, or OpenJDK.
Building and Installing
=======================
Please see the INSTALL file for full instructions.
Running
=======
You don't need to setup any environment variables to run JamVM. By default,
JamVM installs in /usr/local/jamvm/bin (see INSTALL for how to change it).
Add /usr/local/jamvm/bin to your path, and you should be able to simply run
`jamvm'.
CLASSPATH, -classpath, -bootclasspath and LD_LIBRARY_PATH variables
-------------------------------------------------------------------
The location of user classes can be specified on the JamVM command line using
-classpath (or -cp) or via the CLASSPATH environment variable. If neither is
specified, the classpath defaults to '.', i.e. the current directory. The
-classpath option takes priority -- if this is specified, CLASSPATH is ignored.
The system classes (GNU Classpath and JamVM's VM classes) are loaded via the
system class loader. By default it searches the GNU Classpath installation
directory and JamVM's installation location. This can be overridden using the
-Xbootclasspath command line option, or the BOOTCLASSPATH variable.
By default JamVM searches the GNU Classpath installation directory and the
current directory ('.') for native libraries. Extra directories can be
specified using the LD_LIBRARY_PATH environment variable.
Testing
=======
Currently JamVM has been used to run fairly major command-line programs
including Javac, SPECJvm 98 benchmark suite, jBYTEmark and Mauve. It has
also been successfully used with Jetty (a Java-based web server and servlet
container, Tomcat, JEdit and Eclipse.
FEEDBACK
========
I welcome feedback of any kind, e.g. bug reports, suggestions, etc. I'm always
interested to hear how and if people are using JamVM so even if you don't have
a problem drop me an email (email address at the bottom).
JamVM "Features"
================
For those interested in the design of virtual machines, JamVM includes a number
of optimisations to improve speed and reduce foot-print. A list, in no
particular order, is given below.
- Uses native threading (posix threads). Full thread implementation
including Thread.interrupt()
- Object references are direct pointers (i.e. no handles)
- Supports class loaders
- Efficient thin locks for fast locking in uncontended cases (the
majority of locking) without using spin-locking
- Two word object header to minimise heap overhead (lock word and
class pointer)
- Execution engine supports many levels of optimisation (see
configure --help) from basic switched interpreter to inline-threaded
interpreter with stack-caching (aka code-copying JIT, equivalent
performance to a simple JIT).
- Stop-the-world garbage collector, with separate mark/sweep
and mark/compact phases to minimise heap fragmentation
- Thread suspension uses signals to reduce supend latency and improve
performance (no suspension checks during normal execution)
- Full object finalisation support within the garbage collector
(with finaliser thread)
- Full GC support for Soft, Weak and Phantom References. References
are enqueued using a seperate thread (the reference handler)
- Full GC support for class and class-loader unloading (including
associated shared libraries)
- Garbage collector can run synchronously or asynchronously within its
own thread
- String constants within class files are stored in hash table to
minimise class data overhead (string constants shared between all
classes)
- Supports JNI and dynamic loading for use with standard libraries
- Uses its own lightweight native interface for internal native methods
without overhead of JNI
- JamVM is written in C, with a small amount of platform dependent
assembler, and is easily portable to other architectures.
That's it!
Robert Lougher <rob@jamvm.org.uk>
1st January 2010.