Commit Graph

638 Commits

Author SHA1 Message Date
Joshua Warner
85f114ea0f use ir::Type in Compiler::loadLocal 2014-05-30 22:16:39 -06:00
Joshua Warner
53b68a693d add more aggressive checks to Compiler::load* 2014-05-30 22:16:38 -06:00
Joshua Warner
27ea503233 switch Compiler::load* to use ir::Type rather than sizes 2014-05-30 22:16:38 -06:00
Joshua Warner
9c98986f99 remove redundant Compiler::store dstType parameter 2014-05-30 22:16:38 -06:00
Joshua Warner
0ee3eec478 add extra type checks to Compiler::store 2014-05-30 22:16:38 -06:00
Joshua Warner
8b1739dc0f remove redundant Compiler::stackCall resultSize parameter 2014-05-30 22:16:38 -06:00
Joshua Warner
1d466a800e remove redundant Compiler::call resultSize parameter 2014-05-30 22:16:38 -06:00
Joshua Warner
9805ff94b4 remove redundant Compiler::memory scale parameter 2014-05-30 22:16:38 -06:00
Joshua Warner
f9b781149e add extra type checks to Compiler::store and Compiler::memory 2014-05-30 22:16:38 -06:00
Joshua Warner
1fc6011bf7 add extra flavor type check to Compiler::store 2014-05-30 22:16:37 -06:00
Joshua Warner
aef5acce84 add flavor type check to Compiler::store 2014-05-30 22:16:35 -06:00
Joshua Warner
2ed52c05a8 use ir::Type in Compiler::store 2014-05-30 21:19:33 -06:00
Joshua Warner
8af9bb8297 change Compiler::register_ to Compiler::threadRegister, since it was only used as such 2014-05-30 21:19:32 -06:00
Joshua Warner
2d444830d0 use ir::Type in Compiler::unaryOp and Compiler::binaryOp 2014-05-30 21:19:32 -06:00
Joshua Warner
6ed7681dc0 use ir::Type in f2i and friends, instead of aSize 2014-05-30 21:19:27 -06:00
Joshua Warner
704c05f818 use ir::Type in place of Compiler::OperandType 2014-05-29 15:30:46 -06:00
Joshua Warner
d8914a9646 use ir::Type in Compiler::initLocal 2014-05-29 15:30:46 -06:00
Joshua Warner
4bfb359cdd use ir::Type in Compiler::pop 2014-05-29 15:30:46 -06:00
Joshua Warner
13342d28be use ir::Type in Compiler::save 2014-05-29 15:30:46 -06:00
Joshua Warner
49a5a9f398 use ir::Type in Compiler::push 2014-05-29 15:30:45 -06:00
Joshua Warner
d9fee1025c use ir::Type in Compiler::return_ 2014-05-29 15:30:45 -06:00
Joshua Warner
587b1e3eda use ir::Type in place of lir::ValueType in Value 2014-05-29 15:30:45 -06:00
Joshua Warner
855534b152 introduce ir::Type and begin migrating i2f and friends to it 2014-05-29 15:30:45 -06:00
Joshua Warner
e2f613e063 cleanly destroy MyProcessor to allow for creating/destroying VMs in the same process multiple times 2014-05-20 17:26:11 -06:00
Joel Dice
4a83b671b3 fix crash on exit due to order of operations bug in ~RawMonitorResource
The problem (which we've only been able to reproduce consistently with
the openjdk-src process=interpret build on Linux virtual machines) was
a race condition during VM shutdown.  Thread "A" would exit, see there
were other threads still running and thus enter ZombieState, which
involves acquiring and releasing a lock using RawMonitorResource.
Then the last thread (thread "B") would exit, wait for thread "A" to
release the lock, then shut down the VM, freeing all memory.  However,
thread "A" writes to its Thread object one last time after releasing
the lock (in ~Resource, the destructor of the superclass of
RawMonitorResource, which sets Thread::resource).  If thread "B" frees
that Thread before ~Resource runs, we end up writing to freed memory.

Thus, we need to update Thread::resource before releasing the lock.
Apparently C++ destructors run in order from most derived to least
derived, which is not what we want here.  My solution to split
Resource into two classes, one that has no destructor and another that
extends it (called AutoResource) which does hafe a destructor.  Now
all the classes which used to extend Resource extend AutoResource,
except for RawMonitorResource, which extends Resource directly so it
can control the order of operations.
2014-05-10 23:25:59 -06:00
Joshua Warner
41adb74eb1 remove powerpc support 2014-04-29 13:26:40 -06:00
Joshua Warner
34962ff334 Merge pull request #245 from dicej/jdk8
add support for using the OpenJDK 8 class library
2014-04-24 18:50:38 -06:00
Joel Dice
7de555c797 add support for using the OpenJDK 8 class library
This ensures that all tests pass when Avian is built with an
openjdk=$path option such that $path points to either OpenJDK 7 or 8.

