Commit Graph

37 Commits

Author SHA1 Message Date
Joshua Warner
06432253ba consolidate many implicit list types into one 2013-12-11 10:54:50 -07: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
e0ceaa5f43 avoid allocating new memory in hashMapRemove when GCing
This ensures that we don't abort when running an internal finalizer
that removes from a hash map.
2013-04-22 21:17:31 -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
Joel Dice
0addd8c814 update copyright years 2012-05-11 17:43:27 -06:00
Joshua Warner
fa9814b86d remove lots of unnecessary sizeof computations with a convenient 'operator new' overload 2012-05-08 16:14:54 -06:00
Joel Dice
e3662f13a9 update copyright years and increment version number 2011-07-13 08:25:21 -06:00
Joel Dice
468edb97d2 work around GCC name mangling bug
It seems that older versions of GCC (4.0 and older, at least) generate
assembly files with duplicate symbols for function templates which
differ only by the attributes of the templated types.  Newer versions
have no such problem, but we need to support both, hence the
workaround in this commit of using a dedicated, non-template "alias"
function where we previously used "cast<alias_t>".
2011-02-14 11:47:59 -07:00
Joel Dice
8d50d0fd76 fix aliasing bug in util.cpp
We use a template function called "cast" to get raw access to fields
in in the VM.  In particular, we use this function in util.cpp to
treat reference fields as intptr_t fields so we can use the least
significant bit as the red/black flag in red/black tree nodes.
Unfortunately, this runs afoul of the type aliasing rules in C/C++,
and the compiler is permitted to optimize in a way that assumes such
aliasing cannot occur.  Such optimization caused all the nodes in the
tree to be black, leading to extremely unbalanced trees and thus slow
performance.

The fix in this case is to use the __may_alias__ attribute to tell the
compiler we're doing something devious.  I've also used this technique
to avoid other potential aliasing problems.  There may be others
lurking, so a complete audit of the VM might be a good idea.
2011-02-11 21:57:27 -07:00
Joel Dice
a5742f5985 update copyright years 2010-12-05 20:21:09 -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
d819a75f36 more work towards OpenJDK classpath support
The biggest change in this commit is to split the system classloader
into two: one for boot classes (e.g. java.lang.*) and another for
application classes.  This is necessary to make OpenJDK's security
checks happy.

The rest of the changes include bugfixes and additional JVM method
implementations in classpath-openjdk.cpp.
2010-09-14 10:49:41 -06:00
Joel Dice
d1018bf078 update copyright years 2009-03-15 12:02:36 -06:00
Joel Dice
6e6035505c zero heap space ahead of time when allocating raw storage and garbage collecting, not when allocating individual objects
This helps us support the Java Memory Model without adding a memory
barrier to every object allocation.  It's also potentially more
efficient, since we zero out each heap segment all at once instead of
bit-by-bit with each object allocation.
2009-03-03 20:05:48 -07:00
Joel Dice
25ade1484a lots of bugfixes and refactoring 2008-12-01 19:38:00 -07:00
Joel Dice
fb9b2bf173 avoid creating garbage when iterating over hashmaps 2008-11-22 16:38:41 -07:00
Joel Dice
4392b04fd0 avoid creating unecessary garbage in treeInsertNode and friends 2008-11-22 16:25:35 -07:00
Joel Dice
2e2925c321 fix backwards logic in treeMapInsert which prevented correct balancing 2008-11-22 14:14:52 -07:00
Joel Dice
297e8f09ec don't calculate the index in hashMapInsert until it's needed 2008-08-11 16:44:38 -06:00
Joel Dice
5f4d86a703 avoid potential corruption in hashMapInsert due to table-resize-on-GC 2008-08-11 15:20:12 -06:00
Joel Dice
623b5f84dc fix GC-in-hashMapResize bug which occasionally resulted in corrupt Machine::monitorMap 2008-07-12 10:38:09 -06:00
Joel Dice
9c82bd2386 Merge branch 'master' of oss.readytalk.com:/var/local/git/avian 2008-07-11 22:01:57 -06:00
Joel Dice
fcd4f0c8f5 third attempt to properly fix race condition in compile function 2008-07-11 22:01:42 -06:00
Joel Dice
fa3ceb0a75 add assertions to hashMapResize and hashMapRemove to help debug rare infinite loop 2008-07-11 19:26:46 -06:00
Joel Dice
31e5e4c286 fix GC safety bugs in leftRotate and rightRotate 2008-04-11 18:05:03 -06:00
Joel Dice
7eef2e7918 fix GC safety bug in cloneTreeNode 2008-04-11 17:40:36 -06:00
Joel Dice
2cf62a5926 various bugfixes in new stack trace code 2008-04-10 17:48:28 -06:00
Joel Dice
ebffc5852c various search tree fixes 2008-04-07 18:14:59 -06:00
Joel Dice
2dba75d7f2 fix reversed logic in treeNodeRed 2008-04-07 18:03:16 -06:00
Joel Dice
7ee29d4939 progress towards general stack trace support 2008-04-07 17:47:41 -06:00
Joel Dice
50040b24f5 remove unused code from util.cpp 2008-03-21 14:33:44 -06: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
ee60d48cfe fix subtle bug in hashMapInsert which caused us to update the old array previously associated with the hash map, whereas a GC causes the table to be resized when a weak reference is removed and thus a new array used 2008-01-19 13:12:16 -07:00
Joel Dice
286f290665 more JIT progress 2007-12-10 17:48:09 -07:00
Joel Dice
6ac124f2fb protect local variables in red-black tree implementation from GC 2007-11-27 08:46:31 -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