Commit Graph

329 Commits

Author SHA1 Message Date
Joel Dice
3317149cd2 Merge branch 'master' into compiler
Conflicts:

	src/x86.cpp
2008-02-26 17:56:35 -07:00
Joel Dice
b2e7099bbc add javadoc target to makefile 2008-02-26 17:19:15 -07:00
Joel Dice
2edaa82801 prepend copyright notice and license to all source files; add license.txt and readme.txt 2008-02-19 11:06:52 -07:00
Joel Dice
b9fa7179d9 more work on new compiler; addition now works 2008-02-11 17:20:32 -07:00
Joel Dice
5b2f351f01 adapt compile.cpp to new compiler 2008-02-11 10:21:41 -07:00
Eric Scharff
c1f3d28d24 Fixes dynamic symbol loading bug on Mac OS X.
On OS X, when you call dlopen() on a null library, and then call dlsym(),
the most recently loaded symbols are always used, no matter what flags
we seem to pass to dlopen().  The solution is to explicitly find the name
of the running executable, and open that as a library.
2008-01-28 16:17:22 -07:00
Joel Dice
008ac07079 refactor native method resolution to be simpler and more robust 2008-01-28 10:27:02 -07:00
Joel Dice
aa081089ce use compile-object to build jni-objects 2008-01-25 16:45:52 -07:00
Joel Dice
6bca3a8665 additional tweaks to make embedded resources work on darwin 2008-01-23 10:12:56 -07:00
Joel Dice
618684de6e support embedded resources on darwin via binaryToMacho.cpp 2008-01-23 09:56:25 -07:00
Joel Dice
c3ce201a59 revert earlier change of breaking libclasspath.a out of libvm.a 2008-01-21 16:58:27 -07:00
Joel Dice
d3774d54bc build libclasspath.a, which contains native methods for the classpath 2008-01-21 16:51:23 -07:00
Joel Dice
f29b1b9b6f libvm.a should not include classpath code 2008-01-21 16:42:44 -07:00
Joel Dice
35160e46d8 don't include embedded boot classpath in libvm.a, only the executable 2008-01-18 17:54:36 -07:00
Joel Dice
e6aea41a88 make the default compilation mode 'fast' 2008-01-11 17:35:27 -07:00
Joel Dice
48e532f8e9 add debug-fast compilation mode 2008-01-11 17:15:34 -07:00
Joel Dice
8e5ce11047 refactor memory management code
We now support immortal objects, which the GC will scan for references
but not consider for collection.  On x86_64, we allocate JIT code memory
via mmap, which lets us map memory into the bottom 2GB of the address
space, ensuring that 32-bit relative jumps and calls work.
2008-01-09 18:20:36 -07:00
Joel Dice
324744d525 makefile cleanups 2008-01-08 15:05:56 -07:00
Joel Dice
6057ffd693 whitespace tweak 2008-01-03 19:17:42 -07:00
Joel Dice
e81a534986 misc makefile tweaks 2008-01-03 12:49:42 -07:00
Joel Dice
f151d85f4e intercept SIGSEGV and throw NullPointerExceptions 2007-12-31 15:40:56 -07:00
Joel Dice
5d65e7c220 handle synchronized methods properly in JIT mode 2007-12-27 17:02:05 -07:00
Joel Dice
a2181e88c0 include boot classpath in vm arguments on darwin, since we don't build those classes into the executable 2007-12-27 08:46:17 -07:00
Joel Dice
6ed28a13c3 fix x86-32 regressions due to JIT refactoring 2007-12-26 10:16:21 -07:00
Joel Dice
b361e1b637 refactor JIT code to make operand size an explicit part of each applicable instruction 2007-12-26 09:56:14 -07:00
Joel Dice
8cd18d6193 more JIT bugfixes 2007-12-23 13:06:24 -07:00
Joel Dice
f87a78833b fix JIT regressions on amd64 2007-12-23 12:18:34 -07:00
Joel Dice
15857135c0 more JIT fixes; all tests now pass on x86-32 2007-12-23 11:48:22 -07:00
Joel Dice
a020a3f6bb handle various return types properly in invokeNative2 2007-12-23 11:09:41 -07:00
Joel Dice
31cf1754ce fix frame trace bug leading to incomplete stack coverage during GC; fix thinko pushing arguments in vmInvoke 2007-12-23 11:01:41 -07:00
Joel Dice
6c532e2ba4 fix register allocation bugs in floating point instructions 2007-12-22 17:15:46 -07:00
Joel Dice
be42c325d8 32-bit JIT bugfixes; still broken 2007-12-19 18:42:12 -07:00
Joel Dice
7dd81c803a fix native call argument marshalling regression 2007-12-19 17:02:32 -07:00
Joel Dice
4c3a2575ba lots of JIT bugfixes; all top-level tests now pass 2007-12-17 13:55:31 -07:00
Joel Dice
56a8ce8fb1 more JIT bugfixes; implement mul instruction 2007-12-16 16:52:38 -07:00
Joel Dice
e4fbadd051 JIT-related GC safety fixes 2007-12-16 15:41:07 -07:00
Joel Dice
86218ebcb8 fix stack pointer calculation in unwind code and set rbx to thread pointer when unwinding 2007-12-15 18:00:25 -07:00
Joel Dice
796a64a426 lots of JIT bugfixes and cleanups 2007-12-15 17:24:15 -07:00
Joel Dice
fdeafe46fd 2+2 test now works with new JIT code 2007-12-11 14:26:59 -07:00
Joel Dice
f8cda0cd85 more JIT compiler progress 2007-12-09 15:45:43 -07:00
Joel Dice
466c958d2b implement persistent red-black tree in util.cpp based on PersistentSet.java 2007-11-26 18:40:47 -07:00
Joel Dice
0bbe9489a7 flesh out call tracing in new JIT code 2007-11-26 16:15:53 -07:00
Joel Dice
49ed41daa0 refactor stack walking interface in processor.h and sketch stack walking implementation in compile2.cpp 2007-11-25 16:00:55 -07:00
Joel Dice
3570beaba9 specify -DNDEBUG cflag in debug mode to improve performance when debugging large apps 2007-11-14 16:23:15 -07:00
Joel Dice
fe0e542afe finish support for inline vtables in class objects; convert constant pools from arrays to singletons to reduce memory footprint 2007-11-05 14:40:17 -07:00
Joel Dice
19d36cc463 implement impdep1 instruction for lazily loading bootstrap classes 2007-11-05 08:29:43 -07:00
Joel Dice
6c0e0c37e2 snapshot 2007-11-05 07:28:46 -07:00
Joel Dice
514be2dc87 snapshot 2007-11-04 16:10:33 -07:00
Joel Dice
94e9bd0fd2 clean up bootstrap type generation to eliminate redundancy (broken) 2007-11-04 14:15:28 -07:00
Joel Dice
bea4a73f54 Merge branch 'singleton' 2007-11-02 15:56:48 -06:00
Joel Dice
7dfbd87a40 bugfixes 2007-11-02 15:42:19 -06:00
Joel Dice
e820b6a8a4 sketch of singleton support 2007-11-02 15:08:14 -06:00
Joel Dice
d3592f2dbd tweak makefile to recompile all dirty java files in a single javac invocation for efficiency 2007-11-02 08:01:10 -06:00
Eric Scharff
eb3bd1ce7c Got strip working for Mac OS X 2007-11-01 14:37:51 -06:00
Eric Scharff
7f33b7371b Factored JNIEXPORT into one place. Adopted the visbility attribute that
should allow strip to work on Mac OS X
2007-11-01 14:00:22 -06:00
Eric Scharff
b3891debb2 Fixes build for Mac OS X.
If the binary is stripped on Mac OS X, dlsym fails, so builtin native library
calls do not work.  The solution, in this case, is to not strip the binary.
2007-10-30 16:22:53 -06:00
Joel Dice
956106f518 implement StringBuilder.delete() more efficiently 2007-10-29 15:40:05 -06:00
Joel Dice
7aecdb6ce0 undo accidentally-committed makefile change 2007-10-28 18:54:21 -06:00
Joel Dice
a80677d673 fix aliasing warnings 2007-10-28 18:51:38 -06:00
Joel Dice
7f1837fecd move fixed object (mark and sweep) support into heap.cpp and refine algorithms for determining when and how much to GC 2007-10-28 13:14:53 -06:00
Joel Dice
60072b9fdc implement fixed object support 2007-10-27 19:54:30 -06:00
Eric Scharff
8f604ca7e1 makefile cleanups 2007-10-26 16:16:47 -06:00
Eric Scharff
789cc8e9a2 On the Mac, building in the vm object is complicated. Instead,
rely on external files.
2007-10-26 16:10:12 -06:00
Joel Dice
476a0d70f2 Merge branch 'master' of dice:git/vm
Conflicts:

	makefile
