Commit Graph

65 Commits

Author SHA1 Message Date
Joshua Warner
a1583f1ecc touch up type safety in types.def 2014-07-11 13:25:20 -06:00
Joshua Warner
00e2307c39 apply machine.h changes 2014-07-11 13:25:19 -06:00
Joel Dice
9b7d0d1624 update copyright years 2014-04-23 15:33:41 -06:00
Joshua Warner
52b23b8a6a move Allocator to include, properly namespaced 2014-02-25 19:13:41 -07:00
Joshua Warner
5ffdfecdc2 remove vm from code paths, to match namespacing 2014-02-21 13:32:28 -07:00
Joel Dice
66bd7e0814 use "lzma." prefix for LZMA-compressed embedded jars
Previously, we used "lzma:", which worked fine on Windows (where the
path separator is ";") but not on Unix-style OSes (where the path
separator is ":").  In the latter case, the VM would parse
"[lzma:bootJar]" as a path containing two elements, "[lzma" and
"bootJar]", which is not what was intended.  So now we use "lzma." as
the prefix, which works on all OSes.
2014-01-18 19:41:43 -07:00
Joshua Warner
06432253ba consolidate many implicit list types into one 2013-12-11 10:54:50 -07:00
Joshua Warner
2800ffe826 rename JNIEXPORT to AVIAN_EXPORT in common.h, to avoid conflicting with jni.h 2013-11-08 08:35:17 -07:00
Johannes Schindelin
1864180ea7 Teach Finder to find more than just the first matching element
When the system class path contains more than one .jar, it is quite
concievable that, say, 'META-INF/MANIFEST.MF' can be found in multiple
class path elements.

This commit teaches the working horse of class path inspection, the
Finder class, how to continue the search at a given state.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
2013-11-04 16:44:52 -06:00
Joel Dice
87b02eb949 update copyright years
Previously, I used a shell script to extract modification date ranges
from the Git history, but that was complicated and unreliable, so now
every file just gets the same year range in its copyright header.  If
someone needs to know when a specific file was modified and by whom,
they can look at the Git history themselves; no need to include it
redundantly in the header.
2013-07-02 20:52:38 -06:00
Joel Dice
5e2d00010b move headers from src to src/avian
This is necessary to avoid name conflicts on various platforms.  For
example, iOS has its own util.h, and Windows has a process.h.  By
including our version as e.g. "avian/util.h", we avoid confusion with
the system version.
2013-02-27 13:33:29 -07:00
Joshua Warner
ab9f9550cf move tokenizer.h to include/avian/util/string.h, merge in the String declaration from object-writer/tools.h 2013-02-21 16:18:20 -07:00
Joshua Warner
f17b8cef08 move system.h to include 2013-02-20 20:42:09 -07:00
Joshua Warner
b9e281612b move runtime-array to include 2013-02-19 22:56:05 -07:00
Joshua Warner
964d054117 move RUNTIME_ARRAY into it's own header 2013-02-10 18:07:11 -07:00
Joel Dice
a3c4b60f43 rename package avian.avian_vm_resource to avian.avianvmresource
This package name must match the URL protocol we use for loading
embedded resources, but OpenJDK's URL class won't tolerate underscores
in a protocol name.  Also, I had not updated the names of the native
methods in avian.avianvmresource.Handler, leading to
UnsatisfiedLinkErrors when they were called.
2012-10-06 15:33:24 -06:00
Joel Dice
b325221579 rename "resource" URL protocol to "avian_vm_resource"
This fixes a problem with JOSM, which attaches its own meaning to the
"resource" protocol.  The new name is less likely to cause such
conflicts.
2012-08-11 19:01:32 -06:00
Joel Dice
5d9f7b2bc3 add optional LZMA support for compressing embedded JARs, boot images, and shared objects 2012-06-02 09:06:22 -06:00
Joel Dice
0addd8c814 update copyright years 2012-05-11 17:43:27 -06:00
Joel Dice
58dc32382d fix memory management bugs in finder.cpp 2012-03-13 10:30:41 -06:00
Joel Dice
1c85ea8a6e fix GCC 4.6 LTO build
On Ubuntu 11.10, the optimized build was breaking, apparently because
it was eliminating most of the symbols defined in assembly code
(e.g. vmJump) as unreachable when linking libjvm.so, which left
avian-dynamic unlinkable due to an unresolved symbol.

The solution in this commit is to export makeSystem and makeFinder
from libjvm.so rather than build redundant versions of finder.cpp and
posix.cpp/windows.cpp into avian-dynamic like we've been doing.  This
avoids the whole problem of vmJump reachability and reduces the size
of avian-dynamic at the same time.

