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
Bernhard Urban [Wed, 13 Jun 2012 22:09:00 +0000 (00:09 +0200)]
codegen: workaround for a emitBB bug
Bernhard Urban [Wed, 13 Jun 2012 14:37:56 +0000 (16:37 +0200)]
codegen: print every jvm instruction as label in disasm output
Bernhard Urban [Tue, 12 Jun 2012 20:08:36 +0000 (22:08 +0200)]
codegen: some more tests
Bernhard Urban [Tue, 12 Jun 2012 19:40:28 +0000 (21:40 +0200)]
codegen: eliminate code duplication
Bernhard Urban [Tue, 12 Jun 2012 10:43:22 +0000 (12:43 +0200)]
refactor: better names for TrapInfo^WTrapCause
Bernhard Urban [Tue, 12 Jun 2012 10:32:42 +0000 (12:32 +0200)]
Makefile: let testfiles be a dependency for the tests target
- just compile java files needed for executing mate (e.g. java/* stuff)
- also satisify a dependency with a wrong classfile as we test something
different here (see ClassPath3.*). yes, it's a hack, as our "test framework"
isn't really mature :-)
Bernhard Urban [Tue, 12 Jun 2012 10:06:05 +0000 (12:06 +0200)]
hlint: more fixes
not everything fixed though. some ugly things in the codegen hopefully disappears
sometimes (e.g. due to an awesome reg allocator ;))
Bernhard Urban [Mon, 11 Jun 2012 19:02:20 +0000 (21:02 +0200)]
ffi: don't use C for obtaining an address of a haskell function
i.e. get rid of dirty FFI hacks.
thanks to simonmar:
http://stackoverflow.com/questions/
10967598/get-the-address-of-a-function-without-ffi#comment14326263_10967598
Bernhard Urban [Thu, 24 May 2012 13:53:57 +0000 (15:53 +0200)]
tools: cabal: update to new harpy version
Bernhard Urban [Sun, 20 May 2012 21:29:37 +0000 (23:29 +0200)]
codegen: add instanceof stub
gnuclasspath is going crazy now o_O
Bernhard Urban [Sun, 20 May 2012 20:56:24 +0000 (22:56 +0200)]
tools: install libs with profile information
Bernhard Urban [Sun, 20 May 2012 20:10:36 +0000 (22:10 +0200)]
trapmap: delete entry after information is consumed
Bernhard Urban [Sun, 20 May 2012 20:04:19 +0000 (22:04 +0200)]
debug.h: define DBG_ALL
Bernhard Urban [Sun, 20 May 2012 19:56:49 +0000 (21:56 +0200)]
codegen: extra handling if calldisplacement doesn't fit in 8bit
harpy generates different code for
- call (Disp (0x33 :: Word32) (eax)
- call (Disp (0x444 :: Word32) (eax))
although if both immediates are declared as Word32, harpy checks
at emmitting if it's able to reduce code size.
hopefully we find a easier way to fix this issue, because this way
just introduces more complexity.
Bernhard Urban [Sun, 20 May 2012 19:55:47 +0000 (21:55 +0200)]
codegen/div: clear edx before use div insn
Bernhard Urban [Sun, 20 May 2012 13:35:31 +0000 (15:35 +0200)]
codegen: a few more hacks to get more of classpath running
Bernhard Urban [Sun, 20 May 2012 19:50:49 +0000 (21:50 +0200)]
methodlookup: unique identifier for methods are name+signature
in our case always the "first" method with the name was taken
(the signature was ignored)
Bernhard Urban [Sun, 20 May 2012 19:49:22 +0000 (21:49 +0200)]
classpool: staticfields calculation: bugfix
span doesn't do what I believed it does (it aborts on first predicate match)
Bernhard Urban [Sun, 20 May 2012 13:17:23 +0000 (15:17 +0200)]
tests: generics
Bernhard Urban [Sun, 20 May 2012 19:47:05 +0000 (21:47 +0200)]
traps: debugging
Bernhard Urban [Sun, 20 May 2012 12:27:26 +0000 (14:27 +0200)]
tests: static classes
Bernhard Urban [Sun, 20 May 2012 19:42:48 +0000 (21:42 +0200)]
classpool: cache class file access
it was designed for that, so do it... *sigh*
sometimes I'm so dumb
most things are intend stuff
Bernhard Urban [Sun, 20 May 2012 10:32:07 +0000 (12:32 +0200)]
string: allocate a real java object for strings
incl. fieldtable, array, ...
also see:
http://www.javamex.com/tutorials/memory/string_memory_usage.shtml
Bernhard Urban [Sun, 20 May 2012 10:21:57 +0000 (12:21 +0200)]
debug: malloc stuff
Bernhard Urban [Sun, 20 May 2012 19:37:08 +0000 (21:37 +0200)]
array: char array support
Bernhard Urban [Sun, 20 May 2012 00:00:10 +0000 (02:00 +0200)]
Makefile: optional call file for testcases
in order to easier pass arguments to the JVM for certain testcases,
e.g. classpath stuff
Bernhard Urban [Sun, 20 May 2012 00:10:12 +0000 (02:10 +0200)]
main: some kind of argument parsing
o -cp, -classpath and -jar support now from commandline.
args parsing is a mess, I know. Unfortunately I can't use
getopt here, because the weird argument syntax of openjdk
java.
o finally, calls like `./mate tests.Static5' are also possible now
(before it was `./mate tests/Static5' only)
o new dependency: package split
Bernhard Urban [Sat, 19 May 2012 21:42:49 +0000 (23:42 +0200)]
ClassPool: JAR and ClassPath support
thanks hs-java awesomeness, although the implemented Java.ClassPath
Modell doesn't really fit nicely in our current implementation :/
so it's a bit hackish...
Bernhard Urban [Sat, 19 May 2012 13:56:18 +0000 (15:56 +0200)]
hs-java: upgrade to 0.3.1
0.3 has JAR support, so stay tuned \o/
Harald Steinlechner [Sat, 19 May 2012 10:39:46 +0000 (12:39 +0200)]
fixed bug in mate.cabal '.' should be in include dir not included itself
Bernhard Urban [Sat, 19 May 2012 10:31:45 +0000 (12:31 +0200)]
Makefile: delete *_stub.* files
those are generated exporting things with FFI
Harald Steinlechner [Sat, 19 May 2012 10:11:03 +0000 (12:11 +0200)]
mate.cabal switched to our version of harpy (git://wien.tomnetworks.com/harpy.git,
d654f45c8dbc81f86d680d4562013761b1d2e0ee) and hs-java (git://wien.tomnetworks.com/hs-java.git;
c96825da50f655d1732b61a0bc9da857d784a4ec)
Bernhard Urban [Sat, 19 May 2012 10:10:56 +0000 (12:10 +0200)]
tools: new custom repo for disassembler
Bernhard Urban [Sat, 19 May 2012 09:52:33 +0000 (11:52 +0200)]
traps: do more things in haskell world
Bernhard Urban [Fri, 18 May 2012 22:31:08 +0000 (00:31 +0200)]
tools: missed a possible failed case
Harald Steinlechner [Fri, 18 May 2012 23:03:11 +0000 (01:03 +0200)]
fixed mate-common. cabal build should work now
Harald Steinlechner [Fri, 18 May 2012 22:58:24 +0000 (00:58 +0200)]
added cabal stubs for mate-common and mate;
Harald Steinlechner [Fri, 18 May 2012 20:00:05 +0000 (22:00 +0200)]
scratch/ffiTest: removed export
Bernhard Urban [Fri, 18 May 2012 09:30:33 +0000 (11:30 +0200)]
refactor: use `unsafePerformIO hack' for global var
Bernhard Urban [Thu, 17 May 2012 22:43:49 +0000 (00:43 +0200)]
refactor: reduce global var in trap.c to one pointer
still not really what we want :/
Bernhard Urban [Thu, 17 May 2012 21:35:02 +0000 (23:35 +0200)]
globalvars: get rid of `trap_map'
we can do that differently (still ugly though)
Harald Steinlechner [Thu, 17 May 2012 16:25:49 +0000 (18:25 +0200)]
scratch: sync sketch code for FFI,Signal...
Bernhard Urban [Wed, 16 May 2012 22:50:38 +0000 (00:50 +0200)]
tools: let `make tests' fail, if there's a failed testcase
Bernhard Urban [Thu, 10 May 2012 11:55:29 +0000 (13:55 +0200)]
hlint: fix suggested improvements
nice tool \o/ some code duplication stuff need to be fixed yet
Bernhard Urban [Thu, 10 May 2012 10:42:44 +0000 (12:42 +0200)]
hlint: use CamelCase for printf stuff
Bernhard Urban [Thu, 10 May 2012 11:08:20 +0000 (13:08 +0200)]
Makefile: hlint target
requires some CPP hack magic...
Bernhard Urban [Wed, 16 May 2012 22:52:24 +0000 (00:52 +0200)]
todo: update
Bernhard Urban [Thu, 10 May 2012 10:27:48 +0000 (12:27 +0200)]
gc: factor out allocation
in order to have central place when starting with garbage collection.
Bernhard Urban [Tue, 8 May 2012 21:52:39 +0000 (23:52 +0200)]
Makefile: target for executing a single testcase
see `HACKING'
Bernhard Urban [Tue, 8 May 2012 21:56:03 +0000 (23:56 +0200)]
debug: get rid of #ifdef guards
this can be done differently. unfortunately it requires some hacks, see
`Mate/Debug.hs' and `debug.h', but I think it's more convient to use.
note, that there're now different `printf_*' functions to use, in
order to map the desired debuglevel.
also see the file `HACKING' for usage.
Bernhard Urban [Tue, 8 May 2012 19:06:27 +0000 (21:06 +0200)]
exception: small example of how interfacing hs-java
Bernhard Urban [Tue, 8 May 2012 11:04:08 +0000 (13:04 +0200)]
tests: one more static initializer
testcase suggested by harald
Bernhard Urban [Thu, 3 May 2012 18:49:19 +0000 (20:49 +0200)]
TODO: update
Bernhard Urban [Tue, 1 May 2012 08:41:01 +0000 (10:41 +0200)]
interface: one testcase
Bernhard Urban [Mon, 30 Apr 2012 22:43:43 +0000 (00:43 +0200)]
refactor: trap.c
just moving code around
Bernhard Urban [Mon, 30 Apr 2012 22:37:13 +0000 (00:37 +0200)]
classpool: add interface-table-ptr to method-table-ptr
at codegen it's very similiar to invokevirtual, but in the
classpool we have to build a quite big table for interface
methods offsets for each class.
misc notes:
- introduced a traptype lookup for trap.c
- interface-table-ptr is stored at offset 0 of the method-table
Bernhard Urban [Mon, 30 Apr 2012 13:06:49 +0000 (15:06 +0200)]
debug: use #ifdef guards
new targets:
$ make mate.dbg # build debug version of mate
$ make tests/Fac.dbg # use debug build for executing `tests/Fac.class'
Bernhard Urban [Mon, 30 Apr 2012 12:54:57 +0000 (14:54 +0200)]
Wall: kill ghc warning
Bernhard Urban [Mon, 30 Apr 2012 12:12:44 +0000 (14:12 +0200)]
PrintStream: reorganize `printf' and `println'
Bernhard Urban [Mon, 30 Apr 2012 12:05:59 +0000 (14:05 +0200)]
Makefile: s/test/tests/g
autocompletion always wants to expand to `make tests', since
there is a directory `tests' *sigh*
Bernhard Urban [Mon, 30 Apr 2012 12:20:04 +0000 (14:20 +0200)]
strings: memset allocated memory
Bernhard Urban [Mon, 30 Apr 2012 11:50:44 +0000 (13:50 +0200)]
classpool: we want the object size
i.e. the number of bytes to allocate for field members of the object.
... not the amount of (virtual) methods this object has.
what an ugly bug :-(
Bernhard Urban [Fri, 27 Apr 2012 10:39:27 +0000 (12:39 +0200)]
refactor: rename types (more consistent style)
Bernhard Urban [Fri, 27 Apr 2012 10:23:08 +0000 (12:23 +0200)]
test: testcase stolen from JorthVM
Bernhard Urban [Thu, 26 Apr 2012 19:25:32 +0000 (21:25 +0200)]
tools: openjdktest.sh: check for arguments
also, one "--enable-shared" was missing installhaskellenv.sh
Bernhard Urban [Thu, 26 Apr 2012 19:05:13 +0000 (21:05 +0200)]
tools: some safety checks in openjdktest.sh
Bernhard Urban [Thu, 26 Apr 2012 19:04:14 +0000 (21:04 +0200)]
tools: script for installing the required haskell environment
Bernhard Urban [Thu, 26 Apr 2012 17:07:37 +0000 (19:07 +0200)]
tools: test against openjdk
see `make test' after a change, to check if you broke something
hint: use `make -j8 test' or similar (depending on your machine...)
but note, it's only a high level test
Bernhard Urban [Thu, 26 Apr 2012 15:42:34 +0000 (17:42 +0200)]
tests: don't use `pop' hack anymore, but System.out.printf \o/