/hg/icedtea6: Edward Nevill (ed at camswl.com)

enevill at icedtea.classpath.org enevill at icedtea.classpath.org
Fri Sep 11 06:09:02 PDT 2009


changeset b7e6ccea40d4 in /hg/icedtea6
details: http://icedtea.classpath.org/hg/icedtea6?cmd=changeset;node=b7e6ccea40d4
author: "Edward Nevill (ed at camswl.com)"
date: Fri Sep 11 14:12:15 2009 +0100

	Edward Nevill (ed at camswl.com)


diffstat:

11 files changed, 7037 insertions(+), 4216 deletions(-)
ChangeLog                                                |   21 
Makefile.am                                              |   12 
mkbc.c                                                   |   44 
ports/hotspot/build/linux/makefiles/zero.make            |   18 
ports/hotspot/src/cpu/zero/vm/bytecodes_arm.def          | 4486 +++++++--
ports/hotspot/src/cpu/zero/vm/bytecodes_zero.cpp         |   30 
ports/hotspot/src/cpu/zero/vm/bytecodes_zero.hpp         |   70 
ports/hotspot/src/cpu/zero/vm/bytes_zero.hpp             |  221 
ports/hotspot/src/cpu/zero/vm/cppInterpreter_arm.S       | 6334 +++++++-------
ports/hotspot/src/cpu/zero/vm/cppInterpreter_zero.cpp    |   13 
ports/hotspot/src/os_cpu/linux_zero/vm/os_linux_zero.cpp |    4 

diffs (truncated from 15832 to 500 lines):

diff -r 738d06e2778e -r b7e6ccea40d4 ChangeLog
--- a/ChangeLog	Thu Sep 10 16:31:56 2009 -0400
+++ b/ChangeLog	Fri Sep 11 14:12:15 2009 +0100
@@ -1,3 +1,24 @@ 2009-09-09  Lillian Angel  <langel at redha
+2009-09-11  Edward Nevill  <ed at camswl.com>
+
+	* Makefile.am: Changed mkbc rule to allow preprocessing by gcc
+	* mkbc.c: Changed to allow preprocessing by gcc
+	* zero.make: Added support for automatic offset generation
+	* asm_helper.c: Support for offset generation and calling of
+	C++ virtual functions from Asm
+	* bytecodes_zero.cpp: Added new fast bytecodes
+	* bytecodes_zero.hpp: Ditto
+	* bytes_zero.hpp: Optimised get_native_X and get_Java_X
+	* cppInterpreter_zero.cpp: Fixed some type definitions & casts
+	Moved configuration checking from here to asm_generate_entry
+	* os_linux_zero.cpp: Removed #if defined(PRODUCT)
+	* cppInterpreter_arm.S:
+	* bytecodes_arm.def:
+	Support for HW FP. Lots of debugs and asserts. Build for gcc 4.1
+	Automatic generation of asm offsets. Removed sync. native entry.
+	Support for UseCompiler. Fastpath invokeinterface. Optimised new,
+	instanceof & checkcast. Additional fast bytecodes and bc sequences.
+	Fast div and rem by constant. Other minor optimisations.
+
 2009-09-09  Lillian Angel  <langel at redhat.com>
 
 	* Makefile.am: Added NB_PLATFORM and NB_APISUPPORT to determine