This commit also turns off LTO for the avian-dynamic link since we get
odd undefined symbol errors about libc-defined symbols otherwise.
This may merit future investigation, but avian-dynamic is so small and
simple that there's no need to optimize it anyway.
2011-11-19 19:26:25 -07:00
Joel Dice
adbe74efbe add debug logging to finder.cpp 2011-07-17 19:48:12 -06:00
Joel Dice
e3662f13a9 update copyright years and increment version number 2011-07-13 08:25:21 -06:00
Joel Dice
ab8e6cdc80 convert classpath paths to absolute paths
This is necessary because some apps expect CodeSource.getLocation() to
return URL containing an absolute path.
2011-07-11 10:56:53 -06:00
Joel Dice
bfe6934183 support multiline Class-Path properties in JAR manifests 2011-05-16 10:34:10 -06:00
Joel Dice
1c7abe782d specify valid code source for system classes
This enables use of a class's protection domain to determine what JAR
or directory it came from.
2011-03-31 19:38:44 -06:00
Joel Dice
3dd091c67a implement jar and file URL stream handlers 2011-03-25 19:14:21 -06:00
Joel Dice
78790a0f68 fix OpenJDK JCE support
This primarily required additions to classpath-openjdk.cpp to
intercept ZipFile, ZipEntry, and JarFile native methods to consult
embedded encryption policy jars when required.
2011-03-04 16:55:31 -07:00
Joel Dice
d520514a87 add support for Class-Path manifest attribute
This attribute, found in some JAR manifests, indicates additional JARs
and/or directories to append to the classpath.  Tomcat in particular
uses it.
2011-02-21 16:05:28 -07:00
Joel Dice
220f7760b7 fix MSVC build regressions 2011-01-21 16:14:21 -07:00
Joel Dice
a5742f5985 update copyright years 2010-12-05 20:21:09 -07:00
Joel Dice
3cba6edf1f print path elements if DebugFind == true in parsePath 2010-11-27 16:27:22 -07:00
Joel Dice
e68dfe1e89 various fixes to get Eclipse 3.6 working
* add libnet.so and libnio.so to built-in libraries for openjdk-src build

 * implement sun.misc.Unsafe.park/unpark

 * implement JVM_SetClassSigners/JVM_GetClassSigners

 * etc.
2010-11-27 11:25:02 -07:00
Joel Dice
d0a6096eb0 add support for accessing embedded JARs as if they were directories
This allows OpenJDK to access time zone data which is normally found
under java.home, but which we must embed in the executable itself to
create a self-contained build.  The VM intercepts various file
operations, looking for paths which start with a prefix specified by
the avian.embed.prefix property and redirecting those operations to an
embedded JAR.

For example, if avian.embed.prefix is "/avian-embedded", and code
calls File.exists() with a path of
"/avian-embedded/javahomeJar/foo.txt", the VM looks for a function
named javahomeJar via dlsym, calls the function to find the memory
region containing the embeded JAR, and finally consults the JAR to see
if the file "foo.txt" exists.
2010-11-05 13:18:28 -06:00
Joel Dice
17f495eb27 rework OpenJDK build to derive classpath and library path from environment
We now consult the JAVA_HOME environment variable to determine where
to find the system library JARs and SOs.  Ultimately, we'll want to
support self-contained build, but this allows Avian to behave like a
conventional libjvm.so.
2010-09-20 17:31:23 -06:00
Joel Dice
561ee6dff9 add debug logging to finder.cpp 2010-09-13 20:38:55 -06:00
Joel Dice
a1ec71423e Merge branch 'master' into powerpc
Conflicts:

	makefile
	src/assembler.h
	src/binaryToMacho.cpp
	src/compile.cpp
	src/compiler.cpp
	src/x86.cpp
2009-02-09 16:22:01 -07:00
Joel Dice
a8a030140c various bugfixes 2008-11-27 21:44:04 -07:00
Joel Dice
6500f1eff6 initial work to support boot image creation and use 2008-11-21 16:20:35 -07:00
Joel Dice
c80eb51c17 Merge branch 'master' into powerpc
Conflicts:

	makefile
	src/assembler.h
	src/compile.cpp
	src/compiler.cpp
	src/compiler.h
	src/finder.cpp
2008-11-11 08:21:48 -07:00
Joel Dice
6f1d02dae7 remove the libstdc++ dependency once and for all
The trick is to make all destructors non-virtual.  This is safe because
we never use the delete operator, which is the only case where virtual
destructors are relevant.  This is a better solution than implementing
our own delete operator, because we want libraries loaded at runtime to
use the libstdc++ version, not ours.
2008-10-28 15:40:50 -06:00
Joel Dice
89cc5aa546 initialize JarElement::region in constructor 2008-09-29 18:04:47 -06:00
Joel Dice
1657fb794c support logging addresses and names of JIT-compiled methods to a file specified via a system property 2008-09-19 11:34:37 -06:00
Joel Dice
9908bbcf50 sketch new version of x86.cpp to conform to new assembler.h APIs 2008-08-19 17:38:37 -06:00
Joel Dice
0d3e6b7793 simplify memory allocation interfaces 2008-04-13 12:15:04 -06:00
Joel Dice
33b32398c2 fix code ordering bug in finder.cpp 2008-04-11 17:37:56 -06:00
Joel Dice
b12226e878 make private copy of libraryName in BuiltinElement 2008-04-01 16:36:00 -06:00
Joel Dice
74295bb707 interpret avian.bootstrap property as a complete file name 2008-03-31 12:57:49 -06:00
Joel Dice
357bd29460 support building Avian as a self-contained dynamic library 2008-03-30 21:43:43 -06:00
Eric Scharff
e616161d5a Fixes jar file loading for compressed jars.
zip files have a central directory header (which has correct information
about files) and a local file header (which sometimes does not.)  Always use
the central directory versions to get accurate data.
2008-02-25 17:29:26 -07:00