cacao.git
17 years ago* src/vm/jit/verify/typecheck-stackbased.c: New file. Not used, yet.
edwin [Fri, 13 Oct 2006 11:11:20 +0000 (11:11 +0000)]
* src/vm/jit/verify/typecheck-stackbased.c: New file. Not used, yet.
* src/vm/jit/verify/icmds.c: New file.
* src/vm/jit/verify/generate.pl: New file.

* src/vm/jit/verify/typecheck-invoke.inc: Added copyright notice.
* src/vm/jit/verify/typecheck-fields.inc: Likewise.
* src/vm/jit/verify/typecheck-builtins.inc: Likewise.
* src/vm/jit/verify/typecheck-common.c: Likewise.
* src/vm/jit/verify/typecheck-common.h: Likewise.

17 years ago* src/vm/jit/verify/typeinfo.c (typevector_store): Remove obsolete
edwin [Fri, 13 Oct 2006 10:36:34 +0000 (10:36 +0000)]
* src/vm/jit/verify/typeinfo.c (typevector_store): Remove obsolete
assertion.

17 years ago* src/vm/jit/stack.c (stack_analyse): Set iptr->dst for CHECKNULL.
edwin [Fri, 13 Oct 2006 10:33:20 +0000 (10:33 +0000)]
* src/vm/jit/stack.c (stack_analyse): Set iptr->dst for CHECKNULL.

17 years ago* src/vm/builtin.c (builtin_isanysubclass): Bugfix for the case that
edwin [Fri, 13 Oct 2006 00:47:59 +0000 (00:47 +0000)]
* src/vm/builtin.c (builtin_isanysubclass): Bugfix for the case that
`sub` is an interface and `super` is a class. The function returned
random values in this case, since it used the <= 0 base value of the
interface class to perform the subclass check. The only case in which
an interface can be a subclass of a non-interface `super` is when
`super` is java.lang.Object, so we check explicitly for this case.
This fixes a bug with BeanShell-2.0b4.

(builtin_isanysubclass_vftbl): Likewise.

17 years ago* src/vm/jit/stack.c (stack_check_invars): Bugfix: Only set flags to
edwin [Thu, 12 Oct 2006 23:34:27 +0000 (23:34 +0000)]
* src/vm/jit/stack.c (stack_check_invars): Bugfix: Only set flags to
BBTYPECHECK_REACHED if the block has already been analysed.

(stack_check_invars_from_outvars): Likewise.

17 years ago* src/vm/jit/cfg.c (cfg_build): Check for EXH basic blocks in
twisti [Thu, 12 Oct 2006 20:06:48 +0000 (20:06 +0000)]
* src/vm/jit/cfg.c (cfg_build): Check for EXH basic blocks in
fall-through case.

17 years ago* tests/regression/jasmin/runtest: Added timeout capability.
edwin [Thu, 12 Oct 2006 15:59:13 +0000 (15:59 +0000)]
* tests/regression/jasmin/runtest: Added timeout capability.

17 years ago* src/vm/jit/verify/typecheck-common.h (typecheck_print_statistics):
edwin [Thu, 12 Oct 2006 15:22:51 +0000 (15:22 +0000)]
* src/vm/jit/verify/typecheck-common.h (typecheck_print_statistics):
Added prototype.
(typecheck_jsr_t): New struct.
(typecheck_jsr_caller_t): Likewise.
(verifier_state): Added fields for stackbased verifier.

17 years ago* src/vm/jit/verify/typecheck-common.c: Made debugging and statistics
edwin [Thu, 12 Oct 2006 15:07:45 +0000 (15:07 +0000)]
* src/vm/jit/verify/typecheck-common.c: Made debugging and statistics
symbols global.
* src/vm/jit/verify/typecheck-common.h: Likewise.

17 years ago* src/vm/jit/verify/typecheck-invoke.inc: Added code variants for the
edwin [Thu, 12 Oct 2006 14:52:54 +0000 (14:52 +0000)]
* src/vm/jit/verify/typecheck-invoke.inc: Added code variants for the
stackbased verifier. Not used, yet.
* src/vm/jit/verify/typecheck-builtins.inc: Likewise.

17 years ago* src/vm/jit/verify/typecheck-common.c: Include headers.
edwin [Thu, 12 Oct 2006 14:42:37 +0000 (14:42 +0000)]
* src/vm/jit/verify/typecheck-common.c: Include headers.
* src/vm/jit/verify/typecheck-common.h: Cleanup.

17 years ago* src/vm/jit/verify/typecheck.c (ISBUILTIN): Removed.
edwin [Thu, 12 Oct 2006 14:39:43 +0000 (14:39 +0000)]
* src/vm/jit/verify/typecheck.c (ISBUILTIN): Removed.
* src/vm/jit/verify/typecheck-builtins.inc (ISBUILTIN): Added.

17 years ago* src/vm/jit/powerpc64/codegen.c (codegen): Adopt locals
tbfg [Thu, 12 Oct 2006 14:38:46 +0000 (14:38 +0000)]
* src/vm/jit/powerpc64/codegen.c (codegen): Adopt locals
and regoff changes.

17 years ago* src/vm/jit/verify/typecheck.c (verify_invocation): Prepared for
edwin [Thu, 12 Oct 2006 14:18:25 +0000 (14:18 +0000)]
* src/vm/jit/verify/typecheck.c (verify_invocation): Prepared for
addeding the stackbased verifier. No functional change, yet.
(verify_builtin): Likewise.

