ARM: Support for OpenJDK 7

Andrew Hughes ahughes at redhat.com
Thu Mar 15 16:24:54 PDT 2012


----- Original Message -----
> This time, without word wrap.
> 
> This is in three parts:
> 
> 1.  Copy files from IcedTea 6's arm_port to the to the
>     icedtea7-forest-2.1 branch.  It has to be the 2.1 branch because
>     Zero doesn't work on later HotSpot releases, and won't for some
>     time to com.
> 
> 2.  Apply ARM patches from IcedTea 6.
> 
> 3.  Make a few changes for HSX 22, as below.
> 
> After this I don't propose to contine working on IcedTea 6.  Apart
> from bug fixes, the ARM port will be frozen.
> 

This sounds good to me and I'm glad to see it going in 7.  I approve 1 & 2
for the 2.1 branch as they're present in 6 anyway.  I'll leave someone more
knowledge to comment on and approve the ARM ports of 3.  The gcc.make changes
look fine and I'd like to see these go upstream ASAP.  They could at least
go in IcedTea7 HEAD and 2.0 immediately.

>From what I remember of the ARM port in IcedTea6, the mere presence of the ARM
source files is enough to have them compiled, without additional build work.  Is
this correct?

> Andrew.
> 
> 2012-03-15  Andrew Haley  <aph at redhat.com>
> 
>         * src/cpu/zero/vm/thumb2.cpp: Update copyright.
>         Constify various jbyte* pointers.
>         Use a Symbol, not a symbolOopDesc.
>         * src/cpu/zero/vm/cppInterpreter_arm.S (asm_method_table):
>         Add
>         implementation of java.lang.ref.Reference.get().
>         * src/cpu/zero/vm/asm_helper.cpp: Update copyright.
>         (klass_at_addr): Fix indentation.
>         (Helper_Raise): use a Symbol, not a symbolOopDesc.
> 
>         * gcc.make (FASTDEBUG_CFLAGS): Add zero.
>         (OPT_CFLAGS): Likewise.
> 
> # HG changeset patch
> # User aph
> # Date 1331816821 14400
> # Node ID 30c4dc24823a73138a55de5bb152f9b688bb859b
> # Parent  065df7302cf5b31fa9fbf76e464030f80de2d4a2
> Changes for HSX22
> 
> diff -r 065df7302cf5 -r 30c4dc24823a make/linux/makefiles/gcc.make
> --- a/make/linux/makefiles/gcc.make	Thu Mar 15 08:54:12 2012 -0400
> +++ b/make/linux/makefiles/gcc.make	Thu Mar 15 09:07:01 2012 -0400
> @@ -249,6 +249,7 @@
>    FASTDEBUG_CFLAGS/amd64 = -g
>    FASTDEBUG_CFLAGS/arm   = -g
>    FASTDEBUG_CFLAGS/ppc   = -g
> +  FASTDEBUG_CFLAGS/zero  = -g
>    FASTDEBUG_CFLAGS += $(DEBUG_CFLAGS/$(BUILDARCH))
>    ifeq ($(FASTDEBUG_CFLAGS/$(BUILDARCH)),)
>      FASTDEBUG_CFLAGS += -gstabs
> @@ -258,6 +259,7 @@
>    OPT_CFLAGS/amd64 = -g
>    OPT_CFLAGS/arm   = -g
>    OPT_CFLAGS/ppc   = -g
> +  OPT_CFLAGS/zero  = -g
>    OPT_CFLAGS += $(OPT_CFLAGS/$(BUILDARCH))
>    ifeq ($(OPT_CFLAGS/$(BUILDARCH)),)
>      OPT_CFLAGS += -gstabs
> diff -r 065df7302cf5 -r 30c4dc24823a src/cpu/zero/vm/asm_helper.cpp
> --- a/src/cpu/zero/vm/asm_helper.cpp	Thu Mar 15 08:54:12 2012 -0400
> +++ b/src/cpu/zero/vm/asm_helper.cpp	Thu Mar 15 09:07:01 2012 -0400
> @@ -1,5 +1,6 @@
>  /*
>   * Copyright 2009, 2010 Edward Nevill
> + * Copyright 2011, Red Hat
>   *
>   * 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
> @@ -118,9 +119,9 @@
>   class VMStructs {
>  public:
> -	static inline klassOop klass_at_addr(constantPoolOop constants, u2
> index) {
> -	  return (klassOop) *constants->obj_at_addr(index);
> -	}
> +  static inline klassOop klass_at_addr(constantPoolOop constants, u2
> index) {
> +    return (klassOop) *constants->obj_at_addr_raw(index);
> +  }
>  };
>   extern "C" oop Helper_new(interpreterState istate, unsigned index)
> @@ -314,7 +315,7 @@
>    }
>  }
>  -extern "C" void Helper_Raise(JavaThread *thread, symbolOopDesc
>  *name, char const *msg)
> +extern "C" void Helper_Raise(JavaThread *thread, Symbol *name, char
> const *msg)
>  {
>     ThreadInVMfromJava trans(thread);
>     Exceptions::_throw_msg(thread, "[Bytecoce Interpreter]", 99,
>     name, msg);
> diff -r 065df7302cf5 -r 30c4dc24823a
> src/cpu/zero/vm/cppInterpreter_arm.S
> --- a/src/cpu/zero/vm/cppInterpreter_arm.S	Thu Mar 15 08:54:12 2012
> -0400
> +++ b/src/cpu/zero/vm/cppInterpreter_arm.S	Thu Mar 15 09:07:01 2012
> -0400
> @@ -1,6 +1,7 @@
>  #ifdef __arm__
>   @ Copyright 2009, 2010 Edward Nevill
> +@ Copyright 2012, Red Hat
>  @ DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
>  @
>  @ This code is free software; you can redistribute it and/or modify
>  it
> @@ -809,6 +810,7 @@
>          .word   normal_entry                    // implementation of
>          java.lang.Math.sqrt  (x)
>          .word   normal_entry                    // implementation of
>          java.lang.Math.log   (x)
>          .word   normal_entry                    // implementation of
>          java.lang.Math.log10 (x)
> +        .word   accessor_entry                  // implementation of
> java.lang.ref.Reference.get()
>  3:
>  	
>  	ALIGN_CODE
> @@ -7093,7 +7095,7 @@
>  CompileThreshold_Address:                               .word   0
>  InterpreterInvocationLimit_Address:			.word	0
>  UseCompiler_Address:					.word	0
> -can_post_interpreter_events:				.word	0
> +can_post_interpreter_events:				.word	0
>  PrintCommandLineFlags_Address:				.word	0
>  oopDesc_Address:					.word	0
>  ThreadLocalStorage_thread_index:			.word	0
> diff -r 065df7302cf5 -r 30c4dc24823a src/cpu/zero/vm/thumb2.cpp
> --- a/src/cpu/zero/vm/thumb2.cpp	Thu Mar 15 08:54:12 2012 -0400
> +++ b/src/cpu/zero/vm/thumb2.cpp	Thu Mar 15 09:07:01 2012 -0400
> @@ -1,5 +1,6 @@
>  /*
>   * Copyright 2009, 2010 Edward Nevill
> + * Copyright 2012, Red Hat
>   *
>   * 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
> @@ -649,7 +650,7 @@
>  void Thumb2_save_locals(Thumb2_Info *jinfo, unsigned stackdepth);
>  void Thumb2_restore_locals(Thumb2_Info *jinfo, unsigned stackdepth);
>  -static int method_stackchange(jbyte *base)
> +static int method_stackchange(const jbyte *base)
>  {
>    jbyte c;
>    int stackchange = 0;
> @@ -680,7 +681,8 @@
>    return stackchange;
>  }
>  -static void Thumb2_local_info_from_sig(Thumb2_Info *jinfo,
>  methodOop method, jbyte *base)
> +static void Thumb2_local_info_from_sig(Thumb2_Info *jinfo, methodOop
> method,
> +				       const jbyte *base)
>  {
>    jbyte c;
>    unsigned arg = 0;
> @@ -1784,8 +1786,8 @@
>        case opc_putfield: {
>  	int index = GET_NATIVE_U2(code_base+bci+1);
>  	constantPoolOop pool = jinfo->method->constants();
> -	symbolOop sig = pool->signature_ref_at(index);
> -	jbyte *base = sig->base();
> +	Symbol *sig = pool->signature_ref_at(index);
> +	const jbyte *base = sig->base();
>  	jbyte c = *base;
>  	int stackchange;
>  @@ -1812,9 +1814,8 @@
>        case opc_invokestatic: {
>  	int index = GET_NATIVE_U2(code_base+bci+1);
>  	constantPoolOop pool = jinfo->method->constants();
> -	//symbolOop name = pool->name_ref_at(index);
> -	symbolOop sig = pool->signature_ref_at(index);
> -	jbyte *base = sig->base();
> +	Symbol *sig = pool->signature_ref_at(index);
> +	const jbyte *base = sig->base();
>   	//tty->print("%d: %s: %s\n", opcode, name->as_C_string(),
>   	sig->as_C_string());
>  	stackdepth += method_stackchange(base);
> @@ -6005,8 +6006,8 @@
>          if (!cache->is_resolved((Bytecodes::Code)opcode)) {
>   	  int java_index = GET_NATIVE_U2(code_base+bci+1);
>  	  constantPoolOop pool = jinfo->method->constants();
> -	  symbolOop sig = pool->signature_ref_at(java_index);
> -	  jbyte *base = sig->base();
> +	  Symbol *sig = pool->signature_ref_at(java_index);
> +	  const jbyte *base = sig->base();
>  	  jbyte c = *base;
>  	  int handler = H_GETFIELD_WORD;
>  @@ -6073,8 +6074,8 @@
>          if (!cache->is_resolved((Bytecodes::Code)opcode)) {
>  	  int java_index = GET_NATIVE_U2(code_base+bci+1);
>  	  constantPoolOop pool = jinfo->method->constants();
> -	  symbolOop sig = pool->signature_ref_at(java_index);
> -	  jbyte *base = sig->base();
> +	  Symbol *sig = pool->signature_ref_at(java_index);
> +	  const jbyte *base = sig->base();
>  	  jbyte c = *base;
>  	  int handler = H_GETSTATIC_WORD;
>  @@ -6138,8 +6139,8 @@
>          if (!cache->is_resolved((Bytecodes::Code)opcode)) {
>  	  int java_index = GET_NATIVE_U2(code_base+bci+1);
>  	  constantPoolOop pool = jinfo->method->constants();
> -	  symbolOop sig = pool->signature_ref_at(java_index);
> -	  jbyte *base = sig->base();
> +	  Symbol *sig = pool->signature_ref_at(java_index);
> +	  const jbyte *base = sig->base();
>  	  jbyte c = *base;
>  	  int handler = H_PUTFIELD_WORD;
>  @@ -6204,8 +6205,8 @@
>          if (!cache->is_resolved((Bytecodes::Code)opcode)) {
>  	  int java_index = GET_NATIVE_U2(code_base+bci+1);
>  	  constantPoolOop pool = jinfo->method->constants();
> -	  symbolOop sig = pool->signature_ref_at(java_index);
> -	  jbyte *base = sig->base();
> +	  Symbol *sig = pool->signature_ref_at(java_index);
> +	  const jbyte *base = sig->base();
>  	  jbyte c = *base;
>  	  int handler = H_PUTSTATIC_WORD;
>  @@ -7300,9 +7301,9 @@
>    HandleMark __hm(thread);
>    frame fr = thread->last_frame();
>    methodOop method = fr.interpreter_frame_method();
> -  symbolOop name = method->name();
> -  symbolOop sig = method->signature();
> -  jbyte *base = sig->base();;
> +  Symbol *name = method->name();
> +  Symbol *sig = method->signature();
> +  const jbyte *base = sig->base();
>     jubyte *code_base = (jubyte *)method->code_base();
>    int code_size = method->code_size();
> 

-- 
Andrew :)

Free Java Software Engineer
Red Hat, Inc. (http://www.redhat.com)

PGP Key: 248BDC07 (https://keys.indymedia.org/)
Fingerprint = EC5A 1F5E C0AD 1D15 8F1F  8F91 3B96 A578 248B DC07




More information about the distro-pkg-dev mailing list