« Return to Thread: Re: [rvm-core] [rvm-commits] SF.net SVN: jikesrvm:[15318] rvmroot/trunk

Re: [rvm-core] [rvm-commits] SF.net SVN: jikesrvm:[15318] rvmroot/trunk

by Steve Blackburn :: Rate this Message:

Reply to Author | View in Thread

Hi Ian,

Can explain to us what you were trying to do with r15318?   The commit  
message says "fix typos", I assume that was a mistake on your part  
because the commit doesn't seem to have a lot to do with typos.  A  
bunch of other things are going on in there which appear significant  
and that affect others:

1. A bunch of methods are now explicitly inlined.   I'm guessing  
you've done this to try to address the problems with compress that  
were due to an unrelated change (I noticed that after 15318 the  
longstanding compress bug, RVM-743, suddenly went away).  In any case,  
can you please explain what you've done and why.  If it is a targeted  
fix for RVM-743 it would be cool to understand why.  On a related  
note, Dave has been (justifiably) goading me to remove explicit  
inlines from MMTk for a long time now.   We really don't want to add  
new ones unless there's a strong story.

2. Write barriers appear to have had their parameters shuffled.  Some  
of us depend critically on this code, so it would be great if you  
could explain this change for the rest of us.

Thanks,

--Steve

On 31/01/2009, at 2:21 AM, captain5050@... wrote:

