Hi,
Please pull.
I broke some of the most recent changes to mainline (stack-trace printing),
that I will hopefully get around to fixing soon. For now, I really think
you should pull, simply because I am not able to keep up with tgrabiec and
ahuillet's patches anymore. And almost everything they do requires me to
change their code afterwards, requiring twice the amount of work.
'make test' and 'make regression' still pass, but both the build and the run-
time output has become quite a bit noisier.
I didn't remove jamvm/ or lib/ yet -- we don't really need to do it yet. That
code is not even being compiled for now. I will remove that soon. (So even
though 7.5k lines added looks like a lot, the full jamvm/ is more than 16.5k
in just .c files).
Things to note, code-wise:
* struct classblock is now struct vm_class, and all vm_class "methods", i.e.
functions that take a vm_class as the first argument and operates on it
can be found in include/vm/class.h and vm/class.c and are prefixed with
"vm_class_". Also, most functions that deal with classes should now pass
struct vm_class * around directly, instead of passing struct object * and
doing CB_CLASS() on the struct object *.
* struct methodblock is now struct vm_method. All vm_method "methods" can be
found in include/vm/method.h and vm/method.c and have the prefix
"vm_method_".
* struct object is now struct vm_object. All vm_object "methods/constructors"
are found in include/vm/object.h and vm/object.c and have the prefix
"vm_object_".
Ok. Please review and pull if this looks okay.
Vegard
The following changes since commit 597223c5b1ac19f179f9b7269296feee1f56d193:
Arthur HUILLET (1):
regression: add PrintTest test
are available in the git repository at:
git://github.com/vegard/jato.git master
Pekka Enberg (1):
regression: Introduce and use VM.exit()
Tomek Grabiec (1):
scripts: allow file names in tests' OBJS list to have the same name
Vegard Nossum (209):
cafebabe: initial version
error: added "unexpected EOF" error message
constant_pool: parse a few of the constant_pool tags
field_info: added support for field_info parsing
main: indicate position in file on error
added deinit functions to plug memory leaks
class: fix off-by-one error
main: dump a bit of class info
doc: added a simple README
main: try to output the class declaration
method: added method parsing
class: make sure that the whole file is read
constant_pool: parse the rest of the entry types too
stream: fix off-by-one error that caused premature eof
attribute_info: parse attributes
add license and copyright headers to all files
build: add cmake recipe for building and installing the library
build: add "dump" program
add some more access flag mnemonics
class: move constant lookup functions
dump: dump field and method names too
build: rearrange source code
doc: added doxygen configuration file
attribute_info: fixed data type error
constant_pool: don't allocate entries separately
doc: fix file version filter command
doc: some layout changes in generated documentation
document the structures that are described in the JVM specification
class: added functions for looking up fields and methods
class: take const pointers
dump: fix error in error handling
java: add the skeleton of a java vm program
class: return const pointer results
java: also free the filename
class: fix parsing of 64-bit constants
Added a README.cafebabe for info about the project
build: remove Jam VM .c files from the build
build: reinclude vm/jato.c in build
opcodes: generate opcode mnemonics using the JVM specification
vm: remove old opcode mnemonic definitions
build: add the cmake_minimum_required() annotation
stream: add stream_malloc() with graceful error handling
Use the new stream_malloc() function
cafebabe: Added cafebabe as a git submodule
cafebabe: make cafebabe the main 'java' program
vm: add dummy functions for vm object functions
vm: move NOT_IMPLEMENTED macro from object.c to Makefile
jit: replace calls to class-loader interface with dummy calls
vm: replace calls to class-loader interface with dummy calls
jato: register native functions
build: fix typo in NOT_IMPLEMENTED macro
jato: prepare for method compilation
class: changed get_field()/get_method() to return index instead of pointer
attribute_info: introduce new attribute_array type
stream: add functions for reading from a buffer
stream: add function for skipping input
stream: add function for returning a pointer to the current position
code_attribute: add parser for code attributes
class: remove old (unused) code
attributes_array: fix a few errors
build: include attribute_array and code_attribute
java: add example code for parsing attribute arrays
code_attribute: provide deinit function and fix memory leak
java: deinit 'Code' attribute
jato: use method index instead of pointer
doc: updated README.cafebabe with more detailed plan
vm: add vm_class/vm_method wrapper structures
compilation_unit: use vm_method instead of methodblock
Convert many callsites to use the new struct vm_method
vm: actually execute the compiled bytecode
vm: added function for parsing type descriptors
method_info: add access flag definitions
attribute_array: make lookup function start at a particular offset
class: add get_method_ref function
class: add get_name_and_type method
Make method calls work
class: reenable native functions
doc: updated README.cafebabe
vm: add simple classloader
vm: when asked to resolve a class, consult the class loader
jit: reimplement calling static methods (of other classes too)
doc: update README.cafebabe
vm: initialise stack usage parameters for native/abstract methods
vm: fix error in "foreign method" resolution
jit: make tracing work
vm: switch from struct object to struct vm_object
vm: implement class resolution function
jit: fix convert_new to use the new class resolution function
doc: updated README.cafebabe
class: add get_field_ref
Add getfield/putfield support by introducing struct vm_field
vm: search superclass if method/field not found in current class
vm: allocate some space for objects
vm: copy class names in the classloader
jit: get rid of stale warning
vm: remove debug printout in vm_class
vm: improve signature parsing/argument counting
jit: convert a few immediate types from the constant pool
field_info: added access flag definitions
vm: run class initializers (<clinit> method)
vm: provide java.lang.VMSystem.arraycopy native prototype
jit: fixup convert_checkcast
build: fix missing building of include/vm/opcodes.h
insn-selector: calculate member offsets using the new structures
vm: provide static field initializer values
vm: provide vtable for struct vm_class
regression: use TestCase.exit() instead of Runtime.halt()
vm: fix includes in object.h
vm: static fields contain their value, not a pointer to it
vm: fix method argument counting
x86: assert that the stack-frame size is positive
jit: pass the correct value for the number of arguments
vm: check the return value of counting arguments
class: added access flag definitions
constant_pool: fix utf8 string comparison error
vm: set up vtables and make invokevirtual work
vm: removed debug printfs from class loader
regression: remove jamvm test-cases from the script
constant_value_attribute: add parser
vm: compute object sizes and field offsets
doc: updated README.cafebabe
regression: add ArrayTest
jato: make stdout and stderr both unbuffered
regression: temporary work-around for cafebabe
vm: add missing error check
regression: set CLASSPATH
regression: don't construct new String object in backpatching test
regression: add test for constant strings
class: add functions for looking up fields and methods non-recursively by
name
vm: keep track of whether a class has been loaded/linked/initialised
vm: separate loading from initialisation in the classloader
jit: load utf8 strings and create utf16 String objects
jato: simplify main-method lookup
vm: move the string initialisation out of jit code
vm: implement jato.internal.VM.println() as a native method
regression: use plain exit() in ArrayTest
regression: include ArrayTest in default run
regression: add ObjectArrayTest
build: use .class instead of .java for the target name
vm: include utf8 routines
build: extract GNU classpath to classpath/
jit: get rid of obsolete functions
vm: get rid of obsolete function
vm: make checking functions use the new struct vm_object
jato: use struct vm_object and get rid of a build warning
jit: compile out some yet-to-be-implemented array code
scripts: define NOT_IMPLEMENTED for tests
test/vm: add missing include
scripts/build: add cafebabe to includes
test: replace alloc_compilation_unit() with compilation_unit_alloc()
test: add vm_class stubs
test: add vm_object stub
test: add cafebabe objects to jit test-runner
test/jit: replace methodblock with vm_method
test/jit: replace fieldblock with vm_field
test/vm: implement stub for method lookup
test/jit: make invoke bypass the constant pool
test/jit: use uint8_t instead of u8, etc.
jit: class references should be vm_class, not vm_object
test/jit: fix tree-printer's handling of classes
test/jit: temporarily disable some tests for now
test/arch-x86: add cafebabe headers to include paths
test/arch-x86: make tests compile
test/arch-x86: switch from Jam VM structures
build: ignore arch-x86 tests for now
vm: add zip/jar support to the class laoder
doc: updated README.cafebabe
vm: don't generate opcodes.h
jato: remove obsolete native function
vm: remove warning from classloader
jit: fix convert_anewarray
Merge commit 'github/penberg/master' into HEAD
Merge commit 'github/penberg/master'
vm: add some preliminary support for loading array classes
jit: support array construction
jit: resolve class in multianewarray
vm: implement object locking using pthread mutexes
vm: implement multianewarray "back end"
jato: added two missing includes
vm: fix includes in object.h
vm: back-end support for java.lang.Object.getClass()
vm: fix warnings in signal.c
vm: provide vm_class_is_assignable_from()
jit: fix exception handler search to use the new class compatibility check
jit: anewarray/multianewarray should use vm_class, not vm_object
vm: improve class assignability check somewhat
vm: add vm_class_is_array_class() test
vm: fix vm_object_check_array()
jato: implement rudimentary command line parsing
cafebabe: prepare for merge in jato
cafebabe: removed cafebabe submodule
Merge branch 'cafebabe-merge-preparation' into jato-merge-preparation
test: fix jit-tests fallout
cafebabe: switch license to GPLv2 + linking exception
cafebabe: really remove cafebabe submodule
doc: updated README.cafebabe
jato: improve class preloader
jato: preload fields too
vm: move declarations of preloaded classes to a header file
jato: use preloaded fields for jato.internal.VM.println() native function
vm: use preloaded fields for java.lang.String in vm_object_alloc_string()
vm: fix includes
vm: use preloaded java/lang/Object in array construction
jit: remove NOT_IMPLEMENTED from int/long ldc
vm: add classpath helper to class loader
Merge commit 'github/penberg/master'
test/x86: enable all but instruction selection tests
vm: replace vm/jato.c with vm/jato-cafebabe.c
Merge commit 'github/penberg/master'
Makefile | 74 +-
README.cafebabe | 88 ++
arch/ppc/Makefile_32 | 4 -
arch/x86/Makefile_32 | 5 +-
arch/x86/Makefile_64 | 4 +-
arch/x86/emit-code.c | 23 +-
arch/x86/exception.c | 8 +-
arch/x86/include/arch/exception.h | 4 +-
arch/x86/include/arch/stack-frame.h | 4 +-
arch/x86/insn-selector_32.brg | 78 +-
arch/x86/stack-frame.c | 17 +-
cafebabe/CMakeLists.txt | 34 +
cafebabe/Doxyfile | 1356 ++++++++++++++++++++
cafebabe/include/cafebabe/access.h | 55 +
cafebabe/include/cafebabe/attribute_array.h | 46 +
cafebabe/include/cafebabe/attribute_info.h | 52 +
cafebabe/include/cafebabe/class.h | 101 ++
cafebabe/include/cafebabe/code_attribute.h | 67 +
cafebabe/include/cafebabe/constant_pool.h | 131 ++
.../include/cafebabe/constant_value_attribute.h | 54 +
cafebabe/include/cafebabe/error.h | 46 +
cafebabe/include/cafebabe/field_info.h | 64 +
cafebabe/include/cafebabe/method_info.h | 66 +
cafebabe/include/cafebabe/stream.h | 72 +
cafebabe/src/cafebabe/attribute_array.c | 54 +
cafebabe/src/cafebabe/attribute_info.c | 65 +
cafebabe/src/cafebabe/class.c | 368 ++++++
cafebabe/src/cafebabe/code_attribute.c | 120 ++
cafebabe/src/cafebabe/constant_pool.c | 370 ++++++
cafebabe/src/cafebabe/constant_value_attribute.c | 56 +
cafebabe/src/cafebabe/error.c | 45 +
cafebabe/src/cafebabe/field_info.c | 82 ++
cafebabe/src/cafebabe/method_info.c | 82 ++
cafebabe/src/cafebabe/stream.c | 226 ++++
cafebabe/src/dump.c | 167 +++
cafebabe/src/java.c | 140 ++
include/jit/bc-offset-mapping.h | 3 +-
include/jit/compilation-unit.h | 5 +-
include/jit/compiler.h | 14 +-
include/jit/emit-code.h | 9 +-
include/jit/exception.h | 30 +-
include/jit/expression.h | 43 +-
include/jit/statement.h | 2 +-
include/vm/class.h | 80 +-
include/vm/classloader.h | 11 +
include/vm/field.h | 34 +-
include/vm/java_lang.h | 12 +
include/vm/method.h | 82 +-
include/vm/object.h | 48 +
include/vm/opcodes.h | 236 ++++
include/vm/stack-trace.h | 16 +-
include/vm/thread.h | 18 +
include/vm/types.h | 3 +
include/vm/utf8.h | 9 +
include/vm/vm.h | 233 +----
jit/bc-offset-mapping.c | 7 +-
jit/bytecode-to-ir.c | 9 +-
jit/cfg-analyzer.c | 34 +-
jit/compilation-unit.c | 12 +-
jit/compiler.c | 24 +-
jit/emit.c | 10 +-
jit/exception.c | 56 +-
jit/expression.c | 21 +-
jit/invoke-bc.c | 16 +-
jit/load-store-bc.c | 61 +-
jit/method.c | 7 +-
jit/object-bc.c | 67 +-
jit/trace-jit.c | 19 +-
jit/trampoline.c | 11 +-
jit/tree-printer.c | 11 +-
regression/jato/internal/VM.java | 1 +
regression/jvm/ArrayTest.java | 42 +
regression/jvm/ObjectArrayTest.java | 24 +
regression/jvm/StringTest.java | 16 +
regression/run-suite.sh | 10 +-
scripts/build/test.mk | 5 +-
scripts/gen-opcodes.pl | 68 +
test/arch-x86/Makefile | 25 +-
test/arch-x86/emit-code-test_32.c | 6 +-
test/arch-x86/insn-selector-test_32.c | 214 ++--
test/arch-x86/stack-frame-test_32.c | 2 +-
test/jamvm/class-stub.c | 50 -
test/jit/Makefile | 12 +-
test/jit/arithmetic-bc-test.c | 24 +-
test/jit/basic-block-test.c | 8 +-
test/jit/bc-test-utils.c | 30 +-
test/jit/bc-test-utils.h | 14 +-
test/jit/branch-bc-test.c | 33 +-
test/jit/bytecode-to-ir-test.c | 12 +-
test/jit/cfg-analyzer-test.c | 25 +-
test/jit/compilation-unit-test.c | 11 +-
test/jit/invoke-bc-test.c | 65 +-
test/jit/linear-scan-test.c | 10 +-
test/jit/liveness-test.c | 8 +-
test/jit/load-store-bc-test.c | 66 +-
test/jit/object-bc-test.c | 136 ++-
test/jit/spill-reload-test.c | 12 +-
test/jit/trampoline-stub.c | 7 +
test/jit/tree-printer-test.c | 38 +-
test/jit/typeconv-bc-test.c | 6 +-
test/vm/bytecodes-test.c | 2 +
test/vm/class-stub.c | 32 +
test/vm/classloader-stub.c | 6 +
test/vm/java_lang-stub.c | 10 +
test/vm/object-stub.c | 61 +
vm/class.c | 521 ++++++--
vm/classloader.c | 457 +++++++
vm/field.c | 95 ++
vm/jato.c | 581 ++++-----
vm/method.c | 129 ++
vm/object.c | 342 +++++
vm/resolve.c | 5 +-
vm/signal.c | 3 +-
vm/stack-trace.c | 131 +-
vm/types.c | 96 ++
vm/utf8.c | 96 ++
116 files changed, 7557 insertions(+), 1471 deletions(-)
create mode 100644 README.cafebabe
create mode 100644 cafebabe/CMakeLists.txt
create mode 100644 cafebabe/Doxyfile
create mode 100644 cafebabe/include/cafebabe/access.h
create mode 100644 cafebabe/include/cafebabe/attribute_array.h
create mode 100644 cafebabe/include/cafebabe/attribute_info.h
create mode 100644 cafebabe/include/cafebabe/class.h
create mode 100644 cafebabe/include/cafebabe/code_attribute.h
create mode 100644 cafebabe/include/cafebabe/constant_pool.h
create mode 100644 cafebabe/include/cafebabe/constant_value_attribute.h
create mode 100644 cafebabe/include/cafebabe/error.h
create mode 100644 cafebabe/include/cafebabe/field_info.h
create mode 100644 cafebabe/include/cafebabe/method_info.h
create mode 100644 cafebabe/include/cafebabe/stream.h
create mode 100644 cafebabe/src/cafebabe/attribute_array.c
create mode 100644 cafebabe/src/cafebabe/attribute_info.c
create mode 100644 cafebabe/src/cafebabe/class.c
create mode 100644 cafebabe/src/cafebabe/code_attribute.c
create mode 100644 cafebabe/src/cafebabe/constant_pool.c
create mode 100644 cafebabe/src/cafebabe/constant_value_attribute.c
create mode 100644 cafebabe/src/cafebabe/error.c
create mode 100644 cafebabe/src/cafebabe/field_info.c
create mode 100644 cafebabe/src/cafebabe/method_info.c
create mode 100644 cafebabe/src/cafebabe/stream.c
create mode 100644 cafebabe/src/dump.c
create mode 100644 cafebabe/src/java.c
create mode 100644 include/vm/classloader.h
create mode 100644 include/vm/java_lang.h
create mode 100644 include/vm/object.h
create mode 100644 include/vm/opcodes.h
create mode 100644 include/vm/thread.h
create mode 100644 include/vm/utf8.h
create mode 100644 regression/jvm/ArrayTest.java
create mode 100644 regression/jvm/ObjectArrayTest.java
create mode 100644 regression/jvm/StringTest.java
create mode 100644 scripts/gen-opcodes.pl
create mode 100644 test/jit/trampoline-stub.c
create mode 100644 test/vm/class-stub.c
create mode 100644 test/vm/classloader-stub.c
create mode 100644 test/vm/java_lang-stub.c
create mode 100644 test/vm/object-stub.c
create mode 100644 vm/classloader.c
create mode 100644 vm/field.c
create mode 100644 vm/method.c
create mode 100644 vm/object.c
create mode 100644 vm/utf8.c
------------------------------------------------------------------------------
_______________________________________________
Jatovm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jatovm-devel