2007-10-26 15:03:53 -06:00
Joel Dice
f354abb4a0 build fixes and refactoring 2007-10-26 15:02:39 -06:00
Eric Scharff
e2ae3201f7 Fix for mac's lacking objcopy - rely on the version in MacPorts 2007-10-26 13:43:14 -06:00
Eric Scharff
4088387cf0 Fix typo in makefile - path must be specified to find 2007-10-26 13:32:19 -06:00
Joel Dice
ccdc7fdda3 eliminate bin2c and use objcopy instead to translate binary data to an object file 2007-10-26 11:38:36 -06:00
Joel Dice
d0089c4d88 makefile fixes 2007-10-26 08:34:54 -06:00
Joel Dice
448d48adc9 superficial makefile tweak 2007-10-25 18:03:26 -06:00
Joel Dice
20cc788fa4 support classloading from jar files compiled into the executable 2007-10-25 16:06:05 -06:00
Joel Dice
b12b779c7f add support for passing properties to the VM via JNI; use vm.builtins property to specify builtin libraries 2007-10-25 12:33:43 -06:00
Joel Dice
2de0decfe3 Merge branch 'master' of dice:git/vm
Conflicts:

	src/interpret.cpp
2007-10-25 09:05:24 -06:00
Joel Dice
1c90ea5fd6 rewrite main.cpp to use jni.h interface for creating the VM and invoking the main method of the specified class 2007-10-25 09:04:13 -06:00
Eric Scharff
b91307224d Fixed broken mac commit 2007-10-25 09:03:24 -06:00
Eric Scharff
5131cac38a Fix regression for non Mac OS X platforms linking in archives 2007-10-25 08:58:44 -06:00
Eric Scharff
782f7e8feb Fixes build parameters for Mac 2007-10-25 08:55:48 -06:00
Joel Dice
eaf1d205cd more windows port fixes 2007-10-24 11:24:19 -06:00
Joel Dice
75b79e133e use /usr/local/win32 include and lib directories in makefile when cross-compiling for windows 2007-10-24 09:46:44 -06:00
Joel Dice
4dfcaa0f91 build standalone executable (no seperate .so) on all platforms; build libvm.a too 2007-10-23 17:23:55 -06:00
Joel Dice
c686d1ca60 add -k to dlltool command 2007-10-23 14:18:42 -06:00
Joel Dice
eb4cea6291 more work on the windows port; we now have some tests passing 2007-10-23 14:05:59 -06:00
Joel Dice
1381267e70 mork work on the windows port 2007-10-23 11:22:48 -06:00
Joel Dice
58dec050c8 sketch of windows port 2007-10-22 19:00:57 -06:00
Joel Dice
ac4b28ffe6 refactor build system to support cross-compiling 2007-10-22 14:56:27 -06:00
Joel Dice
5fb1495f4d bugfixes and new instructions in compile.cpp 2007-10-16 19:21:35 -06:00
Joel Dice
96ed27c55c various bugfixes to get Tree.java to work 2007-10-16 11:21:26 -06:00
Joel Dice
5f6258045e implement various floating point instructions; fix Floats.java to actually test something 2007-10-15 13:12:38 -06:00
Joel Dice
5c99edd90e fix many JIT GC bugs; GC.java now passes 2007-10-13 15:48:40 -06:00
Joel Dice
7e0731ebdd various bugfixes involving longs 2007-10-08 17:13:55 -06:00
Eric Scharff
673aec28fb The warning -Wold-style-cast turns out to be more trouble than its worth
when dealing with old-style casts that are in header files.  Removing.
2007-10-08 13:29:40 -06:00
Joel Dice
404d996c1e snapshot 2007-10-03 18:41:54 -06:00
Joel Dice
68e382ca8d snapshot 2007-10-01 18:08:17 -06:00
Joel Dice
7ecb5b9c30 fixes for various recent regressions 2007-09-30 10:32:17 -06:00
Joel Dice
569cfa9e07 implement more instructions; various bugfixes 2007-09-29 14:24:14 -06:00
Joel Dice
79603e284d sketch of Compiler.compileNative() and ifnull instruction implementation 2007-09-28 17:41:03 -06:00
Joel Dice
f1bdc4c745 various fixes to get JIT working on x86_64 2007-09-26 18:01:38 -06:00
Joel Dice
2f3f97d550 clean up compile.cpp and support both x86_64 and i386; further refactoring to support JIT 2007-09-26 17:23:03 -06:00
Joel Dice
1207989f72 fix build and runtime bugs introduced in last commit 2007-09-26 08:43:40 -06:00
Joel Dice
e7c8fb645a JIT works for Instructions.java 2007-09-25 17:53:11 -06:00
Joel Dice
1c90708abf bugfixes for recent refactoring effort 2007-09-24 07:46:48 -06:00
Joel Dice
8d983c8a39 refactoring effort to pave the way for JIT compilation 2007-09-23 19:39:03 -06:00
Joel Dice
65a3ee4277 superficial tweaks 2007-09-21 08:16:43 -06:00
Eric Scharff
36f1d3206e The proper extension for Mac JNI libraries is .jnilib. Hard-coded constants
have been factored to common locations.  Furthermore, the LD_LIBRARY_PATH
environment variable is DYLD_LIBRARY_PATH on Mac OS X.
2007-09-20 10:13:41 -06:00
Eric Scharff
f430f3f00e Various fixes (mostly making things more strict) to get the code to
compile on Mac OS X
2007-09-19 10:22:19 -06:00
Joel Dice
cd990969cd fix allocation of large objects in allocate2(); remove references to jscheme and SWT in makefile and test directory 2007-09-19 08:16:49 -06:00
Joel Dice
cc84e61561 remove builtin.h from interpreter-depends, since it no longer exists 2007-09-19 07:48:55 -06:00
Joel Dice
49a3c08cc9 use dlopen()/dlsym() to resolve builtin JNI methods 2007-09-18 17:30:09 -06:00
Joel Dice
b88438d2fd sketch of JAR support in Finder 2007-09-16 18:13:36 -06:00
Joel Dice
619d0daf8d valgrind config tweaks 2007-09-14 17:04:08 -06:00
Joel Dice
1f30fa8c72 Merge branch 'master' of dice:git/vm 2007-09-14 14:34:38 -06:00
Joel Dice
4ade402f1b bugfixes; SWT ControlExample works on x86_32 2007-09-14 14:35:37 -06:00
Joel Dice
59e87ddebf Merge branch 'master' of dice:git/vm 2007-09-14 08:18:35 -06:00
Joel Dice
fde79e8569 makefile tweak for testing two different architectures on the same machine 2007-09-14 08:18:33 -06:00
Joel Dice
bb520e4ef9 bugfixes 2007-09-13 21:59:39 -06:00
Joel Dice
dc34707f98 fix Call*Method() calls to wrong run() function 2007-09-13 10:43:33 -06:00
Joel Dice
7cb3a30a91 sketch of Runtime.exec() and Calendar; misc bugfixes 2007-09-12 18:21:37 -06:00
Joel Dice
bd4d9fdeb2 several things: change object typedef to Object* instead of void* to improve type safety; add JNICALL attributes to JNI functions; implement additional JavaVM methods 2007-09-06 18:21:52 -06:00
Joel Dice
ec68b60204 add profile-jscheme target to makefile 2007-08-20 20:30:56 -06:00
Joel Dice
27c8511c5e bugfixes 2007-08-20 18:24:54 -06:00
Joel Dice
e2f3e80bdf heap o' bugfixes 2007-08-19 20:57:32 -06:00
Joel Dice
59638543c7 various performance tweaks and bugfixes 2007-08-19 13:45:51 -06:00
Joel Dice
747e7b0371 set minimum value for initial nextGen2 capacity; profile support 2007-08-18 16:42:11 -06:00
Joel Dice
215a52ba54 simplify heap.cpp by allocating segments pessimistically 2007-08-18 15:24:29 -06:00
Joel Dice
ab3ca38580 various bugfixes 2007-08-13 18:37:00 -06:00
Joel Dice
89609e11c9 implement floating point instructions 2007-08-13 08:06:31 -06:00
Joel Dice
bf230ee151 implement tableswitch and lookupswitch instructions plus run loop bugfixes and tweaks 2007-08-12 20:52:12 -06:00
Joel Dice
c20219df19 flesh out serialization/deserialization code and fix build 2007-08-12 18:50:25 -06:00
Joel Dice
d3931b4853 flesh out resource URL scheme implementation 2007-08-10 17:45:47 -06:00
Joel Dice
1997ea6b8c acquire class lock before running static initializer; wrap exceptions thrown from static initializers in ExceptionInInitializerError instances 2007-08-01 17:48:36 -06:00
Joel Dice
73155c6196 fix failure to remove thread from wait list in System::Monitor::notifyAll() 2007-07-29 19:18:18 -06:00
Joel Dice
c96a4a5b39 implement String.intern() 2007-07-28 18:02:32 -06:00
Joel Dice
41bee5829e misc. bugfixes and tweaks 2007-07-28 10:10:13 -06:00
Joel Dice
7212ba1c30 java/io bugfixes and coverage; jni bugfixes; minor refactoring 2007-07-26 18:06:05 -06:00
Joel Dice
9ab88ef619 a static jni method takes the jclass for that method as its second argument; simplify pad() and divide(), and rename divide() to ceiling(); sketch FileInputStream.cpp and FileOutputStream.cpp 2007-07-25 18:48:28 -06:00
Joel Dice
6b0792c881 exception handling and parseMethodTable() bugfixes 2007-07-24 19:56:05 -06:00
Joel Dice
97aaa419b4 quick sketch of java/io/* 2007-07-24 18:34:45 -06:00
Joel Dice
527f46d53d bugfixes; add NullPointerException.java 2007-07-23 21:31:28 -06:00
Joel Dice
5f3bf175e0 start work on reflection; bugfixes 2007-07-23 19:44:20 -06:00
Joel Dice
48226f988c add a bunch of classes to classpath and flesh out a few existing ones 2007-07-21 11:50:26 -06:00
Joel Dice
0f7a2137bf factor system.cpp and class-finder.cpp out of main.cpp 2007-07-20 08:36:31 -06:00
Joel Dice
9f91f221dd GC stress fix in make() 2007-07-19 21:29:34 -06:00
Joel Dice
de9213ce30 finish java/lang/ref/* support; add wrapper classes for primitives 2007-07-19 21:18:25 -06:00
Joel Dice
32dff71994 GC stress fixes 2007-07-19 17:45:44 -06:00
Joel Dice
c94e70060f teach test.sh to run valgrind when in stress testing mode 2007-07-17 19:42:14 -06:00
Joel Dice
b848c09a34 more GC stress fixes 2007-07-17 07:22:29 -06:00
Joel Dice
e3e9981031 more GC stress fixes 2007-07-16 19:55:49 -06:00
Joel Dice
4670055b03 implement primitive testing framework and provide for GC stress testing 2007-07-15 19:03:02 -06:00
Joel Dice
69eed6ba5a fix method and field lookup to check superclasses 2007-07-11 18:06:57 -06:00
Joel Dice
93748f2df9 heap o' bugfixes 2007-07-10 19:38:06 -06:00
Joel Dice
3bd267b47a more refactoring 2007-07-06 17:50:26 -06:00
Joel Dice
427dbedd0f factor a lot of code out of vm.cpp, since it was becoming unwieldy 2007-07-06 09:24:06 -06:00
Joel Dice
c3320c2c97 flesh out classpath enough to test threading; fix indexing bug in parsePool() 2007-07-04 16:27:08 -06:00
Joel Dice
da844719ab fix off-by-one thinko in GetStringUTFChars; call dlclose() in ~Library() 2007-07-04 12:15:03 -06:00
Joel Dice
25a7aae0f8 lots of bugfixes 2007-07-04 11:58:27 -06:00
Joel Dice
38cea04322 progress towards thread support
This includes support for using the least significant bits of the class
pointer to indicate object state, which we'll use to indicate the
presence of a monitor pointer, among other things.
2007-07-01 15:34:22 -06:00
Joel Dice
4020f13fb0 update references to class in fields and methods in updateBootstrapClass() 2007-06-29 20:38:16 -06:00
Joel Dice
b8e009075c stack trace work 2007-06-29 20:39:01 -06:00
Joel Dice
c34ee64988 classloading bugfixes and stack trace work 2007-06-29 19:37:45 -06:00
Joel Dice
60da97dfc8 fix test, stress, and fast makefile targets 2007-06-29 11:45:14 -06:00
Joel Dice
07fa116aa3 use real arch in makefile 2007-06-29 10:43:25 -06:00
Joel Dice
e529d60a69 hello, world 2007-06-29 10:42:39 -06:00
Joel Dice
6751b53598 specify LD_LIBRARY_PATH for run targets 2007-06-29 08:52:03 -06:00
Joel Dice
2057e72956 more JNI work 2007-06-28 20:58:48 -06:00
Joel Dice
cd2c1a2836 JNI up the wazoo 2007-06-24 20:02:24 -06:00
Joel Dice
400b3633d7 more JNI work 2007-06-24 19:34:07 -06:00
Joel Dice
ef806e73f0 progress on JNI and bootstrap class handling 2007-06-24 13:57:00 -06:00
Joel Dice
39bbcc03eb refactor assertions so they can be disabled easily at compile time; fix a couple of method invocation bugs 2007-06-22 17:17:13 -06:00
Joel Dice
5ee38e259a enable large object support; various GC bugfixes and tweaks 2007-06-22 16:47:57 -06:00
Joel Dice
d5ce307a2a switch to a linked heap implementation 2007-06-21 20:13:17 -06:00
Joel Dice
95c4bff51b lots of bugfixes 2007-06-20 19:38:02 -06:00
Joel Dice
91b9dc7382 various bugfixes 2007-06-20 15:27:22 -06:00
Joel Dice
4e07acb26c it builds! 2007-06-20 13:20:25 -06:00
Joel Dice
1a05eb2739 snapshot 2007-06-20 10:58:35 -06:00
Joel Dice
36152603f4 provide bounds checking for array indexing; store bootstrap types in Machine::types 2007-06-18 15:13:21 -06:00
Joel Dice
6756ade3bd update generated type code and fix most link errors 2007-06-18 13:23:44 -06:00
Joel Dice
1cb866aac1 clean up sketch of parseClass() and friends; etc. 2007-06-17 22:09:02 -06:00
Joel Dice
2d44143944 type-generator now builds 2007-06-04 17:39:59 -06:00
Joel Dice
3ba88c12b0 copy makefile, stdc++.cpp, and type-generator.cpp from mess project
and began customizing them for this project
2007-06-03 17:16:07 -06:00