Bernhard Urban [Sun, 9 Sep 2012 16:03:45 +0000 (18:03 +0200)]
codegen: handle exceptions of a method
also, use bimap for mapping jpc and npc values
TODO: if no handler is found, throw it to caller method
Bernhard Urban [Sun, 9 Sep 2012 12:56:15 +0000 (14:56 +0200)]
codegen: get full jnmap in patcher
at compile-time, the java PC to native PC map is not complete yet.
Bernhard Urban [Sun, 9 Sep 2012 12:46:40 +0000 (14:46 +0200)]
codegen: map each real PC to java bytecode PC
and store that information also in the global table (needed for handling a
exception at runtime)
Bernhard Urban [Sun, 9 Sep 2012 12:24:01 +0000 (14:24 +0200)]
basicblock: store length of basiblock (i.e. bytes of instructionstream)
Bernhard Urban [Sun, 9 Sep 2012 12:04:26 +0000 (14:04 +0200)]
basicblock: build exceptionmap
Bernhard Urban [Sun, 9 Sep 2012 15:07:58 +0000 (17:07 +0200)]
java/lang: env for exceptions
Bernhard Urban [Sun, 9 Sep 2012 11:38:13 +0000 (13:38 +0200)]
codegen: simplify glue code and emit code for all basicblocks
hence, also blocks which are not reachable in a non-exceptional case (aka.
exception handlers)
Bernhard Urban [Sun, 9 Sep 2012 15:59:57 +0000 (17:59 +0200)]
basicblock: handle athrow as return
Bernhard Urban [Sun, 9 Sep 2012 09:59:24 +0000 (11:59 +0200)]
codegen: make use of Functor instance
Bernhard Urban [Wed, 5 Sep 2012 18:36:49 +0000 (20:36 +0200)]
basicblock: build up CFG differently
we already get all those entry points in the previous pass
Bernhard Urban [Wed, 5 Sep 2012 17:52:48 +0000 (19:52 +0200)]
basicblock: rewrite buildCFG with states
Bernhard Urban [Tue, 4 Sep 2012 18:59:34 +0000 (20:59 +0200)]
basicblock: annotate BBs with exceptions
Bernhard Urban [Tue, 4 Sep 2012 17:18:14 +0000 (19:18 +0200)]
basiblock: remove `markBackwardTargets'
... and fold it into `calculateInstructionOffsets', using state monad power.
I added an older testcase, as it forces this situation. However, it won't fail
when removing this feature, but it would lead to code duplication on basicblock
level.
Bernhard Urban [Tue, 4 Sep 2012 16:34:01 +0000 (18:34 +0200)]
basicblock: using arrows
I feel so awesome now, woooot :D
Bernhard Urban [Sun, 2 Sep 2012 18:36:53 +0000 (20:36 +0200)]
basicblock: use state monad to save all targets from previous pass
speedup at BigInstance1: 6s -> 2s
Bernhard Urban [Sun, 2 Sep 2012 17:59:44 +0000 (19:59 +0200)]
basicblock: use simpler type
Bernhard Urban [Sun, 2 Sep 2012 17:33:34 +0000 (19:33 +0200)]
basicblock: small optimization of algo
Bernhard Urban [Sun, 2 Sep 2012 10:12:01 +0000 (12:12 +0200)]
athrow: add trapskeleton for it
Bernhard Urban [Sun, 2 Sep 2012 09:43:12 +0000 (11:43 +0200)]
debug: show disasm in intel syntax
as the codeGen syntax is more like intel syntax ;/
Bernhard Urban [Wed, 29 Aug 2012 10:53:15 +0000 (12:53 +0200)]
instanceOf: test anonymous interface
Harald Steinlechner [Sat, 1 Sep 2012 21:42:43 +0000 (23:42 +0200)]
GC: implemented QuickCheck magic to test GC of huge object trees
Harald Steinlechner [Sat, 1 Sep 2012 18:33:58 +0000 (20:33 +0200)]
GC: implemented basic GC memory swapping; some refactoring
Harald Steinlechner [Sat, 1 Sep 2012 17:17:23 +0000 (19:17 +0200)]
GC: TwoSpace copy evacuation basically works
Harald Steinlechner [Sat, 1 Sep 2012 14:35:49 +0000 (16:35 +0200)]
GC/MemoryManager: implemented evacuate
Harald Steinlechner [Sat, 1 Sep 2012 13:08:01 +0000 (15:08 +0200)]
GC: refactored Ptr specific test implementation into Mate/Tests/MockRefs;
Harald Steinlechner [Sat, 1 Sep 2012 12:54:42 +0000 (14:54 +0200)]
GC: added newRef field
Harald Steinlechner [Fri, 31 Aug 2012 23:55:17 +0000 (01:55 +0200)]
scratch: stack->register mapping experiments. preparation for hoopl tests
Harald Steinlechner [Sun, 26 Aug 2012 14:50:00 +0000 (16:50 +0200)]
scratch/GC: playground for datastructures to be used in GC - probably...
Bernhard Urban [Tue, 28 Aug 2012 22:58:08 +0000 (00:58 +0200)]
hlint: style cleanup
Bernhard Urban [Tue, 28 Aug 2012 22:24:20 +0000 (00:24 +0200)]
instanceOf: also consider interfaces
Bernhard Urban [Tue, 28 Aug 2012 17:39:50 +0000 (19:39 +0200)]
instanceOf: class hierarchy are considered properly now
TODO: interfaces
Bernhard Urban [Tue, 28 Aug 2012 15:11:12 +0000 (17:11 +0200)]
instanceOf: make decision at runtime
preperation for a serious instanceOf implementation
Harald Steinlechner [Mon, 27 Aug 2012 18:16:53 +0000 (20:16 +0200)]
MemoryManager: twoSpace memorymanager initialization code; here its time for monad transformers...
Harald Steinlechner [Mon, 27 Aug 2012 17:43:18 +0000 (19:43 +0200)]
moved GC/MemoryManager into Mate (more comfortable with packages etc - integration approaches ;-))
Harald Steinlechner [Mon, 27 Aug 2012 17:41:04 +0000 (19:41 +0200)]
scratch/GC: progress with data structures and traversals
Harald Steinlechner [Mon, 27 Aug 2012 16:30:32 +0000 (18:30 +0200)]
scratch/GC: progress with data structures and traversals
Harald Steinlechner [Mon, 27 Aug 2012 12:28:37 +0000 (14:28 +0200)]
scratch/GC: sketched datastructures etc for obj graph traversal
Bernhard Urban [Mon, 27 Aug 2012 11:10:17 +0000 (13:10 +0200)]
objectformat: one word after mtable in object layout
also use ptrSize in ClassPool
Bernhard Urban [Mon, 27 Aug 2012 10:08:30 +0000 (12:08 +0200)]
trapmap: delete some entries
Bernhard Urban [Mon, 27 Aug 2012 09:59:16 +0000 (11:59 +0200)]
patching: define patcher in X86CodeGen itself where possible
Bernhard Urban [Sun, 26 Aug 2012 22:22:26 +0000 (00:22 +0200)]
lazy classloading: yet another bug
by computing the field access offset, the class has to loaded. but this should
happen at runtime, on the first field access, not at compile time. see
tests/Instance7.java
Bernhard Urban [Mon, 27 Aug 2012 09:10:08 +0000 (11:10 +0200)]
traps: delete traps... TODO
Bernhard Urban [Sat, 25 Aug 2012 19:12:03 +0000 (21:12 +0200)]
README: remove old information
Bernhard Urban [Sat, 25 Aug 2012 19:06:03 +0000 (21:06 +0200)]
debug: remove #ifdef's and use dumb logger
advantage:
- Haskell code, i.e. tools like hlint or ghc-mod don't have problems with
processing the source files with CPP
- no (ugly?) old school CPP stuff
disadvantage:
- it's not really a printf thingy (maybe we'll be able to use it soon)
Bernhard Urban [Fri, 24 Aug 2012 18:21:13 +0000 (20:21 +0200)]
Wall: remove some warnings
Bernhard Urban [Fri, 24 Aug 2012 18:18:21 +0000 (20:18 +0200)]
globalmaphack: be more general (fmap, factoring, ...)
Bernhard Urban [Fri, 24 Aug 2012 17:48:14 +0000 (19:48 +0200)]
Revert "globalmaphack: use old school CPP"
fall back to "standard" cpp by ghc, since cpphs doesn't work with ghc-mod.
This reverts commit
94985402292306da1db46b1750927ef46bdb87d3.
Conflicts:
Makefile
Harald Steinlechner [Fri, 24 Aug 2012 13:03:27 +0000 (15:03 +0200)]
GarbageAlloc: little refactoring - all GC allocate methods should have GC suffix; all non GC methods on the other hand should suffix Unmanaged;
Harald Steinlechner [Fri, 24 Aug 2012 12:41:38 +0000 (14:41 +0200)]
MethodPool: removed demo call stuff - added printGCStats instead;
added Makefile to build simple GC tests in scratch (tests which cannot be run with openjdk currently because native interface stuff);
Harald Steinlechner [Fri, 24 Aug 2012 09:21:46 +0000 (11:21 +0200)]
hs-boehmgc/buildsystem: rm of tempdir after cabal install caused problems with foreign libs (libgc not found during linking); this occurs due to linking with mate - altough cabal Setup.hs patches correct extra-library-dirs these dirs dont exist after build;
there are two possible fixes:
- ship hs-boehmgc with libgc
- patch cabal install dirs into cabal file in Setup.hs
Harald Steinlechner [Thu, 23 Aug 2012 18:44:21 +0000 (20:44 +0200)]
experiments with JNI;
Harald Steinlechner [Thu, 23 Aug 2012 15:45:47 +0000 (17:45 +0200)]
GC: first working version of boehm gc. working with:
8af66bf9d36f75558ec49e0461099d5f41024574 of hs-boehmgc
Harald Steinlechner [Wed, 22 Aug 2012 18:20:05 +0000 (20:20 +0200)]
gc: delegated mallocs in GarbageAlloc to hs-boehmgc (Mate.GC.Boehm.mallocBytes);
tests: implemented little memory leaking example
jmate: added sketch implementation of Runtime class (which should be used to query heap memory and force GCs)
Bernhard Urban [Wed, 22 Aug 2012 18:01:07 +0000 (20:01 +0200)]
native: demo for a call to haskell functions at runtime
still a hack though
Bernhard Urban [Mon, 20 Aug 2012 20:18:47 +0000 (22:18 +0200)]
style suggestion for data decl.
Bernhard Urban [Mon, 20 Aug 2012 16:21:23 +0000 (18:21 +0200)]
debug: more readable debuginfo
Bernhard Urban [Sat, 18 Aug 2012 16:22:46 +0000 (18:22 +0200)]
traps: use harpy for patching
pro:
o more readable
contra:
o probably slower than plain patching
o no saftey checks any more (but we could add that if we want)
Bernhard Urban [Fri, 17 Aug 2012 22:21:12 +0000 (00:21 +0200)]
invokevirtual: implement lazy class loading right
also use a different trap strategy, namely SIGILL instead of SIGSEGV, which
makes handling a lot easier and simplifies code imho.
Bernhard Urban [Fri, 17 Aug 2012 17:21:45 +0000 (19:21 +0200)]
codegen: approx. initial codebuffer size according to codesize @ bytecode
Bernhard Urban [Fri, 17 Aug 2012 17:21:45 +0000 (19:21 +0200)]
tests: big object fail
Bernhard Urban [Fri, 17 Aug 2012 17:21:45 +0000 (19:21 +0200)]
debug: ifdef this, because ghc doesn't eliminate this :/
Bernhard Urban [Fri, 17 Aug 2012 17:21:45 +0000 (19:21 +0200)]
nativeMaschine: use NativeWord instead of Word32
Bernhard Urban [Fri, 17 Aug 2012 17:21:45 +0000 (19:21 +0200)]
new insn: fix wrong behaviour on lazy class init
TODO:
- invokevirtual
- invokeinterface
Bernhard Urban [Fri, 17 Aug 2012 17:21:45 +0000 (19:21 +0200)]
codegen: register dump at runtime
just a debugging aid
Bernhard Urban [Fri, 17 Aug 2012 17:21:45 +0000 (19:21 +0200)]
java runtime: add simple version of instanceof
just works if we check for the same type, like:
> A a = new A();
> if (a instanceof A) {
> [...]
Bernhard Urban [Fri, 17 Aug 2012 17:21:45 +0000 (19:21 +0200)]
refactor: trivial stuff and add -fwarn-tabs to $(GHC_OPT)
Bernhard Urban [Fri, 17 Aug 2012 17:21:45 +0000 (19:21 +0200)]
TODO: update; Debug: note about `printfFake'
Bernhard Urban [Thu, 2 Aug 2012 20:01:50 +0000 (22:01 +0200)]
Makefile: add boot class dependency for debug build
Bernhard Urban [Thu, 9 Aug 2012 14:17:28 +0000 (16:17 +0200)]
basicblock: stupid index bug @ debug output
Bernhard Urban [Thu, 2 Aug 2012 19:37:24 +0000 (21:37 +0200)]
installenv: use custom harpy repo
and provide a simple shell function for installing from a git
repository
Bernhard Urban [Thu, 2 Aug 2012 19:37:24 +0000 (21:37 +0200)]
staticcall trap: use different magic sequence
place invalid opcode *before* both NOPs, otherwise two NOP instrunctions are
executed before every actual traphandling stuff (although, CPUs nowadays will
optimize those NOP-sequences away anyways I guess...)
btw, fuuuu @ byte order *sigh* I'll never get it...
Bernhard Urban [Thu, 2 Aug 2012 19:37:24 +0000 (21:37 +0200)]
debugmode: no maybe anymore
Bernhard Urban [Thu, 2 Aug 2012 19:37:24 +0000 (21:37 +0200)]
hlint: stuff
Bernhard Urban [Thu, 2 Aug 2012 19:37:24 +0000 (21:37 +0200)]
nativeMachine: use constants
- rename NativeMaSchine to NativeMachine
- new module for constants in order to avoid module cycles
Bernhard Urban [Tue, 31 Jul 2012 20:22:28 +0000 (22:22 +0200)]
nativeMaschine: s/unsigned int/ptrdiff_t/g
more portable
Bernhard Urban [Tue, 31 Jul 2012 20:22:28 +0000 (22:22 +0200)]
nativeMaschine: add module for binding target machine
TODO: use wordSize where appropriate
Bernhard Urban [Tue, 31 Jul 2012 20:22:28 +0000 (22:22 +0200)]
refactor: store amount of arguments of a method in RawMethod
also kick `Maybe' at parseMethod in BasicBlock. It's just annoying to unpack
it from Maybe everywhere. Just fail @ parseMethod if we don't find the codeseg
Bernhard Urban [Tue, 31 Jul 2012 20:22:28 +0000 (22:22 +0200)]
code style: just different indent
Bernhard Urban [Tue, 31 Jul 2012 20:22:28 +0000 (22:22 +0200)]
maxlocals: store it in new data type RawMethod, with MapBB & Co
we need that information, in order to reserve enough memory on the stack (was
hardcoded so far)
Bernhard Urban [Tue, 31 Jul 2012 20:22:28 +0000 (22:22 +0200)]
Makefile: don't delete tags file
Bernhard Urban [Tue, 31 Jul 2012 20:22:28 +0000 (22:22 +0200)]
codegen: factor i{load,store} shortcuts
Bernhard Urban [Tue, 31 Jul 2012 20:22:28 +0000 (22:22 +0200)]
TODO: replace traps?
Bernhard Urban [Wed, 18 Jul 2012 21:12:20 +0000 (23:12 +0200)]
refactor: style, fun, hlint, ...
warmup for serious stuff (hopefully)
Bernhard Urban [Wed, 18 Jul 2012 20:59:20 +0000 (22:59 +0200)]
Makefile: cleanup/describe options, update .PHONY, ...
Bernhard Urban [Wed, 18 Jul 2012 17:33:33 +0000 (19:33 +0200)]
globalmaphack: use old school CPP
I tried (1) typeclasses and (2) TH, but failed:
(1) typeclasses are not designed to emulate object managment
(2) TH needs GHCi (or at least something at compile-time?), and this doesn't
work well with MateVM build stuff :/
Bernhard Urban [Tue, 17 Jul 2012 20:02:47 +0000 (22:02 +0200)]
Makefile: adapt *.compile for new javac behaivour too
Bernhard Urban [Tue, 17 Jul 2012 18:27:06 +0000 (20:27 +0200)]
gdb: disable ghc's rts timer and disable signal handlers
debugging jitted code is nice again (as it was with 6.12.*)
Bernhard Urban [Tue, 17 Jul 2012 17:41:07 +0000 (19:41 +0200)]
Makefile: fix for new javac version
seems like it doesn't search the userdir as before
Bernhard Urban [Tue, 17 Jul 2012 17:10:27 +0000 (19:10 +0200)]
refactor stuff
Bernhard Urban [Thu, 21 Jun 2012 08:20:13 +0000 (10:20 +0200)]
cabal: removed mate-common
it feels still a bit hackish...
Bernhard Urban [Wed, 20 Jun 2012 20:22:31 +0000 (22:22 +0200)]
Makefile: `ghci' and `tags' targets
woot
Bernhard Urban [Tue, 19 Jun 2012 20:11:17 +0000 (22:11 +0200)]
add package jmate
avoid name clashes when using GNU classpath. should be useful for debugging
classpath code.
at the end of the day, we should remove `java/' and maybe `jmate/'
Bernhard Urban [Mon, 18 Jun 2012 17:48:54 +0000 (19:48 +0200)]
codegen: throw: force runtime error on execution
Bernhard Urban [Mon, 18 Jun 2012 16:56:12 +0000 (18:56 +0200)]
native: cleaner arraycopy
Bernhard Urban [Tue, 19 Jun 2012 19:02:23 +0000 (21:02 +0200)]
types: remove dirty Ord instance of MethodSignature
we moved that finally to hs-java-0.3.3
Bernhard Urban [Mon, 18 Jun 2012 16:39:17 +0000 (18:39 +0200)]
traps: don't delete entry after consuming it
see the source code comment. would be nice to enable deletion again
Bernhard Urban [Mon, 18 Jun 2012 16:33:26 +0000 (18:33 +0200)]
codegen: typestuff for compiling classpath files
Bernhard Urban [Sat, 16 Jun 2012 21:21:57 +0000 (23:21 +0200)]
codegen: again, a bug regarding BB ordering
Bernhard Urban [Sat, 16 Jun 2012 20:15:02 +0000 (22:15 +0200)]
codegen: shift insn
Bernhard Urban [Sat, 16 Jun 2012 17:39:48 +0000 (19:39 +0200)]
native: add VMSystem.arraycopy