> Revision: 15318
>          http://jikesrvm.svn.sourceforge.net/jikesrvm/?rev=15318&view=rev
> Author:   captain5050
> Date:     2009-01-30 15:21:00 +0000 (Fri, 30 Jan 2009)
>
> Log Message:
> -----------
> Fix typos
>
> Modified Paths:
> --------------
>    rvmroot/trunk/MMTk/src/org/mmtk/utility/Constants.java
>    rvmroot/trunk/rvm/src/org/jikesrvm/Services.java
>    rvmroot/trunk/rvm/src/org/jikesrvm/classloader/RVMField.java
>    rvmroot/trunk/rvm/src/org/jikesrvm/compilers/baseline/
> BaselineCompiler.java
>    rvmroot/trunk/rvm/src/org/jikesrvm/compilers/baseline/ia32/
> Barriers.java
>    rvmroot/trunk/rvm/src/org/jikesrvm/compilers/baseline/ia32/
> BaselineCompilerImpl.java
>    rvmroot/trunk/rvm/src/org/jikesrvm/compilers/baseline/ppc/
> Barriers.java
>    rvmroot/trunk/rvm/src/org/jikesrvm/compilers/baseline/ppc/
> BaselineCompilerImpl.java
>    rvmroot/trunk/rvm/src/org/jikesrvm/compilers/opt/hir2lir/
> ExpandRuntimeServices.java
>    rvmroot/trunk/rvm/src/org/jikesrvm/mm/mminterface/
> MemoryManager.java
>    rvmroot/trunk/rvm/src/org/jikesrvm/runtime/Entrypoints.java
>    rvmroot/trunk/rvm/src/org/jikesrvm/runtime/RuntimeEntrypoints.java
>    rvmroot/trunk/rvm/src/org/jikesrvm/runtime/Statics.java
>
> Modified: rvmroot/trunk/MMTk/src/org/mmtk/utility/Constants.java
> ===================================================================
> --- rvmroot/trunk/MMTk/src/org/mmtk/utility/Constants.java
> 2009-01-30 05:45:18 UTC (rev 15317)
> +++ rvmroot/trunk/MMTk/src/org/mmtk/utility/Constants.java
> 2009-01-30 15:21:00 UTC (rev 15318)
> @@ -74,7 +74,7 @@
>    *
>    * Java-specific sizes currently required by MMTk
>    *
> -   * TODO MMTk should really become independant of these Java types
> +   * TODO MMTk should really become independent of these Java types
>    */
>   byte LOG_BYTES_IN_SHORT = 1;
>   int BYTES_IN_SHORT = 1 << LOG_BYTES_IN_SHORT;
>
> Modified: rvmroot/trunk/rvm/src/org/jikesrvm/Services.java
> ===================================================================
> --- rvmroot/trunk/rvm/src/org/jikesrvm/Services.java 2009-01-30  
> 05:45:18 UTC (rev 15317)
> +++ rvmroot/trunk/rvm/src/org/jikesrvm/Services.java 2009-01-30  
> 15:21:00 UTC (rev 15318)
> @@ -17,6 +17,7 @@
> import org.jikesrvm.runtime.Entrypoints;
> import org.jikesrvm.runtime.Magic;
> import org.jikesrvm.scheduler.Synchronization;
> +import org.vmmagic.pragma.Inline;
> import org.vmmagic.pragma.Interruptible;
> import org.vmmagic.pragma.NoInline;
> import org.vmmagic.pragma.Uninterruptible;
> @@ -327,12 +328,14 @@
>
>   /**
>    * Sets an element of a object array without possibly losing  
> control.
> +   * NB doesn't perform checkstore or array index checking.
>    *
>    * @param dst the destination array
>    * @param index the index of the element to set
>    * @param value the new value for the element
>    */
>   @UninterruptibleNoWarn("Interruptible code not reachable at  
> runtime")
> +  @Inline
>   public static void setArrayUninterruptible(Object[] dst, int  
> index, Object value) {
>     if (VM.runningVM) {
>       if (MemoryManagerConstants.NEEDS_WRITE_BARRIER) {
>
> Modified: rvmroot/trunk/rvm/src/org/jikesrvm/classloader/RVMField.java
> ===================================================================
> --- rvmroot/trunk/rvm/src/org/jikesrvm/classloader/RVMField.java
> 2009-01-30 05:45:18 UTC (rev 15317)
> +++ rvmroot/trunk/rvm/src/org/jikesrvm/classloader/RVMField.java
> 2009-01-30 15:21:00 UTC (rev 15318)
> @@ -391,13 +391,13 @@
>   public void setObjectValueUnchecked(Object obj, Object ref) {
>     if (isStatic()) {
>       if (MemoryManagerConstants.NEEDS_PUTSTATIC_WRITE_BARRIER && !
> isUntraced()) {
> -        MemoryManager.putstaticWriteBarrier(getOffset(), ref,  
> getId());
> +        MemoryManager.putstaticWriteBarrier(ref, getOffset(),  
> getId());
>       } else {
>         Statics.setSlotContents(getOffset(), ref);
>       }
>     } else {
>       if (MemoryManagerConstants.NEEDS_WRITE_BARRIER && !
> isUntraced()) {
> -        MemoryManager.putfieldWriteBarrier(obj, getOffset(), ref,  
> getId());
> +        MemoryManager.putfieldWriteBarrier(obj, ref, getOffset(),  
> getId());
>       } else {
>         Magic.setObjectAtOffset(obj, getOffset(), ref);
>       }
>
> Modified: rvmroot/trunk/rvm/src/org/jikesrvm/compilers/baseline/
> BaselineCompiler.java
> ===================================================================
> --- rvmroot/trunk/rvm/src/org/jikesrvm/compilers/baseline/
> BaselineCompiler.java 2009-01-30 05:45:18 UTC (rev 15317)
> +++ rvmroot/trunk/rvm/src/org/jikesrvm/compilers/baseline/
> BaselineCompiler.java 2009-01-30 15:21:00 UTC (rev 15318)
> @@ -102,7 +102,7 @@
>     // of method to print option so extra classes needed to process
>     // matching will be loaded and compiled upfront. Thus avoiding  
> getting
>     // stuck looping by just asking if we have a match in the middle  
> of
> -    // compilation. Pick an obsure string for the check.
> +    // compilation. Pick an obscure string for the check.
>     if (options.hasMETHOD_TO_PRINT() &&  
> options.fuzzyMatchMETHOD_TO_PRINT("???")) {
>       VM.sysWrite("??? is not a sensible string to specify for  
> method name");
>     }
> @@ -204,8 +204,8 @@
>     /* reference map and stackheights were computed using original  
> bytecodes
>      * and possibly new operand words
>      * recompute the stack height, but keep the operand words of the  
> code
> -     * generation consistant with reference map
> -     * TODO: revist this code as part of OSR redesign
> +     * generation consistent with reference map
> +     * TODO: revisit this code as part of OSR redesign
>      */
>     // Phase 2: OSR setup\
>     boolean edge_counters = options.EDGE_COUNTERS;
>
> Modified: rvmroot/trunk/rvm/src/org/jikesrvm/compilers/baseline/ia32/
> Barriers.java
> ===================================================================
> --- rvmroot/trunk/rvm/src/org/jikesrvm/compilers/baseline/ia32/
> Barriers.java 2009-01-30 05:45:18 UTC (rev 15317)
> +++ rvmroot/trunk/rvm/src/org/jikesrvm/compilers/baseline/ia32/
> Barriers.java 2009-01-30 15:21:00 UTC (rev 15318)
> @@ -19,6 +19,7 @@
> import org.jikesrvm.runtime.Entrypoints;
> import org.jikesrvm.runtime.Magic;
> import org.vmmagic.unboxed.Offset;
> +import org.vmmagic.pragma.Inline;
>
> /**
>  * Class called from baseline compiler to generate architecture  
> specific
> @@ -28,64 +29,57 @@
> class Barriers implements BaselineConstants {
>
>   /**
> -   * Generate code to perform an array store barrier
> +   * Generate code to perform an array store barrier. On entry the  
> stack holds:
> +   * arrayRef, index, value.
>    *
>    * @param asm the assembler to generate the code in
>    * @param ref the register holding the array reference
>    * @param index the register holding index into the array
>    * @param value the register holding the value to store
>    */
> -  static void compileArrayStoreBarrier(Assembler asm, GPR ref, GPR  
> index, GPR value) {
> -    asm.emitPUSH_Reg(ref);
> -    asm.emitPUSH_Reg(index);
> -    asm.emitPUSH_Reg(value);
> +  static void compileArrayStoreBarrier(Assembler asm) {
>     BaselineCompilerImpl.genParameterRegisterLoad(asm, 3);
> -    
> asm
> .emitCALL_Abs
> (Magic
> .getTocPointer
> ().plus(Entrypoints.arrayStoreWriteBarrierMethod.getOffset()));
> +    
> asm
> .emitCALL_Abs
> (Magic.getTocPointer().plus(Entrypoints.aastoreMethod.getOffset()));
>   }
>
>   /**
> -   * Generate code to perform a putfield barrier
> +   * Generate code to perform a putfield barrier. On entry the  
> stack holds:
> +   * object, value.
>    *
>    * @param asm the assembler to generate the code in
> -   * @param ref the register holding the array reference
>    * @param offset the register holding the offset of the field
> -   * @param value the register holding the value to store
> +   * @param locationMetadata meta-data about the location
>    */
> -  static void compilePutfieldBarrier(Assembler asm, GPR ref, GPR  
> offset, GPR value, int locationMetadata) {
> -    BaselineCompilerImpl.genNullCheck(asm, ref);
> -    asm.emitPUSH_Reg(ref);
> +  @Inline
> +  static void compilePutfieldBarrier(Assembler asm, GPR offset, int  
> locationMetadata) {
>     asm.emitPUSH_Reg(offset);
> -    asm.emitPUSH_Reg(value);
>     asm.emitPUSH_Imm(locationMetadata);
>     BaselineCompilerImpl.genParameterRegisterLoad(asm, 4);
> +    BaselineCompilerImpl.genNullCheck(asm, T0);
>      
> asm
> .emitCALL_Abs
> (Magic
> .getTocPointer
> ().plus(Entrypoints.putfieldWriteBarrierMethod.getOffset()));
> -   }
> +  }
>
>   /**
> -   * Generate code to perform a putfield barrier when the field is  
> at a known offset
> +   * Generate code to perform a putfield barrier when the field is  
> at a known
> +   * offset. On entry the stack holds: object, value.
>    *
>    * @param asm the assembler to generate the code in
> -   * @param ref the register holding the array reference
>    * @param fieldOffset the offset of the field
> -   * @param value the register holding the value to store
> +   * @param locationMetadata meta-data about the location
>    */
> -  static void compilePutfieldBarrierImm(Assembler asm, GPR ref,  
> Offset fieldOffset, GPR value, int locationMetadata) {
> -    BaselineCompilerImpl.genNullCheck(asm, ref);
> -    asm.emitPUSH_Reg(ref);
> +  @Inline
> +  static void compilePutfieldBarrierImm(Assembler asm, Offset  
> fieldOffset, int locationMetadata) {
>     asm.emitPUSH_Imm(fieldOffset.toInt());
> -    asm.emitPUSH_Reg(value);
>     asm.emitPUSH_Imm(locationMetadata);
>     BaselineCompilerImpl.genParameterRegisterLoad(asm, 4);
> +    BaselineCompilerImpl.genNullCheck(asm, T0);
>      
> asm
> .emitCALL_Abs
> (Magic
> .getTocPointer
> ().plus(Entrypoints.putfieldWriteBarrierMethod.getOffset()));
>   }
>
>   static void compilePutstaticBarrier(Assembler asm, GPR reg, int  
> locationMetadata) {
>     //  on entry java stack contains ...|ref_to_store|
>     //  reg holds offset of field
> -    if(VM.VerifyAssertions) VM._assert(reg != S0);
> -    asm.emitPOP_Reg(S0);   // S0 = ref_to_store
>     asm.emitPUSH_Reg(reg); // offset
> -    asm.emitPUSH_Reg(S0);  // ref_to_store
>     asm.emitPUSH_Imm(locationMetadata);
>     BaselineCompilerImpl.genParameterRegisterLoad(asm, 3);
>      
> asm
> .emitCALL_Abs
> (Magic
> .getTocPointer
> ().plus(Entrypoints.putstaticWriteBarrierMethod.getOffset()));
>
> Modified: rvmroot/trunk/rvm/src/org/jikesrvm/compilers/baseline/ia32/
> BaselineCompilerImpl.java
> ===================================================================
> --- rvmroot/trunk/rvm/src/org/jikesrvm/compilers/baseline/ia32/
> BaselineCompilerImpl.java 2009-01-30 05:45:18 UTC (rev 15317)
> +++ rvmroot/trunk/rvm/src/org/jikesrvm/compilers/baseline/ia32/
> BaselineCompilerImpl.java 2009-01-30 15:21:00 UTC (rev 15318)
> @@ -702,23 +702,11 @@
>   @Override
>   protected final void emit_aastore() {
>     Barriers.compileModifyCheck(asm, 8);
> -    asm.emitPUSH_RegDisp(SP, TWO_SLOTS); // duplicate array ref
> -    asm.emitPUSH_RegDisp(SP, ONE_SLOT);  // duplicate object value
> -    genParameterRegisterLoad(asm, 2);    // pass 2 parameter
> -    // call checkstore(array ref, value)
> -    
> asm
> .emitCALL_Abs
> (Magic
> .getTocPointer().plus(Entrypoints.checkstoreMethod.getOffset()));
> -    asm.emitPOP_Reg(T1); // T1 is the value
> -    asm.emitPOP_Reg(T0); // T0 is array index
> -    asm.emitPOP_Reg(S0); // S0 is array ref
> -    genBoundsCheck(asm, T0, S0); // T0 is index, S0 is address of  
> array
>     if (MemoryManagerConstants.NEEDS_WRITE_BARRIER) {
> -      Barriers.compileArrayStoreBarrier(asm, S0, T0, T1);
> +      Barriers.compileArrayStoreBarrier(asm);
>     } else {
> -      if (VM.BuildFor32Addr) {
> -        asm.emitMOV_RegIdx_Reg(S0, T0, Assembler.WORD, NO_SLOT,  
> T1); // [S0 + T0<<2] <- T1
> -      } else {
> -        asm.emitMOV_RegIdx_Reg_Quad(S0, T0, Assembler.LONG,  
> NO_SLOT, T1); // [S0 + T0<<3] <- T1
> -      }
> +      genParameterRegisterLoad(asm, 3);
> +      
> asm
> .emitCALL_Abs
> (Magic.getTocPointer().plus(Entrypoints.aastoreMethod.getOffset()));
>     }
>   }
>
> @@ -2863,11 +2851,11 @@
>     emitDynamicLinkingSequence(asm, T0, fieldRef, true);
>     if (fieldType.isReferenceType()) {
>       // 32/64bit reference store
> -      asm.emitPOP_Reg(T1);  // T1 is the value to be stored
> -      asm.emitPOP_Reg(S0);  // S0 is the object reference
>       if (MemoryManagerConstants.NEEDS_WRITE_BARRIER) {
> -        Barriers.compilePutfieldBarrier(asm, S0, T0, T1,  
> fieldRef.getId());
> +        Barriers.compilePutfieldBarrier(asm, T0, fieldRef.getId());
>       } else {
> +        asm.emitPOP_Reg(T1);  // T1 is the value to be stored
> +        asm.emitPOP_Reg(S0);  // S0 is the object reference
>         if (VM.BuildFor32Addr) {
>           asm.emitMOV_RegIdx_Reg(S0, T0, Assembler.BYTE, NO_SLOT,  
> T1); // [S0+T0] <- T1
>         } else {
> @@ -2934,11 +2922,11 @@
>     Barriers.compileModifyCheck(asm, 4);
>     if (field.isReferenceType()) {
>       // 32/64bit reference store
> -      asm.emitPOP_Reg(T0);  // T0 is the value to be stored
> -      asm.emitPOP_Reg(S0);  // S0 is the object reference
>       if (MemoryManagerConstants.NEEDS_WRITE_BARRIER && !
> field.isUntraced()) {
> -        Barriers.compilePutfieldBarrierImm(asm, S0, fieldOffset,  
> T0, fieldRef.getId());
> +        Barriers.compilePutfieldBarrierImm(asm, fieldOffset,  
> fieldRef.getId());
>       } else {
> +        asm.emitPOP_Reg(T0);  // T0 is the value to be stored
> +        asm.emitPOP_Reg(S0);  // S0 is the object reference
>         // [S0+fieldOffset] <- T0
>         if (VM.BuildFor32Addr) {
>           asm.emitMOV_RegDisp_Reg(S0, fieldOffset, T0);
> @@ -4017,7 +4005,7 @@
>
>   /**
>    * Copy parameters from operand stack into registers.
> -   * Assumption: parameters are layed out on the stack in order
> +   * Assumption: parameters are laid out on the stack in order
>    * with SP pointing to the last parameter.
>    * Also, this method is called before the generation of a "helper"  
> method call.
>    * Assumption: no floating-point parameters.
> @@ -4133,7 +4121,7 @@
>    * Store parameters into local space of the callee's stackframe.
>    * Taken: srcOffset - offset from frame pointer of first parameter  
> in caller's stackframe.
>    * Assumption: although some parameters may be passed in registers,
> -   * space for all parameters is layed out in order on the caller's  
> stackframe.
> +   * space for all parameters is laid out in order on the caller's  
> stackframe.
>    */
>   private void genParameterCopy(Offset srcOffset) {
>     int gpr = 0;  // number of general purpose registers unloaded
>
> Modified: rvmroot/trunk/rvm/src/org/jikesrvm/compilers/baseline/ppc/
> Barriers.java
> ===================================================================
> --- rvmroot/trunk/rvm/src/org/jikesrvm/compilers/baseline/ppc/
> Barriers.java 2009-01-30 05:45:18 UTC (rev 15317)
> +++ rvmroot/trunk/rvm/src/org/jikesrvm/compilers/baseline/ppc/
> Barriers.java 2009-01-30 15:21:00 UTC (rev 15318)
> @@ -24,23 +24,26 @@
>  */
> class Barriers implements BaselineConstants {
>
> -  // on entry T0, T1, and T2 already contain the appropriate values
> +  // on entry java stack contains ...|array_ref|index|value|
>   static void compileArrayStoreBarrier(BaselineCompilerImpl comp) {
>     Assembler asm = comp.asm;
> -    asm.emitLAddrToc(S0,  
> Entrypoints.arrayStoreWriteBarrierMethod.getOffset());
> -    asm.emitMTCTR(S0);
> -    asm.emitBCCTRL();  //  
> MemoryManager.arrayStoreWriteBarrier(Object ref, int index, Object  
> value)
> +    asm.emitLAddrToc(T0, Entrypoints.aastoreMethod.getOffset());
> +    asm.emitMTCTR(T0);
> +    comp.peekAddr(T0, 2); // T0 is array ref
> +    comp.peekInt(T1, 1);  // T1 is the index
> +    comp.peekAddr(T2, 0); // T2 is value to store
> +    asm.emitBCCTRL();   // aastore(arrayref, index, value)
>   }
>
>   //  on entry java stack contains ...|target_ref|ref_to_store|
> -  // T1 already contains the offset of the field on entry
> +  // T2 already contains the offset of the field on entry
>   static void compilePutfieldBarrier(BaselineCompilerImpl comp, int  
> locationMetadata) {
>     Assembler asm = comp.asm;
>     asm.emitLAddrToc(S0,  
> Entrypoints.putfieldWriteBarrierMethod.getOffset());
>     asm.emitMTCTR(S0);
>     comp.peekAddr(T0, 1);               // object base
>     asm.emitNullCheck(T0);
> -    comp.peekAddr(T2, 0);               // value to store
> +    comp.peekAddr(T1, 0);               // value to store
>     asm.emitLVAL(T3, locationMetadata);
>     asm.emitBCCTRL(); //  
> MemoryManager.putfieldWriteBarrier(T0,T1,T2,T3)
>   }
> @@ -52,21 +55,21 @@
>     asm.emitMTCTR(S0);
>     comp.peekAddr(T0, 1);                 // object base
>     asm.emitNullCheck(T0);
> -    asm.emitLVALAddr(T1, fieldOffset);       // offset
> -    comp.peekAddr(T2, 0);                 // value to store
> +    asm.emitLVALAddr(T2, fieldOffset);       // offset
> +    comp.peekAddr(T1, 0);                 // value to store
>     asm.emitLVAL(T3, locationMetadata);
>     asm.emitBCCTRL();  //  
> MemoryManager.putfieldWriteBarrier(T0,T1,T2,T3)
>   }
>
>   //  on entry java stack contains ...|ref_to_store|
> -  // T0 already contains the offset of the field on entry
> +  // T1 already contains the offset of the field on entry
>   static void compilePutstaticBarrier(BaselineCompilerImpl comp, int  
> locationMetadata) {
>     Assembler asm = comp.asm;
>     asm.emitLAddrToc(S0,  
> Entrypoints.putstaticWriteBarrierMethod.getOffset());
>     asm.emitMTCTR(S0);
> -    comp.peekAddr(T1, 0);                 // value to store
> +    comp.peekAddr(T0, 0);                 // value to store
>     asm.emitLVAL(T2, locationMetadata);
> -    asm.emitBCCTRL(); // MemoryManager.putstaticWriteBarrier(T0,T1)
> +    asm.emitBCCTRL(); //  
> MemoryManager.putstaticWriteBarrier(T0,T1,T2)
>   }
>
>   //  on entry java stack contains ...|ref_to_store|
> @@ -74,10 +77,10 @@
>     Assembler asm = comp.asm;
>     asm.emitLAddrToc(S0,  
> Entrypoints.putstaticWriteBarrierMethod.getOffset());
>     asm.emitMTCTR(S0);
> -    asm.emitLVALAddr(T0, fieldOffset);    // offset
> -    comp.peekAddr(T1, 0);                 // value to store
> +    asm.emitLVALAddr(T1, fieldOffset);    // offset
> +    comp.peekAddr(T0, 0);                 // value to store
>     asm.emitLVAL(T2, locationMetadata);
> -    asm.emitBCCTRL();  // MemoryManager.putstaticWriteBarrier(T0,T1)
> +    asm.emitBCCTRL();  //  
> MemoryManager.putstaticWriteBarrier(T0,T1,T2)
>   }
>
>   // on entry T0, T1 already contain the appropriate values
>
> Modified: rvmroot/trunk/rvm/src/org/jikesrvm/compilers/baseline/ppc/
> BaselineCompilerImpl.java
> ===================================================================
> --- rvmroot/trunk/rvm/src/org/jikesrvm/compilers/baseline/ppc/
> BaselineCompilerImpl.java 2009-01-30 05:45:18 UTC (rev 15317)
> +++ rvmroot/trunk/rvm/src/org/jikesrvm/compilers/baseline/ppc/
> BaselineCompilerImpl.java 2009-01-30 15:21:00 UTC (rev 15318)
> @@ -1061,18 +1061,16 @@
>    */
>   @Override
>   protected final void emit_aastore() {
> -    asm.emitLAddrToc(T0, Entrypoints.checkstoreMethod.getOffset());
> -    asm.emitMTCTR(T0);
> -    peekAddr(T1, 0);    // T1 is value to store
> -    peekAddr(T0, 2);    // T0 is array ref
> -    asm.emitBCCTRL();   // checkstore(arrayref, value)
> -    popAddr(T2);        // T2 is value to store
> -    genBoundsCheck();
>     if (MemoryManagerConstants.NEEDS_WRITE_BARRIER) {
>       Barriers.compileArrayStoreBarrier(this);
> +      discardSlots(3);
>     } else {
> -      asm.emitSLWI(T1, T1, LOG_BYTES_IN_ADDRESS);  // convert index  
> to offset
> -      asm.emitSTAddrX(T2, T0, T1);  // store ref value in array
> +      asm.emitLAddrToc(T0, Entrypoints.aastoreMethod.getOffset());
> +      asm.emitMTCTR(T0);
> +      popAddr(T2);    // T2 is value to store
> +      popInt(T1);     // T1 is the index
> +      popAddr(T0);    // T0 is array ref
> +      asm.emitBCCTRL();   // aastore(arrayref, index, value)
>     }
>   }
>
> @@ -2535,26 +2533,26 @@
>    * @param fieldRef the referenced field
>    */
>   protected final void emit_unresolved_putstatic(FieldReference  
> fieldRef) {
> -    emitDynamicLinkingSequence(T0, fieldRef, true);
> +    emitDynamicLinkingSequence(T1, fieldRef, true);
>     if (MemoryManagerConstants.NEEDS_PUTSTATIC_WRITE_BARRIER && !
> fieldRef.getFieldContentsType().isPrimitiveType()) {
>       Barriers.compilePutstaticBarrier(this, fieldRef.getId()); //  
> NOTE: offset is in T0 from emitDynamicLinkingSequence
>       discardSlots(1);
>       return;
>     }
>     if (fieldRef.getSize() <= BYTES_IN_INT) { // field is one word
> -      popInt(T1);
> -      asm.emitSTWX(T1, T0, JTOC);
> +      popInt(T0);
> +      asm.emitSTWX(T0, T1, JTOC);
>     } else { // field is two words (double or long (or address on  
> PPC64))
>       if (VM.VerifyAssertions) VM._assert(fieldRef.getSize() ==  
> BYTES_IN_LONG);
>       if (VM.BuildFor64Addr) {
>         if (fieldRef.getNumberOfStackSlots() == 1) {    //address  
> only 1 stackslot!!!
> -          popAddr(T1);
> -          asm.emitSTDX(T1, T0, JTOC);
> +          popAddr(T0);
> +          asm.emitSTDX(T0, T1, JTOC);
>           return;
>         }
>       }
>       popDouble(F0);
> -      asm.emitSTFDX(F0, T0, JTOC);
> +      asm.emitSTFDX(F0, T1, JTOC);
>     }
>   }
>
> @@ -2692,51 +2690,51 @@
>    */
>   protected final void emit_unresolved_putfield(FieldReference  
> fieldRef) {
>     TypeReference fieldType = fieldRef.getFieldContentsType();
> -    // T1 = field offset from emitDynamicLinkingSequence()
> -    emitDynamicLinkingSequence(T1, fieldRef, true);
> +    // T2 = field offset from emitDynamicLinkingSequence()
> +    emitDynamicLinkingSequence(T2, fieldRef, true);
>     if (fieldType.isReferenceType()) {
>       // 32/64bit reference store
>       if (MemoryManagerConstants.NEEDS_WRITE_BARRIER) {
> -        // NOTE: offset is in T1 from emitDynamicLinkingSequence
> +        // NOTE: offset is in T2 from emitDynamicLinkingSequence
>         Barriers.compilePutfieldBarrier(this, fieldRef.getId());
>         discardSlots(2);
>       } else {
>         popAddr(T0);                // T0 = address value
> -        popAddr(T2);                // T2 = object reference
> -        if (VM.ExplicitlyGuardLowMemory) asm.emitNullCheck(T2);
> -        asm.emitSTAddrX(T0, T2, T1);
> +        popAddr(T1);                // T1 = object reference
> +        if (VM.ExplicitlyGuardLowMemory) asm.emitNullCheck(T1);
> +        asm.emitSTAddrX(T0, T1, T2);
>       }
>     } else if (fieldType.isWordType()) {
>       // 32/64bit word store
>       popAddr(T0);                // T0 = value
> -      popAddr(T2);                // T2 = object reference
> -      if (VM.ExplicitlyGuardLowMemory) asm.emitNullCheck(T2);
> -      asm.emitSTAddrX(T0, T2, T1);
> +      popAddr(T1);                // T1 = object reference
> +      if (VM.ExplicitlyGuardLowMemory) asm.emitNullCheck(T1);
> +      asm.emitSTAddrX(T0, T1, T2);
>     } else if (fieldType.isBooleanType() || fieldType.isByteType()) {
>       // 8bit store
>       popInt(T0); // T0 = value
> -      popAddr(T2); // T2 = object reference
> -      if (VM.ExplicitlyGuardLowMemory) asm.emitNullCheck(T2);
> -      asm.emitSTBX(T0, T2, T1);
> +      popAddr(T1); // T1 = object reference
> +      if (VM.ExplicitlyGuardLowMemory) asm.emitNullCheck(T1);
> +      asm.emitSTBX(T0, T1, T2);
>     } else if (fieldType.isShortType() || fieldType.isCharType()) {
>       // 16bit store
>       popInt(T0); // T0 = value
> -      popAddr(T2); // T2 = object reference
> -      if (VM.ExplicitlyGuardLowMemory) asm.emitNullCheck(T2);
> -      asm.emitSTHX(T0, T2, T1);
> +      popAddr(T1); // T1 = object reference
> +      if (VM.ExplicitlyGuardLowMemory) asm.emitNullCheck(T1);
> +      asm.emitSTHX(T0, T1, T2);
>     } else if (fieldType.isIntType() || fieldType.isFloatType()) {
>       // 32bit store
>       popInt(T0); // T0 = value
> -      popAddr(T2); // T2 = object reference
> +      popAddr(T1); // T1 = object reference
>       if (VM.ExplicitlyGuardLowMemory) asm.emitNullCheck(T2);
> -      asm.emitSTWX(T0, T2, T1);
> +      asm.emitSTWX(T0, T1, T2);
>     } else {
>       // 64bit store
>       if (VM.VerifyAssertions) VM._assert(fieldType.isLongType() ||  
> fieldType.isDoubleType());
>       popDouble(F0);     // F0 = doubleword value
> -      popAddr(T2);       // T2 = object reference
> -      if (VM.ExplicitlyGuardLowMemory) asm.emitNullCheck(T2);
> -      asm.emitSTFDX(F0, T2, T1);
> +      popAddr(T1);       // T1 = object reference
> +      if (VM.ExplicitlyGuardLowMemory) asm.emitNullCheck(T1);
> +      asm.emitSTFDX(F0, T1, T2);
>     }
>   }
>
>
> Modified: rvmroot/trunk/rvm/src/org/jikesrvm/compilers/opt/hir2lir/
> ExpandRuntimeServices.java
> ===================================================================
> --- rvmroot/trunk/rvm/src/org/jikesrvm/compilers/opt/hir2lir/
> ExpandRuntimeServices.java 2009-01-30 05:45:18 UTC (rev 15317)
> +++ rvmroot/trunk/rvm/src/org/jikesrvm/compilers/opt/hir2lir/
> ExpandRuntimeServices.java 2009-01-30 15:21:00 UTC (rev 15318)
> @@ -427,8 +427,8 @@
>                                  MethodOperand.STATIC(target),
>                                  PutField.getClearGuard(inst),
>                                  PutField.getRef(inst).copy(),
> +                                 PutField.getValue(inst).copy(),
>                                  PutField.getOffset(inst).copy(),
> -                                 PutField.getValue(inst).copy(),
>                                  IRTools.IC(fieldRef.getId()));
>                 wb.bcIndex = RUNTIME_SERVICES_BCI;
>                 wb.position = inst.position;
> @@ -482,8 +482,8 @@
>                                null,
>                                IRTools.AC(target.getOffset()),
>                                MethodOperand.STATIC(target),
> +                               PutStatic.getValue(inst).copy(),
>                                PutStatic.getOffset(inst).copy(),
> -                               PutStatic.getValue(inst).copy(),
>                                IRTools.IC(field.getId()));
>               wb.bcIndex = RUNTIME_SERVICES_BCI;
>               wb.position = inst.position;
>
> Modified: rvmroot/trunk/rvm/src/org/jikesrvm/mm/mminterface/
> MemoryManager.java
> ===================================================================
> --- rvmroot/trunk/rvm/src/org/jikesrvm/mm/mminterface/
> MemoryManager.java 2009-01-30 05:45:18 UTC (rev 15317)
> +++ rvmroot/trunk/rvm/src/org/jikesrvm/mm/mminterface/
> MemoryManager.java 2009-01-30 15:21:00 UTC (rev 15318)
> @@ -178,13 +178,13 @@
>    * Write barrier for putfield operations.
>    *
>    * @param ref the object which is the subject of the putfield
> +   * @param value the new value for the field
>    * @param offset the offset of the field to be modified
> -   * @param value the new value for the field
>    * @param locationMetadata an int that encodes the source location  
> being modified
>    */
>   @Inline
>   @Entrypoint
> -  public static void putfieldWriteBarrier(Object ref, Offset  
> offset, Object value, int locationMetadata) {
> +  public static void putfieldWriteBarrier(Object ref, Object value,  
> Offset offset, int locationMetadata) {
>     ObjectReference src = ObjectReference.fromObject(ref);
>     Selected.Mutator.get().writeBarrier(src,
>                                         src.toAddress().plus(offset),
> @@ -217,13 +217,13 @@
>   /**
>    * Write barrier for putstatic operations.
>    *
> +   * @param value the new value for the field
>    * @param offset the offset of the field to be modified
> -   * @param value the new value for the field
>    * @param locationMetadata an int that encodes the source location  
> being modified
>    */
>   @Inline
>   @Entrypoint
> -  public static void putstaticWriteBarrier(Offset offset, Object  
> value, int locationMetadata) {
> +  public static void putstaticWriteBarrier(Object value, Offset  
> offset, int locationMetadata) {
>     ObjectReference src = ObjectReference.fromObject(Magic.getJTOC());
>     Selected.Mutator.get().writeBarrier(src,
>                                         src.toAddress().plus(offset),
>
> Modified: rvmroot/trunk/rvm/src/org/jikesrvm/runtime/Entrypoints.java
> ===================================================================
> --- rvmroot/trunk/rvm/src/org/jikesrvm/runtime/Entrypoints.java
> 2009-01-30 05:45:18 UTC (rev 15317)
> +++ rvmroot/trunk/rvm/src/org/jikesrvm/runtime/Entrypoints.java
> 2009-01-30 15:21:00 UTC (rev 15318)
> @@ -51,6 +51,8 @@
>       getMethod(org.jikesrvm.runtime.RuntimeEntrypoints.class,  
> "checkcast", "(Ljava/lang/Object;I)V");
>   public static final NormalMethod checkstoreMethod =
>       getMethod(org.jikesrvm.runtime.RuntimeEntrypoints.class,  
> "checkstore", "(Ljava/lang/Object;Ljava/lang/Object;)V");
> +  public static final NormalMethod aastoreMethod =
> +      getMethod(org.jikesrvm.runtime.RuntimeEntrypoints.class,  
> "aastore", "([Ljava/lang/Object;ILjava/lang/Object;)V");
>   public static final NormalMethod athrowMethod =
>       getMethod(org.jikesrvm.runtime.RuntimeEntrypoints.class,  
> "athrow", "(Ljava/lang/Throwable;)V");
>
> @@ -258,9 +260,9 @@
>   public static final NormalMethod arrayStoreWriteBarrierMethod =
>       getMethod(org.jikesrvm.mm.mminterface.MemoryManager.class,  
> "arrayStoreWriteBarrier", "(Ljava/lang/Object;ILjava/lang/Object;)V");
>   public static final NormalMethod putfieldWriteBarrierMethod =
> -      getMethod(org.jikesrvm.mm.mminterface.MemoryManager.class,  
> "putfieldWriteBarrier", "(Ljava/lang/Object;Lorg/vmmagic/unboxed/
> Offset;Ljava/lang/Object;I)V");
> +      getMethod(org.jikesrvm.mm.mminterface.MemoryManager.class,  
> "putfieldWriteBarrier", "(Ljava/lang/Object;Ljava/lang/Object;Lorg/
> vmmagic/unboxed/Offset;I)V");
>   public static final NormalMethod putstaticWriteBarrierMethod =
> -      getMethod(org.jikesrvm.mm.mminterface.MemoryManager.class,  
> "putstaticWriteBarrier", "(Lorg/vmmagic/unboxed/Offset;Ljava/lang/
> Object;I)V");
> +      getMethod(org.jikesrvm.mm.mminterface.MemoryManager.class,  
> "putstaticWriteBarrier", "(Ljava/lang/Object;Lorg/vmmagic/unboxed/
> Offset;I)V");
>
>   public static final NormalMethod arrayLoadReadBarrierMethod =
>       getMethod(org.jikesrvm.mm.mminterface.MemoryManager.class,  
> "arrayLoadReadBarrier", "(Ljava/lang/Object;I)Ljava/lang/Object;");
>
> Modified: rvmroot/trunk/rvm/src/org/jikesrvm/runtime/
> RuntimeEntrypoints.java
> ===================================================================
> --- rvmroot/trunk/rvm/src/org/jikesrvm/runtime/
> RuntimeEntrypoints.java 2009-01-30 05:45:18 UTC (rev 15317)
> +++ rvmroot/trunk/rvm/src/org/jikesrvm/runtime/
> RuntimeEntrypoints.java 2009-01-30 15:21:00 UTC (rev 15318)
> @@ -16,6 +16,7 @@
> import org.jikesrvm.ArchitectureSpecific.Registers;
> import org.jikesrvm.VM;
> import org.jikesrvm.Constants;
> +import org.jikesrvm.Services;
> import org.jikesrvm.classloader.RVMArray;
> import org.jikesrvm.classloader.RVMClass;
> import org.jikesrvm.classloader.DynamicTypeCheck;
> @@ -165,9 +166,24 @@
>   }
>
>   /**
> +   * Perform aastore bytecode
> +   */
> +  @Entrypoint
> +  static void aastore(Object[] arrayRef, int index, Object value)  
> throws ArrayStoreException, ArrayIndexOutOfBoundsException {
> +    checkstore(arrayRef, value);
> +    int nelts = ObjectModel.getArrayLength(arrayRef);
> +    if (index < nelts) {
> +      Services.setArrayUninterruptible(arrayRef, index, value);
> +    } else {
> +      throw new ArrayIndexOutOfBoundsException(index);
> +    }
> +  }
> +
> +  /**
>    * Throw exception iff array assignment is illegal.
>    */
>   @Entrypoint
> +  @Inline
>   static void checkstore(Object array, Object arrayElement) throws  
> ArrayStoreException {
>     if (arrayElement == null) {
>       return; // null may be assigned to any type
>
> Modified: rvmroot/trunk/rvm/src/org/jikesrvm/runtime/Statics.java
> ===================================================================
> --- rvmroot/trunk/rvm/src/org/jikesrvm/runtime/Statics.java
> 2009-01-30 05:45:18 UTC (rev 15317)
> +++ rvmroot/trunk/rvm/src/org/jikesrvm/runtime/Statics.java
> 2009-01-30 15:21:00 UTC (rev 15318)
> @@ -619,7 +619,7 @@
>     // VM. We suppress the warning as we know the error can't happen.
>
>     if (VM.runningVM &&  
> MemoryManagerConstants.NEEDS_PUTSTATIC_WRITE_BARRIER) {
> -      MemoryManager.putstaticWriteBarrier(offset, object, 0);
> +      MemoryManager.putstaticWriteBarrier(object, offset, 0);
>     } else {
>       setSlotContents(offset, Magic.objectAsAddress(object).toWord());
>     }
>
>
> This was sent by the SourceForge.net collaborative development  
> platform, the world's largest Open Source development site.
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> SourcForge Community
> SourceForge wants to tell your story.
> http://p.sf.net/sfu/sf-spreadtheword
> _______________________________________________
> Jikesrvm-commits mailing list
> Jikesrvm-commits@...
> https://lists.sourceforge.net/lists/listinfo/jikesrvm-commits


------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
_______________________________________________
Jikesrvm-core mailing list
Jikesrvm-core@...
https://lists.sourceforge.net/lists/listinfo/jikesrvm-core

 « Return to Thread: Re: [rvm-core] [rvm-commits] SF.net SVN: jikesrvm:[15318] rvmroot/trunk