17 years ago* src/vm/jit/verify/typecheck-common.c,
edwin [Thu, 12 Oct 2006 14:12:41 +0000 (14:12 +0000)]
* src/vm/jit/verify/typecheck-common.c,
src/vm/jit/verify/typecheck-common.h (typecheck_init_flags): Added
minflags argument.

* src/vm/jit/verify/typecheck.c (typecheck): Call typecheck_init_flags
with minflags set to BBFINISHED.

17 years ago* src/vm/jit/verify/typecheck.c (verify_fieldaccess): New function.
edwin [Thu, 12 Oct 2006 14:02:10 +0000 (14:02 +0000)]
* src/vm/jit/verify/typecheck.c (verify_fieldaccess): New function.
(verify_basic_block): Moved field verification into a separate
function.

* src/vm/jit/verify/typecheck-fields.inc: Removed opcode-dependant
stuff. Some code for the stackbased verifier is checked in, but not
used, yet.

17 years ago* src/vm/jit/mips/linux/md-os.c (thread_restartcriticalsection): Added
twisti [Thu, 12 Oct 2006 13:13:18 +0000 (13:13 +0000)]
* src/vm/jit/mips/linux/md-os.c (thread_restartcriticalsection): Added
uClibc support.

17 years ago* src/vm/jit/mips/linux/md-os.c (md_signal_handler_sigsegv): Added
twisti [Thu, 12 Oct 2006 12:44:50 +0000 (12:44 +0000)]
* src/vm/jit/mips/linux/md-os.c (md_signal_handler_sigsegv): Added
uClibc support.

17 years ago* src/vm/jit/verify/typecheck.c: Moved <assert.h> include to the right
edwin [Thu, 12 Oct 2006 10:10:06 +0000 (10:10 +0000)]
* src/vm/jit/verify/typecheck.c: Moved <assert.h> include to the right
place. Moved some code to typecheck-common.[ch].

* src/vm/jit/verify/typecheck-common.c: New file.
* src/vm/jit/verify/typecheck-common.h: New file.

* src/vm/jit/verify/Makefile.am: Added new source files.

17 years ago* src/vm/jit/verify/typecheck-builtins.inc: Removed redundant
edwin [Wed, 11 Oct 2006 23:52:06 +0000 (23:52 +0000)]
* src/vm/jit/verify/typecheck-builtins.inc: Removed redundant
`return true`. Moved declaration of `av`.

17 years ago* src/vm/jit/verify/typecheck-invoke.inc: Use invokestatic where
edwin [Wed, 11 Oct 2006 23:44:52 +0000 (23:44 +0000)]
* src/vm/jit/verify/typecheck-invoke.inc: Use invokestatic where
possible. Added a comment.

17 years ago* src/vm/jit/verify/typecheck-invoke.inc: Indent log messages to make
edwin [Wed, 11 Oct 2006 23:41:08 +0000 (23:41 +0000)]
* src/vm/jit/verify/typecheck-invoke.inc: Indent log messages to make
them more readable.

17 years ago* src/vm/jit/verify/typecheck.c (verify_invocation): Define jd and dv
edwin [Wed, 11 Oct 2006 23:37:32 +0000 (23:37 +0000)]
* src/vm/jit/verify/typecheck.c (verify_invocation): Define jd and dv
before including the function body.

* src/vm/jit/verify/typecheck-invoke.inc: Removed definitions of jd
and dv. Small cleanup.

17 years ago* src/vm/jit/verify/typecheck.c (verify_builtin): Define jd and dv
edwin [Wed, 11 Oct 2006 23:22:54 +0000 (23:22 +0000)]
* src/vm/jit/verify/typecheck.c (verify_builtin): Define jd and dv
before including the function body.

* src/vm/jit/verify/typecheck-builtins.inc: Removed definitions
of jd and dv.

17 years ago* src/vm/jit/verify/typecheck.c (verify_invocation): Moved body to a
edwin [Wed, 11 Oct 2006 23:00:01 +0000 (23:00 +0000)]
* src/vm/jit/verify/typecheck.c (verify_invocation): Moved body to a
separate file in order to prepare comitting the stackbased verifier.
(verify_builtin): Likewise.
(verify_generic_builtin): Likewise, no integrated in verify_builtin.
(verify_basic_block): Moved field instruction verification to a
separate file.

* src/vm/jit/verify/typecheck-invoke.inc: New file.
* src/vm/jit/verify/typecheck-fields.inc: New file.
* src/vm/jit/verify/typecheck-builtins.inc: New file.

* src/vm/jit/verify/Makefile.am: Added new source files.

17 years ago* src/cacaoh/headers.c (typeinfo_print_short): Stub added.
edwin [Wed, 11 Oct 2006 19:43:12 +0000 (19:43 +0000)]
* src/cacaoh/headers.c (typeinfo_print_short): Stub added.

17 years ago* src/vm/jit/verify/typeinfo.c (typeinfo_init_component): Fixed for
edwin [Wed, 11 Oct 2006 19:42:07 +0000 (19:42 +0000)]
* src/vm/jit/verify/typeinfo.c (typeinfo_init_component): Fixed for
the case that srcarray == dst. (The mergedlist was overwritten with
NULL in this case.)

17 years ago* src/vm/resolve.c, src/vm/resolve.h
edwin [Wed, 11 Oct 2006 19:40:22 +0000 (19:40 +0000)]
* src/vm/resolve.c, src/vm/resolve.h
(resolve_method_param_type_checks_stackbased): New function.
(resolve_constrain_unresolved_method_params_stackbased): Likewise.

