On Thu, 2009-07-02 at 08:24 +0200, Vegard Nossum wrote:
> 2009/7/2 Tomek Grabiec :
> > fixup_vtable() was using old ->method_index field which is no longer valid.
> >
> > Signed-off-by: Tomek Grabiec
>
> Acked-by: Vegard Nossum
>
> Sorry about that!
>
> The ->method_index refers to the method'
2009/7/2 Tomek Grabiec :
> fixup_vtable() was using old ->method_index field which is no longer valid.
>
> Signed-off-by: Tomek Grabiec
Acked-by: Vegard Nossum
Sorry about that!
The ->method_index refers to the method's index in the class'
->methods array. So yeah, it doesn't _usually_ form a
2009/7/1 Tomek Grabiec :
>
> Signed-off-by: Tomek Grabiec
> ---
> include/vm/java_lang.h | 1 +
> include/vm/object.h | 4
> vm/class.c | 4 +++-
> vm/jato.c | 5 -
> 4 files changed, 8 insertions(+), 6 deletions(-)
>
> diff --git a/include/vm/java
fixup_vtable() was using old ->method_index field which is no longer valid.
Signed-off-by: Tomek Grabiec
---
arch/x86/emit-code.c |2 +-
vm/class.c |4
2 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/arch/x86/emit-code.c b/arch/x86/emit-code.c
index a348ab3.
Signed-off-by: Tomek Grabiec
---
vm/object.c | 17 +
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/vm/object.c b/vm/object.c
index 0f96e62..b5b1afc 100644
--- a/vm/object.c
+++ b/vm/object.c
@@ -317,22 +317,24 @@ void vm_object_check_array(struct vm_object *obj
On Wed, 2009-07-01 at 10:38 +0200, Vegard Nossum wrote:
> @@ -783,6 +783,17 @@ void emit_prolog(struct buffer *buf, unsigned long
> nr_locals)
> __emit_sub_imm_reg(buf, nr_locals * sizeof(unsigned long),
> REG_ESP);
> }
>
> +void emit_trace_invoke(struct buffer *buf,
> + cons
applied, thanks!
--
___
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel
On Tue, 2009-06-30 at 16:27 +0200, Arthur Huillet wrote:
> Hi,
>
> On Tue, 30 Jun 2009 16:04:33 +0200
> Arthur Huillet wrote:
>
> > please don't apply right now, I have a test that breaks.
>
> Please apply this patch, it is OK.
> The test wasn't. :)
Applied, thanks!
On Mon, 2009-06-29 at 19:41 +0200, Tomek Grabiec wrote:
> We do not have to load object reference from stack with this instruction:
>
> mov 0(%esp), %reg
>
> Before we select the code for EXPR_INVOKEVIRTUAL code for call arguments
> is selected so we know what register was allocated to the argume
On Mon, 2009-06-29 at 19:40 +0200, Vegard Nossum wrote:
> In accordance with the JVM specification, we should only initialize
> classes when the putstatic/getstatic/invokestatic instructions are
> _executed_ (there are a few other cases too, but the main point is
> that we cannot do this at method
On Tue, 2009-06-30 at 00:01 +0200, Vegard Nossum wrote:
> Alas, we cannot initialize these classes; the JVM spec. forbids it.
>
> Signed-off-by: Vegard Nossum
> ---
> vm/jato.c |9 -
> 1 files changed, 0 insertions(+), 9 deletions(-)
>
> diff --git a/vm/jato.c b/vm/jato.c
> index 6f
On Tue, 2009-06-30 at 09:08 +0200, Vegard Nossum wrote:
> 08:59 < penberg_home> vegard: cool.
> 08:59 < penberg_home> vegard: but doesn't that make debugging too easy?
>
> Signed-off-by: Vegard Nossum
Applied, thanks!
On Mon, 2009-06-29 at 22:58 +0200, Vegard Nossum wrote:
> We used to simply append the subclass' methods to the end of the
> vtable of the superclass.
>
> With this patch, we only append those methods which are not defined in
> the superclass; the methods which are defined in the superclass are
>
On Tue, 2009-06-30 at 23:53 +0200, Vegard Nossum wrote:
> We need to initialize static fields to zero even before the class
> initializer runs (since the initializer may refer to static fields).
>
> This still needs a lot of work, but here is a preliminary fix that
> initializes a whole pointer in
Applied, thanks!
--
___
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel
On Tue, 2009-06-30 at 23:24 +0200, Vegard Nossum wrote:
> + if (opt_trace_invoke) {
> + emit_trace_invoke(cu->objcode, cu->method->class->name,
> + cu->method->name, cu->method->type);
> + }
Please implement a jit_trace_function(struct compilation_unit *cu)
On Tue, 2009-06-30 at 19:55 +0200, Vegard Nossum wrote:
> We're scanning the method signature to determine the number of "real"
> arguments to pass for an "invoke" opcode. We use the function
> method_real_argument_count() for this. But it doesn't skip class names,
> so if there is an uppercase J o
Applied, thanks!
--
___
Jatovm-devel mailing list
Jatovm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jatovm-devel
On Tue, 2009-06-30 at 19:31 +0200, Vegard Nossum wrote:
> Here, second try. You may or may not like the new style; I think it
> improves the overall readability (and mutability) quite a lot.
>
> 08:59 < penberg_home> vegard: cool.
> 08:59 < penberg_home> vegard: but doesn't that make debugging too
This is a requirement of GNU classpath (otherwise we crash with a
NullPointerException).
Signed-off-by: Vegard Nossum
---
vm/jato.c | 10 ++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/vm/jato.c b/vm/jato.c
index 565754c..f7838ba 100644
--- a/vm/jato.c
+++ b/vm/jato
Needed for VMSystemProperties initialisation.
Signed-off-by: Vegard Nossum
---
include/vm/java_lang.h |4
vm/jato.c | 34 ++
2 files changed, 38 insertions(+), 0 deletions(-)
diff --git a/include/vm/java_lang.h b/include/vm/java_lang.h
ind
Needed for VMSystemProperties initialisation.
Signed-off-by: Vegard Nossum
---
include/vm/java_lang.h |4 +++
vm/jato.c | 51 ---
2 files changed, 47 insertions(+), 8 deletions(-)
diff --git a/include/vm/java_lang.h b/include/vm/jav
This is a requirement of GNU classpath (otherwise we crash with a
NullPointerException).
Signed-off-by: Vegard Nossum
---
vm/jato.c | 10 ++
1 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/vm/jato.c b/vm/jato.c
index fb47173..05239ac 100644
--- a/vm/jato.c
+++ b/vm/jato
We'd better just use the one that ships with GNU Classpath.
Signed-off-by: Vegard Nossum
---
Makefile |3 +--
.../gnu/classpath/VMSystemProperties.java | 10 --
2 files changed, 1 insertions(+), 12 deletions(-)
delete mode 100644
Signed-off-by: Tomek Grabiec
---
regression/jvm/StringTest.java | 14 +-
regression/jvm/TestCase.java |4
2 files changed, 17 insertions(+), 1 deletions(-)
diff --git a/regression/jvm/StringTest.java b/regression/jvm/StringTest.java
index 3a9e0d0..dc69195 100644
--- a/r
Signed-off-by: Tomek Grabiec
---
vm/jato.c | 60 +---
1 files changed, 57 insertions(+), 3 deletions(-)
diff --git a/vm/jato.c b/vm/jato.c
index c7c6e17..12badf2 100644
--- a/vm/jato.c
+++ b/vm/jato.c
@@ -86,10 +86,64 @@ static void __vm
Signed-off-by: Tomek Grabiec
---
include/vm/object.h | 12
vm/object.c |9 -
vm/utf8.c |7 +++
3 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/include/vm/object.h b/include/vm/object.h
index 6fcdfa0..a38a1d3 100644
--- a/includ
Signed-off-by: Arthur Huillet
---
regression/Makefile |5 +
1 files changed, 5 insertions(+), 0 deletions(-)
create mode 100644 regression/Makefile
diff --git a/regression/Makefile b/regression/Makefile
new file mode 100644
index 000..4883b97
--- /dev/null
+++ b/regression/Makefile
Signed-off-by: Tomek Grabiec
---
regression/jvm/ArrayExceptionsTest.java |4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/regression/jvm/ArrayExceptionsTest.java
b/regression/jvm/ArrayExceptionsTest.java
index d1a726d..3d5300e 100644
--- a/regression/jvm/ArrayExceptio
Signed-off-by: Vegard Nossum
---
arch/x86/insn-selector_32.brg |7 ---
vm/class.c| 15 ---
2 files changed, 16 insertions(+), 6 deletions(-)
diff --git a/arch/x86/insn-selector_32.brg b/arch/x86/insn-selector_32.brg
index 6346454..9b918f6 100644
--- a/ar
Signed-off-by: Tomek Grabiec
---
include/vm/class.h |2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/vm/class.h b/include/vm/class.h
index 4693e3e..6782ae5 100644
--- a/include/vm/class.h
+++ b/include/vm/class.h
@@ -52,7 +52,7 @@ struct vm_class {
struct
Signed-off-by: Arthur Huillet
---
arch/x86/emit-code.c| 18 ++
arch/x86/include/arch/instruction.h |2 ++
arch/x86/insn-selector_32.brg | 34 +-
arch/x86/lir-printer.c | 14 ++
arch/x86/use-de
Signed-off-by: Tomek Grabiec
---
vm/object.c |2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/vm/object.c b/vm/object.c
index f3a738f..7ed883d 100644
--- a/vm/object.c
+++ b/vm/object.c
@@ -46,7 +46,7 @@ struct vm_object *vm_object_alloc_native_array(int type, int
count
Signed-off-by: Tomek Grabiec
---
include/vm/class.h |3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/include/vm/class.h b/include/vm/class.h
index 6782ae5..c84efe5 100644
--- a/include/vm/class.h
+++ b/include/vm/class.h
@@ -25,10 +25,11 @@ enum vm_class_kind {
};
s
Signed-off-by: Tomek Grabiec
---
vm/jato.c | 34 ++
1 files changed, 26 insertions(+), 8 deletions(-)
diff --git a/vm/jato.c b/vm/jato.c
index 27f816a..c7c6e17 100644
--- a/vm/jato.c
+++ b/vm/jato.c
@@ -199,6 +199,17 @@ static const struct preload_entry preload
Signed-off-by: Tomek Grabiec
---
vm/jato.c |2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/vm/jato.c b/vm/jato.c
index ec46b15..27f816a 100644
--- a/vm/jato.c
+++ b/vm/jato.c
@@ -141,7 +141,7 @@ native_vmclassloader_getprimitiveclass(int type)
primitive_class_
Every class has egzactly one vm_class struct in VM.
Signed-off-by: Tomek Grabiec
---
include/vm/class.h |1 -
vm/class.c | 29 +
2 files changed, 1 insertions(+), 29 deletions(-)
diff --git a/include/vm/class.h b/include/vm/class.h
index bbee5c0..4693e3
Signed-off-by: Tomek Grabiec
---
vm/class.c |1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/vm/class.c b/vm/class.c
index fae5562..c69b721 100644
--- a/vm/class.c
+++ b/vm/class.c
@@ -263,6 +263,7 @@ int vm_class_link_bogus_class(struct vm_class *vmc, const
char *class_
Signed-off-by: Tomek Grabiec
---
vm/class.c | 15 ++-
1 files changed, 2 insertions(+), 13 deletions(-)
diff --git a/vm/class.c b/vm/class.c
index c69b721..6629393 100644
--- a/vm/class.c
+++ b/vm/class.c
@@ -573,20 +573,9 @@ char *vm_class_get_array_element_class_name(const char
Signed-off-by: Tomek Grabiec
---
include/vm/types.h |1 +
vm/classloader.c | 12
2 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/include/vm/types.h b/include/vm/types.h
index c1b650e..f5bf6e7 100644
--- a/include/vm/types.h
+++ b/include/vm/types.h
@@ -13,6 +
Please check whether this fixes your crash with PrintTest. (It should
crash in monoburg now instead). If it does, you can apply it, I think
:-)
Signed-off-by: Vegard Nossum
---
vm/class.c | 15 ---
1 files changed, 12 insertions(+), 3 deletions(-)
diff --git a/vm/class.c b/vm/clas
2009/7/1 Tomek Grabiec :
> This also introduces vm_class.array_element_class field which points
> to the class of array element for array classes. This field is set
> during array class loading. Array element class is initialized on
> demand, when vm_class_get_array_element_class() is called.
>
> S
2009/7/1 Tomek Grabiec :
> This field allows to distinguish between regular classes, array classes and
> primitive type classes.
>
> Signed-off-by: Tomek Grabiec
> ---
> include/vm/class.h | 14 +-
> vm/class.c | 1 +
> vm/classloader.c | 3 +++
> 3 files changed, 17
2009/7/1 Tomek Grabiec :
> ---intro private vmtype
>
> Signed-off-by: Tomek Grabiec
> ---
> include/vm/class.h | 5 +++
> include/vm/classloader.h | 1 +
> include/vm/java_lang.h | 8 ++
> vm/classloader.c | 63 ++---
> vm/jat
2009/7/1 Tomek Grabiec :
>
> Signed-off-by: Tomek Grabiec
> ---
> vm/object.c | 8 ++--
> 1 files changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/vm/object.c b/vm/object.c
> index 26b1f76..aaf4606 100644
> --- a/vm/object.c
> +++ b/vm/object.c
> @@ -14,6 +14,7 @@
> #include
>
2009/7/1 Tomek Grabiec :
>
> Signed-off-by: Tomek Grabiec
> ---
> include/vm/types.h | 2 ++
> vm/types.c | 39 +++
> 2 files changed, 41 insertions(+), 0 deletions(-)
>
> diff --git a/include/vm/types.h b/include/vm/types.h
> index 1455439..54d2c6
2009/7/1 Tomek Grabiec :
> Classes can be equal even if the pointers are not equal.
> That's because array classes are not cached and the same class may
> be represented by different copies of struct vm_class.
>
> The proper soultion would be to cache array types also but it is
> not something that
Signed-off-by: Tomek Grabiec
---
include/vm/types.h |2 ++
vm/types.c | 39 +++
2 files changed, 41 insertions(+), 0 deletions(-)
diff --git a/include/vm/types.h b/include/vm/types.h
index 1455439..54d2c60 100644
--- a/include/vm/types.h
+++ b/i
Signed-off-by: Tomek Grabiec
---
AUTHORS |5 +
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/AUTHORS b/AUTHORS
index 729a92f..6fd4a2f 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -13,3 +13,8 @@ E: vegard.nos...@gmail.com
W: http://folk.uio.no/vegardno/
D: Class loading (GSoC
This field allows to distinguish between regular classes, array classes and
primitive type classes.
Signed-off-by: Tomek Grabiec
---
include/vm/class.h | 14 +-
vm/class.c |1 +
vm/classloader.c |3 +++
3 files changed, 17 insertions(+), 1 deletions(-)
diff --git
Hi,
> +void emit_trace_invoke(struct buffer *buf,
> + const char *class, const char *method, const char *type)
> +{
> + __emit_push_imm(buf, (unsigned long) type);
> + __emit_push_imm(buf, (unsigned long) method);
> + __emit_push_imm(buf, (unsigned long) class);
> + __emit_push
Signed-off-by: Tomek Grabiec
---
regression/jvm/ArrayTest.java | 14 ++
regression/jvm/TestCase.java |4
2 files changed, 18 insertions(+), 0 deletions(-)
diff --git a/regression/jvm/ArrayTest.java b/regression/jvm/ArrayTest.java
index 44c87d7..9f4354f 100644
--- a/regre
Signed-off-by: Tomek Grabiec
---
vm/jato.c |5 +
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/vm/jato.c b/vm/jato.c
index 06c8b8f..ec46b15 100644
--- a/vm/jato.c
+++ b/vm/jato.c
@@ -113,6 +113,11 @@ native_vmthrowable_fill_in_stack_trace(struct vm_object
*message)
sta
It returns the vm_type of storage that should be used for instances of
given class.
Signed-off-by: Tomek Grabiec
---
include/vm/class.h |2 ++
vm/class.c |8
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/include/vm/class.h b/include/vm/class.h
index eba
Signed-off-by: Tomek Grabiec
---
include/vm/types.h |2 +-
vm/classloader.c | 31 ++-
vm/types.c |2 +-
3 files changed, 4 insertions(+), 31 deletions(-)
diff --git a/include/vm/types.h b/include/vm/types.h
index 54d2c60..c1b650e 100644
--- a/incl
Signed-off-by: Tomek Grabiec
---
include/vm/object.h |2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/include/vm/object.h b/include/vm/object.h
index dd0905d..6fcdfa0 100644
--- a/include/vm/object.h
+++ b/include/vm/object.h
@@ -18,7 +18,7 @@ struct vm_object {
---intro private vmtype
Signed-off-by: Tomek Grabiec
---
include/vm/class.h |5 +++
include/vm/classloader.h |1 +
include/vm/java_lang.h |8 ++
vm/classloader.c | 63 ++---
vm/jato.c| 17
5
Signed-off-by: Tomek Grabiec
---
vm/jato.c | 16
1 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/vm/jato.c b/vm/jato.c
index 1968be5..06c8b8f 100644
--- a/vm/jato.c
+++ b/vm/jato.c
@@ -128,6 +128,20 @@ native_vmclass_getname(struct vm_object *object)
re
Allocate subarrays of sub-array class not the super array's class
Signed-off-by: Tomek Grabiec
---
vm/object.c |6 +-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/vm/object.c b/vm/object.c
index aaf4606..f3a738f 100644
--- a/vm/object.c
+++ b/vm/object.c
@@ -130,8 +130,
This also introduces vm_class.array_element_class field which points
to the class of array element for array classes. This field is set
during array class loading. Array element class is initialized on
demand, when vm_class_get_array_element_class() is called.
Signed-off-by: Tomek Grabiec
---
in
Signed-off-by: Tomek Grabiec
---
regression/jvm/ArrayTest.java | 80 +
1 files changed, 80 insertions(+), 0 deletions(-)
diff --git a/regression/jvm/ArrayTest.java b/regression/jvm/ArrayTest.java
index 8616b40..44c87d7 100644
--- a/regression/jvm/ArrayT
This fixes a bug in type_to_scale() where for element types less than
word size it returned 0 or 1 scale exponent. This caused that during
store to an array element the following elements were overwriten. This
caused that this code didn't work:
{
byte x[] = new byte[2];
x[1] =
Signed-off-by: Tomek Grabiec
---
include/vm/java_lang.h |1 +
include/vm/object.h|4
vm/class.c |4 +++-
vm/jato.c |5 -
4 files changed, 8 insertions(+), 6 deletions(-)
diff --git a/include/vm/java_lang.h b/include/vm/java_lang.h
index e3e2
Signed-off-by: Tomek Grabiec
---
vm/object.c |8 ++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/vm/object.c b/vm/object.c
index 26b1f76..aaf4606 100644
--- a/vm/object.c
+++ b/vm/object.c
@@ -14,6 +14,7 @@
#include
#include
#include
+#include
#include
str
Signed-off-by: Tomek Grabiec
---
arch/x86/insn-selector_32.brg |7 ++-
1 files changed, 2 insertions(+), 5 deletions(-)
diff --git a/arch/x86/insn-selector_32.brg b/arch/x86/insn-selector_32.brg
index 39303ba..2d50ea6 100644
--- a/arch/x86/insn-selector_32.brg
+++ b/arch/x86/insn-select
Classes can be equal even if the pointers are not equal.
That's because array classes are not cached and the same class may
be represented by different copies of struct vm_class.
The proper soultion would be to cache array types also but it is
not something that can be easily done now.
Signed-off
Those classes must have the same vtable as their
super class - java.lang.Object
Signed-off-by: Tomek Grabiec
---
include/vm/class.h |1 +
vm/class.c | 19 +++
vm/classloader.c | 26 ++
3 files changed, 30 insertions(+), 16 deletions(-)
d
Fixes a memory corruption when loading classes that inherit static
fields.
Signed-off-by: Vegard Nossum
---
vm/class.c |2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/vm/class.c b/vm/class.c
index ec76c69..eaacbda 100644
--- a/vm/class.c
+++ b/vm/class.c
@@ -194,7 +194,
Signed-off-by: Arthur Huillet
---
arch/x86/emit-code.c| 38 +++
arch/x86/include/arch/instruction.h | 16 -
arch/x86/lir-printer.c | 14
arch/x86/use-def.c |2 +
4 files changed, 68 in
Signed-off-by: Arthur Huillet
---
jit/compilation-unit.c |1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/jit/compilation-unit.c b/jit/compilation-unit.c
index 793924f..2c2212e 100644
--- a/jit/compilation-unit.c
+++ b/jit/compilation-unit.c
@@ -144,6 +144,7 @@ struct var_
This patch adds a new command-line flag, -Xtrace:invoke, which will
output a line whenever a method is called, saying which method of
which class that was invoked. Note that the print-out happens from
inside the JIT-compiled code itself, so we are certain to get the
message every time the function
2009/7/1 Arthur HUILLET :
> Hi,
>
>> +void emit_trace_invoke(struct buffer *buf,
>> + const char *class, const char *method, const char *type)
>> +{
>> + __emit_push_imm(buf, (unsigned long) type);
>> + __emit_push_imm(buf, (unsigned long) method);
>> + __emit_push_imm(buf, (unsigne
Signed-off-by: Vegard Nossum
---
test/jit/tree-printer-test.c |2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/test/jit/tree-printer-test.c b/test/jit/tree-printer-test.c
index 1664b87..734adbe 100644
--- a/test/jit/tree-printer-test.c
+++ b/test/jit/tree-printer-test.c
@
We actually need two functions for allocating strings -- one that
converts from the class-format UTF-8 variant and one that converts
from regular UTF-8. The second one is what we would use from C
programs.
Note: We don't actually support code points >= 0x80 in the C variant
(regular UTF-8) yet.
S
This patch adds a new command-line flag, -Xtrace:invoke, which will
output a line whenever a method is called, saying which method of
which class that was invoked. Note that the print-out happens from
inside the JIT-compiled code itself, so we are certain to get the
message every time the function
A sentence in the JVM spec gave me the impression that accessing a final
class field should not trigger class initialization, but this appears to
be wrong. It appears that this sentence was intended for the compiler,
since GNU classpath's System.out is in fact static final and without this
patch, w
76 matches
Mail list logo