Note that I have not yet tried using the openjdk-src option with
OpenJDK 8.  I'll work on that next.
2014-04-23 15:36:56 -06:00
Joel Dice
9b7d0d1624 update copyright years 2014-04-23 15:33:41 -06:00
Joel Dice
1b8b27fb6b add expect call to ensure tryAllocateExecutable actually succeeds
For some reason, running Avian under the SVN version of Valgrind
caused mmap to fail, which caused tryAllocateExecutable to return a
null pointer, which led to a non-obvious crash later on.  Adding an
expect to check the result immediately will at least make it obvious
what went wrong.
2014-04-11 19:52:53 -06:00
Joel Dice
fd778c2c76 remove redundant interfaces and generalize shift/reset generics
Turns out Function can do the jobs of both CallbackReceiver and
FunctionReceiver, so I've removed the latter two.

Also, shift and reset should work with a combination of types, not
just a single type, so I've expanded their generic signatures.
2014-03-21 07:38:29 -06:00
Joshua Warner
56ec7fc1f9 Merge pull request #200 from dicej/stack-signal
fix a few stack walking and signal handling bugs
2014-03-14 10:45:18 -06:00
Joel Dice
73e60adeab always add a trap instruction after a throw
Tail call and dead code optimizations can cause code after a throw to
be eliminated, which confuses findUnwindTarget because it doesn't know
what code is throwing the exception.  So we need at least one
instruction to follow the call to the throw_ thunk.  Previously, we
only added such an instruction when we knew the throw was the last
instruction in the bytecode, but it turns out there are other cases
where it is needed, including certain try/finally situations.
2014-03-14 09:54:05 -06:00
Joshua Warner
7fa8c7ec20 remove unused constants (fixes #198) 2014-03-14 09:06:19 -06:00
Joel Dice
1cd822b23e Merge pull request #180 from joshuawarner32/move-allocator
Move allocator & Slice into util
2014-02-27 08:55:24 -07:00
Joshua Warner
e6eead07fa call vm::dynamicCall directly, instead of through System 2014-02-26 15:10:41 -07:00
Joshua Warner
a807966143 use Slice<uint8_t> in FixedAllocator 2014-02-25 20:34:03 -07:00
Joshua Warner
b083f3df04 move fixed allocator out of machine.h 2014-02-25 20:34:03 -07:00
Joshua Warner
bc9f7d2f87 refactor SignalRegistrar interface 2014-02-21 23:37:32 -07:00
Joshua Warner
730dade53e break out signal handling from System 2014-02-21 23:36:40 -07:00
Joshua Warner
5ffdfecdc2 remove vm from code paths, to match namespacing 2014-02-21 13:32:28 -07:00
Joel Dice
1735a7976a do not omit calls to empty methods which may trigger class initialization
There's a small optimization in compileDirectInvoke which tries to
avoid generating calls to empty methods.  However, this causes
problems for code which uses such a call to ensure a class is
initialized -- if we omit that call, the class may not be
initialized and any side effects of that initialization may not
happen when the program expects them to.

This commit ensures that the compiler only omits empty method calls
when the target class does not need initialization.  It also removes
commented-out code in classpath-openjdk.cpp which was responsible for
loading libmawt proactively; that was a hack to get JogAmp to work
before we understood what the real problem was.
2014-02-10 08:40:14 -07:00
Joshua Warner
233a12bf2b remove unnecessary variable initialization 2014-01-03 14:04:57 -07:00
Joshua Warner
6d5f511d04 fix silly error in recent compiler refactor 2014-01-03 12:23:36 -07:00
Joel Dice
e19bdda13e fix uninitialized value warning in compile.cpp
Clang was complaining that newIp might be used uninitialized at the
bottom of our giant, unstructured compile loop, so I initialized it
with a bogus value, which means it will at least fail consistently if
Clang is right and there really is a path by which that code is
reached without otherwise initializing newIp.
2014-01-02 17:44:33 -07:00
Joshua Warner
fa65c67fbf Extract independent runtime thunks into their own file 2013-12-18 22:46:58 -07:00
Joshua Warner
f1c6b97373 Reformat a few extra-long lines 2013-12-18 22:25:23 -07:00
Joshua Warner
b3d6f5d94d Remove redundancy in compiling jump operations 2013-12-18 22:20:18 -07:00
Joshua Warner
ac984775a5 Remove redundancy in compiling arithmetic operations 2013-12-18 22:03:42 -07:00
Joshua Warner
eab36b3a23 Remove boilerplate code (nullaryOp methods in Compiler) 2013-12-18 16:51:20 -07:00