17 years ago* tests/regression/jasmin/test_verify_fail_athrow_wrong_reftype_unresolved.j:
edwin [Wed, 11 Oct 2006 16:31:53 +0000 (16:31 +0000)]
* tests/regression/jasmin/test_verify_fail_athrow_wrong_reftype_unresolved.j:
New test.

* tests/regression/jasmin/test_verify_fail_athrow_wrong_reftype.j:
New test.

* tests/regression/jasmin/Makefile.am: Added new tests.

17 years ago* tests/regression/jasmin/test_verify_fail_areturn_wrong_reftype.j:
edwin [Wed, 11 Oct 2006 16:21:08 +0000 (16:21 +0000)]
* tests/regression/jasmin/test_verify_fail_areturn_wrong_reftype.j:
New test.

* tests/regression/jasmin/test_verify_fail_invoke_return_basic_type.j:
New test.

* tests/regression/jasmin/test_verify_fail_ireturn_wrong_type.j: New
test.

* tests/regression/jasmin/Makefile.am: Added new tests.

17 years ago* tests/regression/jasmin/test_verify_fail_handler_bad_local.j: new
edwin [Wed, 11 Oct 2006 10:17:03 +0000 (10:17 +0000)]
* tests/regression/jasmin/test_verify_fail_handler_bad_local.j: new
test.

* tests/regression/jasmin/Makefile.am: Added new test.

17 years ago* tests/regression/jasmin/test_verify_fail_jsr_recursion_terminates.j:
edwin [Tue, 10 Oct 2006 21:16:17 +0000 (21:16 +0000)]
* tests/regression/jasmin/test_verify_fail_jsr_recursion_terminates.j:
Added expected error.

* tests/regression/jasmin/test_verify_fail_jsr_recursion.j: Likewise.

* tests/regression/jasmin/test_verify_ok_jsr_improper_nesting.j: New
test.

* tests/regression/jasmin/test_verify_fail_jsr_multiple_returns.j: New
test.

* tests/regression/jasmin/Makefile.am: Added new tests.

17 years ago* tests/regression/jasmin/test_verify_fail_jsr_recursion_terminates.j:
edwin [Tue, 10 Oct 2006 20:45:20 +0000 (20:45 +0000)]
* tests/regression/jasmin/test_verify_fail_jsr_recursion_terminates.j:
New test.

* tests/regression/jasmin/Makefile.am: Added new test.

17 years ago* tests/regression/jasmin/test_verify_fail_jsr_recursion.j: New test.
edwin [Tue, 10 Oct 2006 20:31:30 +0000 (20:31 +0000)]
* tests/regression/jasmin/test_verify_fail_jsr_recursion.j: New test.

* tests/regression/jasmin/Makefile.am: Added new test.

17 years ago* src/vm/resolve.c, src/vm/resolve.h (constrain_unresolved_method):
edwin [Tue, 10 Oct 2006 00:29:26 +0000 (00:29 +0000)]
* src/vm/resolve.c, src/vm/resolve.h (constrain_unresolved_method):
Split into two new functions.

(resolve_constrain_unresolved_method_instance): New function.
(resolve_constrain_unresolved_method_params): Likewise.

* src/vm/jit/verify/typecheck.c (verify_invocation): Use new
functions.

17 years ago* src/vm/resolve.c (resolve_method_type_checks): Split up into
edwin [Mon, 9 Oct 2006 23:53:42 +0000 (23:53 +0000)]
* src/vm/resolve.c (resolve_method_type_checks): Split up into
two new functions.

(resolve_method_instance_type_checks): New function.

(resolve_method_param_type_checks): New function.

* src/vm/resolve.h (resolve_method_type_checks): Removed.
(resolve_method_instance_type_checks): New function.
(resolve_method_param_type_checks): New function.

* src/vm/jit/verify/typecheck.c (verify_invocation): Call
resolve_method_instance_type_checks and
resolve_method_param_type_checks.

17 years ago* src/vm/resolve.c (resolve_method_verifier_checks): Removed unused
edwin [Mon, 9 Oct 2006 23:21:37 +0000 (23:21 +0000)]
* src/vm/resolve.c (resolve_method_verifier_checks): Removed unused
variable. Removed unclear assertion.

17 years ago* src/vm/resolve.c (resolve_method_verifier_checks): Removed unused
edwin [Mon, 9 Oct 2006 23:17:56 +0000 (23:17 +0000)]
* src/vm/resolve.c (resolve_method_verifier_checks): Removed unused
arguments.

(resolve_method): Changed arguments to resolve_method_verifier_checks.

* src/vm/resolve.h (resolve_method_verifier_checks): Removed unused
arguments.

* src/vm/jit/verify/typecheck.c (verify_invocation): Changed
arguments to resolve_method_verifier_checks.

17 years ago* src/vm/resolve.c (resolve_method_verifier_checks): Factored out
edwin [Mon, 9 Oct 2006 23:06:39 +0000 (23:06 +0000)]
* src/vm/resolve.c (resolve_method_verifier_checks): Factored out
parameter type checks into a separate function.

(resolve_method_type_checks): New function.

* src/vm/resolve.h (resolve_method_type_checks): New function.

* src/vm/jit/verify/typecheck.c (verify_invocation): Call
resolve_method_type_checks.

17 years ago* src/vm/resolve.c (resolve_method_verifier_checks): Factored out
edwin [Mon, 9 Oct 2006 22:19:22 +0000 (22:19 +0000)]
* src/vm/resolve.c (resolve_method_verifier_checks): Factored out
loading constraints into a separate function.

(resolve_method_loading_constraints): New function.