diff -r 738d06e2778e -r b7e6ccea40d4 Makefile.am
--- a/Makefile.am	Thu Sep 10 16:31:56 2009 -0400
+++ b/Makefile.am	Fri Sep 11 14:12:15 2009 +0100
@@ -477,8 +477,18 @@ ZERO_ASM_BC_ASM_COND = $(shell test -f $
 $(abs_top_srcdir)/mkbc: $(abs_top_srcdir)/mkbc.c
 	$(CC) $< -o $@
 
+# ECN: The following rule has been changed to allow preprocessing of the bytecode definition
+# file prior to running 'mkbc'. This allows you to use -DXXX on the gcc command. There are two
+# options currently recognized.
+#
+# -DDISABLE_NOTICE_SAFEPONTS	- Always run in 'safe' mode.
+# -DDISABLE_FAST_BYTECODES	- Disable fast bytecode replacement and bytecode sequences
+#
+# These options are provided mainly to assist debugging by returning the bytecode interpreter
+# to a 'vanilla' interpreter.
+#
 ${ZERO_ASM_BC_ASM}: ${ZERO_ASM_BC_DEF} $(abs_top_srcdir)/mkbc
-	$(abs_top_srcdir)/mkbc $< $@
+	gcc -E - < $< | $(abs_top_srcdir)/mkbc - $@
 
 # Link ports sources into tree
 stamps/ports.stamp: stamps/replace-hotspot.stamp
diff -r 738d06e2778e -r b7e6ccea40d4 mkbc.c
--- a/mkbc.c	Thu Sep 10 16:31:56 2009 -0400
+++ b/mkbc.c	Fri Sep 11 14:12:15 2009 +0100
@@ -1,3 +1,17 @@
+/*
+ * Copyright 2009 Edward Nevill
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ */
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -10,7 +24,7 @@ static char *prefix = DEFAULT_PREFIX;
 #define ISALPHA(c) (isalpha(c) || (c) == '_')
 #define ISALNUM(c) (isalnum(c) || (c) == '_')
 
-FILE *source_f, *bci_f, *bci_f;
+FILE *source_f, *bci_f;
 
 typedef struct Bytecode {
 	char	*name;
@@ -282,7 +296,7 @@ void mkbc(void)
 	c = (readchar)();
 	c = skipwhitespace(c);
 	while (c != EOF) {
-		if (c == '#') {
+		if (c == '@' || c == '#') {
 			c = skipeol(c);
 		} else if (ISALPHA(c)) {
 			c = readsymbol(c, buf, BUFLEN);
@@ -546,7 +560,7 @@ int main(int argc, char **argv)
 
 	source = bci = 0;
 	while (s = *++argv) {
-		if (*s == '-') {
+		if (s[0] == '-' && s[1] != 0) {
 			if (s[1] == 'P') {
 				prefix = s+2;
 			} else {
@@ -566,16 +580,26 @@ int main(int argc, char **argv)
 		fprintf(stderr, "Too few arguments\n");
 		usage();
 	}
-	source_f = fopen(source, "r");
-	if (!source_f) fatal("Error opening source file");
-	bci_f = fopen(bci, "w");
-	if (!bci_f) fatal("Error opening bci file for write");
+	if (strcmp(source, "-") == 0) {
+		source_f = stdin;
+	} else {
+		source_f = fopen(source, "r");
+		if (!source_f) fatal("Error opening source file");
+	}
+	if (strcmp(bci, "-") == 0) {
+		bci_f = stdout;
+	} else {
+		bci_f = fopen(bci, "w");
+		if (!bci_f) fatal("Error opening bci file for write");
+	}
 	for (i = 0; i < 256; i++) {
 		bytecodes[i].name = "undefined";
 		bytecodes[i].len = -1;
 	}
 	mkbc();
 	dumpbc();
-	if (fclose(source_f)) fatal("Error reading source");
-	if (fclose(bci_f)) fatal("Error writing bci");
-}
+	if (ferror(source_f)) fatal("Error reading source");
+	if (ferror(bci_f)) fatal("Error writing bci");
+	if (source_f != stdin) fclose(source_f);
+	if (bci_f != stdout) fclose(bci_f);
+}
diff -r 738d06e2778e -r b7e6ccea40d4 ports/hotspot/build/linux/makefiles/zero.make
--- a/ports/hotspot/build/linux/makefiles/zero.make	Thu Sep 10 16:31:56 2009 -0400
+++ b/ports/hotspot/build/linux/makefiles/zero.make	Fri Sep 11 14:12:15 2009 +0100
@@ -24,12 +24,28 @@
 #
 
 ifeq ($(ZERO_LIBARCH),arm)
+
+Obj_Files += asm_helper.o
 Obj_Files += cppInterpreter_arm.o
-CFLAGS += -DHOTSPOT_ASM -DHW_NULL_PTR_CHECK
+
+CFLAGS += -DHOTSPOT_ASM
+
 %.o: %.S
 	@echo Assembling $<
 	$(QUIETLY) $(REMOVE_TARGET)
 	$(COMPILE.CC) -o $@ $< $(COMPILE_DONE)
+
+cppInterpreter_arm.o:	offsets_arm.s
+
+offsets_arm.s:	mkoffsets
+	@echo Generating assembler offsets
+	./mkoffsets > $@
+
+mkoffsets:	asm_helper.cpp
+	@echo Compiling offset generator
+	$(QUIETLY) $(REMOVE_TARGET)
+	$(CC_COMPILE) -DSTATIC_OFFSETS -o $@ $< $(COMPILE_DONE)
+
 endif
 
 # The copied fdlibm routines in sharedRuntimeTrig.o must not be optimized
diff -r 738d06e2778e -r b7e6ccea40d4 ports/hotspot/src/cpu/zero/vm/bytecodes_arm.def
--- a/ports/hotspot/src/cpu/zero/vm/bytecodes_arm.def	Thu Sep 10 16:31:56 2009 -0400
+++ b/ports/hotspot/src/cpu/zero/vm/bytecodes_arm.def	Fri Sep 11 14:12:15 2009 +0100
@@ -1,3 +1,13 @@ nop                  = 0x00, 1
+#ifndef DISABLE_HW_FP
+#define HW_FP
+#endif
+#ifndef DISABLE_NOTICE_SAFEPOINTS
+#define NOTICE_SAFEPOINTS
+#endif
+#ifndef DISABLE_FAST_BYTECODES
+#define FAST_BYTECODES
+#endif
+
 nop                  = 0x00, 1
 aconst_null          = 0x01, 1
 iconst_m1            = 0x02, 1
@@ -201,11 +211,13 @@ jsr_w                = 0xc9, 0
 jsr_w                = 0xc9, 0
 breakpoint           = 0xca, 0
 
-#agetfield	= 0xcb, 3
+#ifdef FAST_BYTECODES
+
+ at agetfield	= 0xcb, 3
 bgetfield	= 0xcc, 3
 cgetfield	= 0xcd, 3
-#dgetfield	= 0xce, 3
-#fgetfield	= 0xcf, 3
+ at dgetfield	= 0xce, 3
+ at fgetfield	= 0xcf, 3
 igetfield	= 0xd0, 3
 lgetfield	= 0xd1, 3
 sgetfield	= 0xd2, 3
@@ -213,45 +225,56 @@ aputfield	= 0xd3, 3
 aputfield	= 0xd3, 3
 bputfield	= 0xd4, 3
 cputfield	= 0xd5, 3
-#dputfield	= 0xd6, 3
-#fputfield	= 0xd7, 3
+ at dputfield	= 0xd6, 3
+ at fputfield	= 0xd7, 3
 iputfield	= 0xd8, 3
 lputfield	= 0xd9, 3
-#sputfield	= 0xda, 3
+ at sputfield	= 0xda, 3
 
 iaccess_0	= 0xdb, 4
 iaccess_1	= 0xdc, 4
 iaccess_2	= 0xdd, 4
 iaccess_3	= 0xde, 4
 
-#fast_iload	= 0xdf, 2
-#fast_iload2	= 0xe0, 4
-#fast_icaload	= 0xe1, 3
-
-invokevfinal 	= 0xe2, 3
-#linearswitch 	= 0xe3, 0
-#binaryswitch 	= 0xe4, 0
-
-iload_0_iconst_N        = 231, 2
-iload_1_iconst_N        = 232, 2
-iload_2_iconst_N        = 233, 2
-iload_3_iconst_N        = 234, 2
-iload_iconst_N          = 235, 3
-invokeresolved          = 236, 3
-iadd_istore_N		= 237, 2
-isub_istore_N		= 238, 2
-iand_istore_N		= 239, 2
-ior_istore_N		= 240, 2
-ixor_istore_N		= 241, 2
-iadd_u4store		= 242, 3
-isub_u4store		= 243, 3
-iand_u4store		= 244, 3
-ior_u4store		= 245, 3
-ixor_u4store		= 246, 3
-invokespecialresolved	= 247, 3
-invokestaticresolved	= 248, 3
-
-return_register_finalizer = 229, 0
+invokeresolved		= 0xdf, 3
+invokespecialresolved	= 0xe0, 3
+invokestaticresolved	= 0xe1, 3
+invokevfinal 		= 0xe2, 3
+
+iload_iload	= 0xe3, 4
+iload_iload_N	= 0xe4, 3
+
+ at return_register_finalizer = 0xe5, 1
+
+dmac			= 0xe6, 2
+
+iload_0_iconst_N        = 0xe7, 2
+iload_1_iconst_N        = 0xe8, 2
+iload_2_iconst_N        = 0xe9, 2
+iload_3_iconst_N        = 0xea, 2
+iload_iconst_N          = 0xeb, 3
+iadd_istore_N		= 0xec, 2
+isub_istore_N		= 0xed, 2
+iand_istore_N		= 0xee, 2
+ior_istore_N		= 0xef, 2
+ixor_istore_N		= 0xf0, 2
+iadd_u4store		= 0xf1, 3
+isub_u4store		= 0xf2, 3
+iand_u4store		= 0xf3, 3
+ior_u4store		= 0xf4, 3
+ixor_u4store		= 0xf5, 3
+iload_0_iload		= 0xf6, 3
+iload_1_iload		= 0xf7, 3
+iload_2_iload		= 0xf8, 3
+iload_3_iload		= 0xf9, 3
+iload_0_iload_N		= 0xfa, 2
+iload_1_iload_N		= 0xfb, 2
+iload_2_iload_N		= 0xfc, 2
+iload_3_iload_N		= 0xfd, 2
+
+#endif // FAST_BYTECODES
+
+return_register_finalizer = 0xe5, 1
 
 (nop) {
 	DISPATCH	\seq_len
@@ -292,7 +315,7 @@ return_register_finalizer = 229, 0
 	DISPATCH_NEXT
 	DISPATCH_NEXT
 	DISPATCH_NEXT
-	PUSH2	tmp2, tmp1
+	PUSH	tmp2, tmp1
 	DISPATCH_FINISH
 }
 
@@ -321,7 +344,7 @@ return_register_finalizer = 229, 0
         mov     tmp2, #0
 	DISPATCH_NEXT
 	DISPATCH_NEXT
-	PUSH2	tmp2, tmp1
+	PUSH	tmp2, tmp1
 	DISPATCH_FINISH
 }
 
@@ -337,8 +360,8 @@ return_register_finalizer = 229, 0
 	DISPATCH_FINISH
 }
 
-# r2 = [jpc, #1]
-# r1 = [jpc, #2]
+@ r2 = [jpc, #1]
+@ r1 = [jpc, #2]
 (sipush) sipush {
 	DISPATCH_START	\seq_len
 	mov	tmp1, r1
@@ -352,7 +375,7 @@ return_register_finalizer = 229, 0
 	DISPATCH_FINISH
 }
 
-# r2 = [jpc, #1]
+@ r2 = [jpc, #1]
 (iload,fload,aload) u4load {
 	DISPATCH_START	\seq_len
 	rsb	tmp1, r2, #0
@@ -365,7 +388,7 @@ return_register_finalizer = 229, 0
 	DISPATCH_FINISH
 }
 
-# r2 = [jpc, #1]
+@ r2 = [jpc, #1]
 (lload,dload) u8load {
 	DISPATCH_START	\seq_len
 	sub	r3, locals, r2, lsl #2
@@ -374,7 +397,7 @@ return_register_finalizer = 229, 0
 	DISPATCH_NEXT
 	DISPATCH_NEXT
 	DISPATCH_NEXT
-	PUSH2	tmp2, tmp1
+	PUSH	tmp2, tmp1
 	DISPATCH_FINISH
 }
 
@@ -446,7 +469,7 @@ return_register_finalizer = 229, 0
 	DISPATCH_NEXT
 	DISPATCH_NEXT
 	DISPATCH_NEXT
-	PUSH2	tmp2, tmp1
+	PUSH	tmp2, tmp1
 	DISPATCH_FINISH
 }
 
@@ -458,17 +481,15 @@ return_register_finalizer = 229, 0
 	DISPATCH_NEXT
 	DISPATCH_NEXT
 	DISPATCH_NEXT
-	PUSH2	tmp2, tmp1
+	PUSH	tmp2, tmp1
 	DISPATCH_FINISH
 }
 
 (iaload,faload,aaload) u4aload {
-	POP2	r2, r3			@ r2 = index, r3 = arrayref
-	DISPATCH_START	\seq_len
-#ifndef HW_NULL_PTR_CHECK
-	cmp	r3, #0
-	beq	null_ptr_exception_jpc_1
-#endif
+	POP	r2, r3			@ r2 = index, r3 = arrayref
+	DISPATCH_START	\seq_len
+	SW_NPC	cmp	r3, #0
+	SW_NPC	beq	null_ptr_exception_jpc_1
 .abortentry5:
 	ldr	lr, [r3, #8]		@ lr = length
 	DISPATCH_NEXT
@@ -484,12 +505,10 @@ return_register_finalizer = 229, 0
 }
 
 (laload,daload) u8aload {
-	POP2	r2, r3
-	DISPATCH_START	\seq_len
-#ifndef HW_NULL_PTR_CHECK
-	cmp	r3, #0
-	beq	null_ptr_exception_jpc_1
-#endif
+	POP	r2, r3
+	DISPATCH_START	\seq_len
+	SW_NPC	cmp	r3, #0
+	SW_NPC	beq	null_ptr_exception_jpc_1
 .abortentry6:
 	ldr	lr, [r3, #8]		@ lr = length
 	DISPATCH_NEXT
@@ -501,17 +520,15 @@ return_register_finalizer = 229, 0
 	DISPATCH_NEXT
 	ldr	tmp1, [r3, #20]
 	DISPATCH_NEXT
-	PUSH2	tmp2, tmp1
+	PUSH	tmp2, tmp1
 	DISPATCH_FINISH
 }
 
 (baload) baload {
-	POP2	r2, r3			@ r2 = index, r3 = arrayref
-	DISPATCH_START	\seq_len
-#ifndef HW_NULL_PTR_CHECK
-	cmp	r3, #0
-	beq	null_ptr_exception_jpc_1
-#endif
+	POP	r2, r3			@ r2 = index, r3 = arrayref
+	DISPATCH_START	\seq_len
+	SW_NPC	cmp	r3, #0
+	SW_NPC	beq	null_ptr_exception_jpc_1
 .abortentry7:
 	ldr	lr, [r3, #8]		@ lr = length
 	DISPATCH_NEXT
@@ -527,12 +544,10 @@ return_register_finalizer = 229, 0
 }
 
 (caload) caload {
-	POP2	r2, r3			@ r2 = index, r3 = arrayref
-	DISPATCH_START	\seq_len
-#ifndef HW_NULL_PTR_CHECK
-	cmp	r3, #0
-	beq	null_ptr_exception_jpc_1
-#endif
+	POP	r2, r3			@ r2 = index, r3 = arrayref
+	DISPATCH_START	\seq_len
+	SW_NPC	cmp	r3, #0
+	SW_NPC	beq	null_ptr_exception_jpc_1
 .abortentry8:
 	ldr	lr, [r3, #8]		@ lr = length
 	DISPATCH_NEXT
@@ -548,12 +563,10 @@ return_register_finalizer = 229, 0
 }
 
 (saload) saload {
-	POP2	r2, r3			@ r2 = index, r3 = arrayref
-	DISPATCH_START	\seq_len
-#ifndef HW_NULL_PTR_CHECK
-	cmp	r3, #0
-	beq	null_ptr_exception_jpc_1
-#endif
+	POP	r2, r3			@ r2 = index, r3 = arrayref
+	DISPATCH_START	\seq_len
+	SW_NPC	cmp	r3, #0
+	SW_NPC	beq	null_ptr_exception_jpc_1
 .abortentry9:
 	ldr	lr, [r3, #8]		@ lr = length
 	DISPATCH_NEXT
@@ -568,7 +581,7 @@ return_register_finalizer = 229, 0
 	DISPATCH_FINISH
 }
 
-# r2 = [jpc, #1]
+@ r2 = [jpc, #1]
 (astore,istore,fstore) u4store {
 	DISPATCH_START	\seq_len
 	rsb	tmp1, r2, #0
@@ -581,10 +594,10 @@ return_register_finalizer = 229, 0
 	DISPATCH_FINISH
 }
 
-# r2 = [jpc, #1]
+@ r2 = [jpc, #1]
 (lstore,dstore) u8store {
 	DISPATCH_START	\seq_len
-	POP2	tmp2, tmp1
+	POP	tmp2, tmp1
 	DISPATCH_NEXT
 	sub	r3, locals, r2, lsl #2
 	DISPATCH_NEXT
@@ -641,7 +654,7 @@ return_register_finalizer = 229, 0
 (lstore_0,dstore_0) u8store_0 {
 	DISPATCH_START	\seq_len
 	DISPATCH_NEXT
-	POP2	tmp2, tmp1
+	POP	tmp2, tmp1
 	DISPATCH_NEXT
 	DISPATCH_NEXT
 	DISPATCH_NEXT
@@ -652,7 +665,7 @@ return_register_finalizer = 229, 0
 (lstore_1,dstore_1) u8store_1 {
 	DISPATCH_START	\seq_len
 	DISPATCH_NEXT
-	POP2	tmp2, tmp1
+	POP	tmp2, tmp1
 	DISPATCH_NEXT
 	DISPATCH_NEXT
 	DISPATCH_NEXT
@@ -662,7 +675,7 @@ return_register_finalizer = 229, 0
 
 (lstore_2,dstore_2) u8store_2 {
 	DISPATCH_START	\seq_len
-	POP2	tmp2, tmp1
+	POP	tmp2, tmp1
 	DISPATCH_NEXT
         str     tmp2, [locals, #-12]
 	DISPATCH_NEXT
@@ -674,7 +687,7 @@ return_register_finalizer = 229, 0



More information about the distro-pkg-dev mailing list