(resolve_method): Call resolve_method_loading_constraints.

* src/vm/resolve.h (resolve_method_loading_constraints): New function.

* src/vm/jit/verify/typecheck.c (verify_invocation): Call
resolve_method_loading_constraints.

17 years ago* src/vm/resolve.c (resolve_method_lazy): Removed dependence on
edwin [Mon, 9 Oct 2006 17:08:38 +0000 (17:08 +0000)]
* src/vm/resolve.c (resolve_method_lazy): Removed dependence on
instruction format. Do not perform verifier checks. (Caller will
do these.)

(create_unresolved_method): Renamed to
resolve_create_unresolved_method. Changed arguments.

* src/vm/resolve.h (create_unresolved_method): Renamed to
resolve_create_unresolved_method. Changed arguments.

(resolve_method_lazy): Changed arguments.

(resolve_method_verifier_checks): Export.

* src/vm/jit/verify/typecheck.c (verify_invocation): Adapted
to changed resolve functions. Call resolve_method_verifier_checks.
Do promotion from INVOKEVIRTUAL to INVOKESPECIAL here.

* src/vm/jit/parse.c (parse): Adapted to changed resolve functions.
Do promotion from INVOKEVIRTUAL to INVOKESPECIAL here.

17 years ago* src/vm/resolve.c (resolve_field_verifier_checks): Removed dependence
edwin [Mon, 9 Oct 2006 15:42:02 +0000 (15:42 +0000)]
* src/vm/resolve.c (resolve_field_verifier_checks): Removed dependence
on instruction format.

(resolve_field_lazy): Pass field reference, instead of instruction.
Do not perform verification checks here. (Caller will do them.)

(resolve_field): Adapted to changed resolve_field_verifier_checks.

(create_unresolved_field): Renamed to resolve_create_unresolved_field.

(constrain_unresolved_field): Renamed to
resolve_constrain_unresolved_field. Removed dependence on instruction
format.

* src/vm/resolve.h (create_unresolved_field): Renamed to
resolve_create_unresolved_field.

(resolve_field_lazy): Changed arguments.

(resolve_field_verifier_checks): Export.

(constrain_unresolved_field): Renamed to
resolve_constrain_unresolved_field. Changed arguments.

* src/vm/jit/verify/typecheck.c (typecheck): Moved instruction set
dependent parts of resolve functions into typecheck.

* src/vm/jit/parse.c (resolve_field_lazy): Changed arguments.
(create_unresolved_field): Renamed.

17 years ago* test/regression/jasmin/test_verify_ok_jsr_subroutine_loops_to_start.j:
edwin [Sun, 8 Oct 2006 22:49:42 +0000 (22:49 +0000)]
* test/regression/jasmin/test_verify_ok_jsr_subroutine_loops_to_start.j:
New test.

* test/regression/jasmin/test.j: Small cleanup.

* test/regression/jasmin/Makefile.am: Added new test.

17 years ago* src/vm/jit/stack.c: Verify that subroutines are not merged.
edwin [Sun, 8 Oct 2006 11:39:41 +0000 (11:39 +0000)]
* src/vm/jit/stack.c: Verify that subroutines are not merged.
(SBRSTART): New macro.
(COPY_VAL_AND_TYPE_VAR): New macro, propagate SBRSTART.
(COPY_VAL_AND_TYPE): Use COPY_VAL_AND_TYPE_VAR.
(stack_create_invars): Cleaned up, use COPY_VAL_AND_TYPE_VAR.
(stack_create_invars_from_outvars): Use COPY_VAL_AND_TYPE_VAR.
(stack_check_invars): Check against merging of subroutines. Wrapped
verifier checks in #if defined(ENABLE_VERIFIER).
(stack_check_invars_from_outvars): Likewise.
(stack_reanalyse_block): Wrapped verifier checks in
#if defined(ENABLE_VERIFIER).
(stack_analyse): Prepare a real variable for the handler stack.
Implemented re-analysing of blocks. Set SBRSTART for JSR.

* src/vm/jit/parse.c (parse): Reserve extra variables needed by
stack_analyse.

* src/vm/global.h (STACK_EXTRA_VARS): New macro.

17 years ago* src/vm/jit/show.c (show_basicblock): Removed extra newline.
edwin [Sun, 8 Oct 2006 10:51:32 +0000 (10:51 +0000)]
* src/vm/jit/show.c (show_basicblock): Removed extra newline.

17 years ago* tests/regression/jasmin/test_verify_fail_jsr_merge_subroutines_via_stack.j:
edwin [Sun, 8 Oct 2006 00:07:48 +0000 (00:07 +0000)]
* tests/regression/jasmin/test_verify_fail_jsr_merge_subroutines_via_stack.j:
New test.

* tests/regression/jasmin/Makefile.am: Added new test.

17 years ago* src/vm/jit/cfg.c (cfg_build): Fixed a bug causing infinite loops.
edwin [Sat, 7 Oct 2006 23:56:43 +0000 (23:56 +0000)]
* src/vm/jit/cfg.c (cfg_build): Fixed a bug causing infinite loops.

* src/vm/jit/parse.c (parse): Always add a NOP at block ends. This is
needed by the JSR elimination in stack.c.

* tests/regression/jasmin/test_verify_fail_jsr_merge_subroutines.j:
New test.

* tests/regression/jasmin/Makefile.am: Added new test.

17 years ago* tests/regression/jasmin/test_verify_fail_jsr_polymorphic_pop.j:
edwin [Sat, 7 Oct 2006 23:02:53 +0000 (23:02 +0000)]
* tests/regression/jasmin/test_verify_fail_jsr_polymorphic_pop.j:
New test.

* tests/regression/jasmin/Makefile.am: Added new test.

* src/vm/jit/stack.c (stack_check_invars): Fixed bug exposed by the
new test.
(stack_check_invars_from_outvars): Likewise.

17 years ago* tests/regression/jasmin/test_verify_fail_jsr_called_with_different_stackdepths.j:
edwin [Sat, 7 Oct 2006 22:34:25 +0000 (22:34 +0000)]
* tests/regression/jasmin/test_verify_fail_jsr_called_with_different_stackdepths.j:
New test.
* tests/regression/jasmin/Makefile.am: Added new test.

17 years ago* src/vm/jit/stack.c (GET_NEW_VAR): Fixed macro argument.
edwin [Sat, 7 Oct 2006 12:54:14 +0000 (12:54 +0000)]
* src/vm/jit/stack.c (GET_NEW_VAR): Fixed macro argument.

(SET_TEMPVAR): Call new function stack_change_to_tempvar.

(stack_change_to_tempvar): New function.

(stack_analyse): Mark pass-through stackslots of INVOKEs instead of
resetting them to TEMPVARs.

* src/vm/jit/jit.h (PASSTHROUGH): New flag.

17 years ago* src/vm/jit/allocator/simplereg.c: Implemented REG_INDEX for
edwin [Sat, 7 Oct 2006 10:22:00 +0000 (10:22 +0000)]
* src/vm/jit/allocator/simplereg.c: Implemented REG_INDEX for
architectures with address register file.

17 years ago* src/vm/jit/allocator/simplereg.c
edwin [Sat, 7 Oct 2006 09:44:30 +0000 (09:44 +0000)]
* src/vm/jit/allocator/simplereg.c
(simplereg_allocate_locals_leafmethod): Fixed declaration after code.

17 years ago* src/vm/jit/allocator/simplereg.c (simplereg_allocate_interface):
edwin [Sat, 7 Oct 2006 00:06:49 +0000 (00:06 +0000)]
* src/vm/jit/allocator/simplereg.c (simplereg_allocate_interface):
Copy all flags except SAVEDVAR when reusing an interface slot.

17 years ago* src/vm/jit/allocator/simplereg.c: Cleaned up memory slot allocation.
edwin [Fri, 6 Oct 2006 23:58:35 +0000 (23:58 +0000)]
* src/vm/jit/allocator/simplereg.c: Cleaned up memory slot allocation.

17 years ago* src/vm/jit/allocator/simplereg.c (simplereg_allocate_interfaces): Fixed
edwin [Fri, 6 Oct 2006 23:41:02 +0000 (23:41 +0000)]
* src/vm/jit/allocator/simplereg.c (simplereg_allocate_interfaces): Fixed
indentation.

17 years ago* src/vm/jit/allocator/simplereg.c (simplereg_allocate_temporaries):
edwin [Fri, 6 Oct 2006 23:03:55 +0000 (23:03 +0000)]
* src/vm/jit/allocator/simplereg.c (simplereg_allocate_temporaries):
Minor cleanup, use SIMPLEREG_REG_INDEX.

17 years ago* src/vm/jit/allocator/simplereg.c: Reuse interface registers in blocks
edwin [Fri, 6 Oct 2006 22:37:13 +0000 (22:37 +0000)]
* src/vm/jit/allocator/simplereg.c: Reuse interface registers in blocks
that don't need them. Abstracted out the free register stacks with
macros. Major code cleanup.

* src/vm/jit/allocator/simplereg.h (reg_make_statistics): Renamed to
simplereg_make_statistics.

* src/vm/jit/reg.h (registerdata): Added fields `adrusedinout`,
`intusedinout`, `fltusedinout`, and `regisoutvar`.

* src/vm/jit/jit.c (simplereg_make_statistics): Renamed to
simplereg_make_statistics.

* src/vm/jit/jit.h (SAVEDTMP): Renamed to SAVREG.
(TMPARG): Renamed to ARGREG.
(STCOPY): Removed.
(STKEEP): Removed.

17 years ago* src/vm/jit/stack.c (stack_analyse): Do not set argintreguse to
edwin [Fri, 6 Oct 2006 21:30:48 +0000 (21:30 +0000)]
* src/vm/jit/stack.c (stack_analyse): Do not set argintreguse to
a value > INT_ARG_CNT, as this breaks some new code that will
later be committed to simplereg.c, and does not make sense, anyway.

17 years ago* src/vm/jit/intrp/Makefile.am (Changes): Added my name.
edwin [Fri, 6 Oct 2006 20:11:03 +0000 (20:11 +0000)]
* src/vm/jit/intrp/Makefile.am (Changes): Added my name.

17 years ago* src/vm/jit/show.h (show_variable): Made global.
edwin [Fri, 6 Oct 2006 20:09:28 +0000 (20:09 +0000)]
* src/vm/jit/show.h (show_variable): Made global.
(show_variable_array): Likewise.

* src/vm/jit/show.c (show_variable): Likewise.
(show_variable_array): Likewise.

17 years ago* src/threads/native/threads.c (threads_attach_current_thread): Rename
edwin [Thu, 5 Oct 2006 20:30:12 +0000 (20:30 +0000)]
* src/threads/native/threads.c (threads_attach_current_thread): Rename
left-over `t` to `thread` in interpreter code.

17 years ago* src/vm/jit/codegen-common.c: Include vm/jit/intrp/intrp.h to prevent
edwin [Thu, 5 Oct 2006 20:21:04 +0000 (20:21 +0000)]
* src/vm/jit/codegen-common.c: Include vm/jit/intrp/intrp.h to prevent
a warning.

17 years ago* src/vm/jit/intrp/intrp.h: Added missing prototypes.
edwin [Thu, 5 Oct 2006 20:18:41 +0000 (20:18 +0000)]
* src/vm/jit/intrp/intrp.h: Added missing prototypes.

* src/vm/jit/intrp/engine.c: Comment unused variable `ca1`.

* src/vm/jit/intrp/java.vmg: Mark the variables `currentsp` as
MAYBE_UNUSED.

17 years ago* src/vm/jit/intrp/intrp.h: Cleaned up. Defined missing prototypes.
edwin [Thu, 5 Oct 2006 20:04:38 +0000 (20:04 +0000)]
* src/vm/jit/intrp/intrp.h: Cleaned up. Defined missing prototypes.

* src/vm/jit/intrp/java.vmg: Defined "afi" type prefix.

17 years ago* src/vm/jit/intrp/peephole.c: Include interpreter files using < >
edwin [Thu, 5 Oct 2006 19:36:21 +0000 (19:36 +0000)]
* src/vm/jit/intrp/peephole.c: Include interpreter files using < >
instead of " ", so they are only searched for in the include path.
This avoids using the wrong include files when compiling in a
buildir.

* src/vm/jit/intrp/codegen.c: Likewise.
* src/vm/jit/intrp/engine.c: Likewise.
* src/vm/jit/intrp/disasm.c: Likewise.
* src/vm/jit/intrp/dynamic-super.c: Likewise.

* src/vm/jit/intrp/vmgenx: Fixed to work with builddir, and cleaned
up.

* src/vm/jit/intrp/Makefile.am: Fixed dependencies for builddir.

17 years ago* src/vm/jit/intrp/engine.c (Changes): Added my name.
edwin [Thu, 5 Oct 2006 17:52:03 +0000 (17:52 +0000)]
* src/vm/jit/intrp/engine.c (Changes): Added my name.
(vim boilerplate): Added.

17 years ago* src/native/jni.c (jni_attach_current_thread): New help function.
twisti [Thu, 5 Oct 2006 17:28:13 +0000 (17:28 +0000)]
* src/native/jni.c (jni_attach_current_thread): New help function.
(_Jv_JNI_AttachCurrentThread): Use helper function.
(_Jv_JNI_AttachCurrentThreadAsDaemon): Likewise.
(_Jv_JNI_DetachCurrentThread): Implemented.

* src/threads/native/threads.c (method_thread_init)
(method_threadgroup_add_: Made static.
(threads_init): Code rearranged.
(threads_startup_thread): Removed thread detach code and call
threads_detach_thread.
(threads_detach_thread): New function.

* src/threads/native/threads.h (threads_detach_thread): Added.

17 years ago* src/vm/utf8.c (utf_removeThread, utf_java_lang_Thread__V): Added.
twisti [Thu, 5 Oct 2006 17:23:48 +0000 (17:23 +0000)]
* src/vm/utf8.c (utf_removeThread, utf_java_lang_Thread__V): Added.
(utf8_init): Initialize new strings.
* src/vm/utf8.h (utf_removeThread, utf_java_lang_Thread__V): Added.

17 years ago* src/vm/vm.c (vm_create): Turn off the verifier for -Xint.
edwin [Thu, 5 Oct 2006 16:28:37 +0000 (16:28 +0000)]
* src/vm/vm.c (vm_create): Turn off the verifier for -Xint.

17 years ago* src/vm/jit/intrp/asmpart.c (intrp_asm_handle_exception): Style fix.
edwin [Thu, 5 Oct 2006 16:18:10 +0000 (16:18 +0000)]
* src/vm/jit/intrp/asmpart.c (intrp_asm_handle_exception): Style fix.

17 years ago* src/vm/jit/intrp/codegen.c (codegen): Save synchronized object in
edwin [Thu, 5 Oct 2006 16:12:16 +0000 (16:12 +0000)]
* src/vm/jit/intrp/codegen.c (codegen): Save synchronized object in
a special stackslot and use it for monitorexit.

* src/vm/jit/intrp/asmpart.c (intrp_asm_handle_exception): When
unwinding a synchronized method, exit the monitor.

17 years ago* src/vm/jit/intrp/codegen.c (codegen): Reserve an extra stackslot in
edwin [Thu, 5 Oct 2006 15:43:38 +0000 (15:43 +0000)]
* src/vm/jit/intrp/codegen.c (codegen): Reserve an extra stackslot in
synchronized methods.
(intrp_createcompilerstub): Likewise.
(intrp_createnativestub): Use stackframesize for clarity.

17 years ago* src/vm/jit/intrp/codegen.c (codegen): Separate stackframesize from
edwin [Thu, 5 Oct 2006 15:33:42 +0000 (15:33 +0000)]
* src/vm/jit/intrp/codegen.c (codegen): Separate stackframesize from
the number of local variables.
(intrp_createcompilerstub): Likewise.

* src/vm/jit/intrp/engine.c (MAXLOCALS): Changed to FRAMESIZE.

* src/vm/jit/intrp/java.vmg (INVOKEVIRTUAL): Use FRAMESIZE.
(INVOKESTATIC): Likewise.
(INVOKESPECIAL): Likewise.
(INVOKEINTERFACE): Likewise.

17 years ago* src/native/jni.c (jni_init_localref_table): New function.
twisti [Thu, 5 Oct 2006 14:13:06 +0000 (14:13 +0000)]
* src/native/jni.c (jni_init_localref_table): New function.
(AttachCurrentThread): Implemented.
(JNI_CreateJavaVM): Use jni_init_localref_table.

* src/threads/native/threads.c (method_thread_init)
(method_threadgroup_add): New global variables.
(threads_init): Store methods resolved in global variables.
(threads_attach_current_thread): New function.

* src/threads/native/threads.h (MIN_PRIORITY, NORM_PRIORITY)
(MAX_PRIORITY): Defined.
(threads_attach_current_thread): New function.

17 years ago* src/vm/jit/intrp/java.vmg (TRACECALL): Implemented for 32-bit
edwin [Thu, 5 Oct 2006 12:23:23 +0000 (12:23 +0000)]
* src/vm/jit/intrp/java.vmg (TRACECALL): Implemented for 32-bit
architectures.

17 years ago* src/vm/jit/intrp/codegen.c (codegen): Fix off-by-one error in len
edwin [Thu, 5 Oct 2006 10:50:39 +0000 (10:50 +0000)]
* src/vm/jit/intrp/codegen.c (codegen): Fix off-by-one error in len
tests of optimizations.

17 years ago* src/vm/jit/show.c (show_icmd): Show constant operand of IFxx, and
edwin [Thu, 5 Oct 2006 10:41:28 +0000 (10:41 +0000)]
* src/vm/jit/show.c (show_icmd): Show constant operand of IFxx, and
IF_Lxx.

17 years ago* src/vm/jit/show.c (show_basicblock): Fixed deadcode check.
edwin [Thu, 5 Oct 2006 10:39:09 +0000 (10:39 +0000)]
* src/vm/jit/show.c (show_basicblock): Fixed deadcode check.

* src/vm/jit/intrp/asmpart.c (intrp_asm_handle_exception): Clear
global_sp.

17 years ago* src/vm/jit/powerpc/emit.c (emit_verbosecall_enter): Darwin build
twisti [Thu, 5 Oct 2006 09:04:12 +0000 (09:04 +0000)]
* src/vm/jit/powerpc/emit.c (emit_verbosecall_enter): Darwin build
fixes.

17 years ago* src/vm/jit/intrp/asmpart.c (intrp_asm_handle_exception): Fixed for
edwin [Thu, 5 Oct 2006 00:21:12 +0000 (00:21 +0000)]
* src/vm/jit/intrp/asmpart.c (intrp_asm_handle_exception): Fixed for
catch-all handlers.

17 years ago* src/vm/jit/show.c (show_method): Adapted to interpreter.
edwin [Thu, 5 Oct 2006 00:06:23 +0000 (00:06 +0000)]
* src/vm/jit/show.c (show_method): Adapted to interpreter.
(show_basicblock): Likewise.

* src/vm/jit/intrp/disass.c (intrp_disassinstr): Write disassembly to
stdout.
(intrp_disassemble): Likewise.

17 years ago* tests/regression/jctest.java: Also test division/remainder with
edwin [Wed, 4 Oct 2006 23:08:33 +0000 (23:08 +0000)]
* tests/regression/jctest.java: Also test division/remainder with
constant divisor 1.

* tests/regression/jctest.output: Updated test output.

17 years ago* src/vm/jit/intrp/codegen.c (codegen): Don't ?DIVPOW2 with value 1.
edwin [Wed, 4 Oct 2006 23:05:15 +0000 (23:05 +0000)]
* src/vm/jit/intrp/codegen.c (codegen): Don't ?DIVPOW2 with value 1.
The optimization produces the wrong result in this case.

17 years ago* src/vm/jit/intrp/codegen.c (codegen): Implemented IDIVPOW2 and
edwin [Wed, 4 Oct 2006 22:53:51 +0000 (22:53 +0000)]
* src/vm/jit/intrp/codegen.c (codegen): Implemented IDIVPOW2 and
LDIVPOW2 optimizations.

17 years ago* src/vm/jit/intrp/codegen.c (codegen): Implemented IREMPOW2 and
edwin [Wed, 4 Oct 2006 22:39:44 +0000 (22:39 +0000)]
* src/vm/jit/intrp/codegen.c (codegen): Implemented IREMPOW2 and
LREMPOW2 optimizations.

17 years ago* src/vm/jit/intrp/codegen.c (codegen): Implement optimization of comparisons.
edwin [Wed, 4 Oct 2006 22:12:02 +0000 (22:12 +0000)]
* src/vm/jit/intrp/codegen.c (codegen): Implement optimization of comparisons.

17 years ago* src/vm/jit/allocator/simplereg.c (reg_free_temp_func): Fixed indices
edwin [Wed, 4 Oct 2006 20:44:03 +0000 (20:44 +0000)]
* src/vm/jit/allocator/simplereg.c (reg_free_temp_func): Fixed indices
into regcopycount array.
(allocate_scratch_registers): Likewise.

17 years ago* src/vm/jit/intrp/codegen.c (codegen): #if 0-ed optimized ICMDs that
edwin [Wed, 4 Oct 2006 20:02:37 +0000 (20:02 +0000)]
* src/vm/jit/intrp/codegen.c (codegen): #if 0-ed optimized ICMDs that
are currently not used. In order to use these instructions, we could
either add the optimization checks directly to codegen.c, or introduce
a special pass between parse and intrp_codegen which replaces the
instructions.

17 years ago* src/vm/jit/intrp/codegen.c (codegen): Removed unoptimized *CONST
edwin [Wed, 4 Oct 2006 19:47:01 +0000 (19:47 +0000)]
* src/vm/jit/intrp/codegen.c (codegen): Removed unoptimized *CONST
instructions. Since stack_analyse is no longer performed before the
interpreter codegen, these instructions cannot occur.

17 years ago* src/vm/jit/stack.c: Removed interpreter-specific code.
edwin [Wed, 4 Oct 2006 19:38:28 +0000 (19:38 +0000)]
* src/vm/jit/stack.c: Removed interpreter-specific code.

17 years ago* src/threads/native/lock.c (lock_monitor_exit): Check for NULL object.
edwin [Wed, 4 Oct 2006 18:44:28 +0000 (18:44 +0000)]
* src/threads/native/lock.c (lock_monitor_exit): Check for NULL object.
There is no guarantee that MONITORENTER/EXITs are properly nested, so
we cannot rely on the check in lock_monitor_enter here.

17 years ago* tests/regression/jasmin/test_nullpointerexception_monitorexit.j:
edwin [Wed, 4 Oct 2006 18:39:49 +0000 (18:39 +0000)]
* tests/regression/jasmin/test_nullpointerexception_monitorexit.j:
Fixed test case, so it passes if the exception is thrown.

17 years ago* tests/regression/jasmin/test_nullpointerexception_monitorexit.j:
edwin [Wed, 4 Oct 2006 18:35:37 +0000 (18:35 +0000)]
* tests/regression/jasmin/test_nullpointerexception_monitorexit.j:
New test.

* tests/regression/jasmin/Makefile.am: Added
test_nullpointerexception_monitorexit.j.

17 years ago* tests/regression/jasmin/Makefile.am: Properly quote variables.
edwin [Wed, 4 Oct 2006 18:25:52 +0000 (18:25 +0000)]
* tests/regression/jasmin/Makefile.am: Properly quote variables.

17 years ago* src/vm/jit/intrp/engine.c (THROW_CLASSCASTEXCEPTION): Really throw a
edwin [Wed, 4 Oct 2006 18:23:19 +0000 (18:23 +0000)]
* src/vm/jit/intrp/engine.c (THROW_CLASSCASTEXCEPTION): Really throw a
ClassCastException, not a NullPointerException.

* src/vm/jit/intrp/asmpart.c (intrp_asm_handle_exception): Set
global_sp, in case the resolving of the catchtype involves the
execution of Java code.

* src/vm/jit/intrp/java.vmg (MONITORENTER): Check for exception.
(MONITOREXIT): Likewise.

17 years ago* src/vm/jit/intrp/java.vmg (LOOKUPSWITCH): No point in using >= 0 on
edwin [Wed, 4 Oct 2006 16:42:41 +0000 (16:42 +0000)]
* src/vm/jit/intrp/java.vmg (LOOKUPSWITCH): No point in using >= 0 on
an unsigned variable.

17 years ago* src/vm/jit/intrp/codegen.c (nativecall): Store return valud of
edwin [Wed, 4 Oct 2006 16:01:53 +0000 (16:01 +0000)]
* src/vm/jit/intrp/codegen.c (nativecall): Store return valud of
codegen_finish_native_call in *exceptionptr.

* src/vm/jit/intrp/asmpart.c (intrp_asm_handle_exception): Resolve
unresolved catchtype references.

17 years ago* src/vm/jit/intrp/codegen.c (codegen): Convert JavaPCs to block indices.
edwin [Wed, 4 Oct 2006 15:14:19 +0000 (15:14 +0000)]
* src/vm/jit/intrp/codegen.c (codegen): Convert JavaPCs to block indices.
Do not check for BBREACHED (not set by parse).
(gen_branch): Convert JavaPCs to block indices.

* src/vm/jit/intrp/java.vmg (RET): restored.

* src/vm/jit/jit.c (jit_compile_intern): Do not perform stack_analyse and
dependent passes for intrp.

17 years ago* src/vm/jit/intrp/md.c (intrp_md_init): Set vm_out to stderr.
twisti [Wed, 4 Oct 2006 15:04:52 +0000 (15:04 +0000)]
* src/vm/jit/intrp/md.c (intrp_md_init): Set vm_out to stderr.

* src/vm/jit/intrp/engine.c (THROW_CLASSCASTEXCEPTION): Added.
(engine): Handle ClassCastExceptions with argument.

* src/vm/jit/intrp/asmpart.c (intrp_asm_handle_exception): Indent.

* src/vm/jit/intrp/dynamic-super.c: Use LOCK_MONITOR_{ENTER,EXIT}
macros.

* src/vm/jit/intrp/patcher.c (intrp_patcher_invokestatic_special):
Write back method pointer.  I wonder how this ever worked before.
(intrp_patcher_invokevirtual): Likewise.
(intrp_patcher_invokeinterface): Likewise.

* src/vm/jit/intrp/java.vmg (RET): Removed.
(TABLESWITCH): Changed reading direction of cases.  Don't know if that
works: NOT TESTED!
(CHECKCAST): Use THROW_CLASSCASTEXCEPTION.
(ARRAYCHECKCAST): Likewise.
(MONITORENTER): Likewise.
(MONITOREXIT): Likewise.

17 years ago* src/vm/jit/intrp/dynamic-super.c (superreuse_insert): Use
edwin [Wed, 4 Oct 2006 14:50:21 +0000 (14:50 +0000)]
* src/vm/jit/intrp/dynamic-super.c (superreuse_insert): Use
lock_monitor_ functions.
(patchersuper_rewrite): Likewise.
(hashtable_patchersupers_insert): Likewise.