harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wjwashb...@apache.org
Subject svn commit: r433748 - /incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/
Date Tue, 22 Aug 2006 20:52:10 GMT
Author: wjwashburn
Date: Tue Aug 22 13:52:09 2006
New Revision: 433748

URL: http://svn.apache.org/viewvc?rev=433748&view=rev
Log:
initial mods for marksweep collector (now can do a tight loop w/ alloc(), it runs out of mem
and collects, no roots reported

Modified:
    incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/ActivePlan.java
    incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Barriers.java
    incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Collection.java
    incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Lock.java
    incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Memory.java
    incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/ObjectModel.java
    incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Options.java
    incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/ReferenceGlue.java
    incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Scanning.java
    incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SelectedCollectorContext.java
    incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SelectedMutatorContext.java
    incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SelectedPlan.java
    incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SelectedPlanConstraints.java
    incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Strings.java
    incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SynchronizedCounter.java

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/ActivePlan.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/ActivePlan.java?rev=433748&r1=433747&r2=433748&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/ActivePlan.java
(original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/ActivePlan.java
Tue Aug 22 13:52:09 2006
@@ -21,7 +21,6 @@
 package org.apache.HarmonyDRLVM.mm.mmtk;
 
 import org.mmtk.plan.Plan;
-import org.mmtk.plan.nogc.*;
 import org.mmtk.plan.CollectorContext;
 import org.mmtk.plan.MutatorContext;
 import org.mmtk.plan.PlanConstraints;
@@ -36,15 +35,15 @@
 
   /* Collector and Mutator Context Management */
   private static final int MAX_CONTEXTS = 1;  //wjw -- just do single thread for starts
-  private static NoGCCollector[] collectors = new NoGCCollector[MAX_CONTEXTS];
+  private static CollectorContext[] collectors = new CollectorContext[MAX_CONTEXTS];
   private static int collectorCount = 0; // Number of collector instances 
-  private static NoGCMutator[] mutators = new NoGCMutator[MAX_CONTEXTS];
+  private static MutatorContext[] mutators = new MutatorContext[MAX_CONTEXTS];
   private static int mutatorCount = 0; // Number of mutator instances 
   private static SynchronizedCounter mutatorCounter = new SynchronizedCounter();
 
   /** @return The active Plan instance. */
   public final Plan global() throws InlinePragma {
-    return SelectedPlan.get();  //wjw SelectedPlan is hardcoded for NoGC for now...
+    return SelectedPlan.get();
   } 
   
   /** @return The active PlanConstraints instance. */
@@ -109,7 +108,7 @@
    * @return The CollectorContext's unique identifier
    */
   public final int registerCollector(CollectorContext collector) throws InterruptiblePragma
{
-    collectors[collectorCount] = (NoGCCollector)collector;
+    collectors[collectorCount] = collector;
     return collectorCount++;
   }
   
@@ -123,7 +122,7 @@
    */
     //wjw -- this needs to be called by VM when a new java thread is created
   public final int registerMutator(MutatorContext mutator) throws InterruptiblePragma {
-    mutators[mutatorCount] = (NoGCMutator)mutator;
+    mutators[mutatorCount] = mutator;
     return mutatorCount++;
   } 
 }

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Barriers.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Barriers.java?rev=433748&r1=433747&r2=433748&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Barriers.java
(original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Barriers.java
Tue Aug 22 13:52:09 2006
@@ -24,6 +24,7 @@
 
 import org.vmmagic.unboxed.*;
 import org.vmmagic.pragma.*;
+import org.mmtk.vm.*;
 
 public class Barriers extends org.mmtk.vm.Barriers implements Uninterruptible {
   /**
@@ -40,7 +41,9 @@
                                            ObjectReference target, Offset offset, 
                                            int locationMetadata, int mode) 
     throws InlinePragma {
-    System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Barriers -- performWriteInBarrier
was called (but should not be)" );
+    System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Barriers -- performWriteInBarrier
was called" );
+    //VM.assertions._assert(false);
+
     //wjw turn this on when we need it -----> Object obj = ref.toObject();
     //wjw    VM_Magic.setObjectAtOffset(obj, offset, target.toObject(), locationMetadata);
 
   }
@@ -71,8 +74,8 @@
     } while (!VM_Magic.attemptObject(obj, offset, oldObject, newObject));
     return ObjectReference.fromObject(oldObject); 
     */
-    System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Barriers -- performWriteInBarrierAtomic
was called (but should not be)" );
-
+    System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Barriers -- performWriteInBarrierAtomic
was called" );
+    //VM.assertions._assert(false);
     return ref;  // keep the compiler happy
   }
 
@@ -89,9 +92,15 @@
   public final void setArrayNoBarrier(char [] dst, int index, char value) {
     setArrayNoBarrierStatic(dst, index, value);
   }
+  private static boolean oneShot = false;
   public static final void setArrayNoBarrierStatic(char [] dst, int index, char value) {
-      System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Barriers.setArrayNoBarrier()" );
+      if (oneShot == false) 
+      {
+          System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Barriers.setArrayNoBarrier()
-- needs fixing" );
+          oneShot = true;
+      }
       dst[index] = value;
+      //VM.assertions._assert(false);
   }
 
   /**
@@ -105,8 +114,15 @@
   public final char getArrayNoBarrier(char [] src, int index) {
     return getArrayNoBarrierStatic(src, index);
   }
+  
+  private static boolean oneShot2 = false;
   public static final char getArrayNoBarrierStatic(char [] src, int index) {
-      System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Barriers.getArrayNoBarrier()" );
+      if (oneShot2 == false ) 
+      {
+          System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Barriers.getArrayNoBarrier()"
);
+          //VM.assertions._assert(false);
+          oneShot2 = true;
+      }
       return src[index];
   }
 
@@ -136,6 +152,7 @@
    */
   public final int getArrayNoBarrier(int [] src, int index) {
       System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Barriers.getArrayNoBarrier()" );
+      //VM.assertions._assert(false);
       return src[index];
   }
 
@@ -149,6 +166,7 @@
    */
   public final Object getArrayNoBarrier(Object [] src, int index) {
       System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Barriers.getArrayNoBarrier()" );
+      //VM.assertions._assert(false);
       return src[index];
   }
   
@@ -166,6 +184,7 @@
   }
   public static final byte[] getArrayNoBarrierStatic(byte[][] src, int index) {
       System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Barriers.getArrayNoBarrierStatic()"
);
+      //VM.assertions._assert(false);
       return src[index];
   }
 }

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Collection.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Collection.java?rev=433748&r1=433747&r2=433748&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Collection.java
(original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Collection.java
Tue Aug 22 13:52:09 2006
@@ -30,6 +30,7 @@
 import org.mmtk.utility.heap.HeapGrowthManager;
 import org.mmtk.utility.ReferenceProcessor;
 import org.mmtk.utility.options.Options;
+import org.mmtk.vm.*;
 
 /*  wjw we will need some analog to the below imports later on, keep the below as a reference
 import com.ibm.JikesRVM.VM;
@@ -74,7 +75,8 @@
    */
   public static final void init() throws InterruptiblePragma {
         //wjw NoGC does not have a collector, do nothing for starts
-      System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Collection.init() has been called");
+      System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Collection.init() has been called
-1-");
+      VM.assertions._assert(false);
   }
 
   /**
@@ -87,10 +89,13 @@
    * <code>TRIGGER_REASONS - 1</code>.
    */
   public final void triggerCollection(int why) throws InterruptiblePragma {
-    System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Collection.triggerCollection() has
been called why = " + why);
+      //System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Collection.triggerCollection()
-2- has been called why = " + why);
+      //VM.assertions._assert(false);
+      CollectorContext cc = SelectedPlan.ap.collector();
+      cc.collect();
   }
   
-    /* whw -- toss all of triggerCollectionStatic()
+    /* wjw -- toss all of triggerCollectionStatic()
   public static final void triggerCollectionStatic(int why) throws InterruptiblePragma {
     if (VM.VerifyAssertions) VM._assert((why >= 0) && (why < TRIGGER_REASONS));

     Plan.collectionInitiated();
@@ -130,7 +135,8 @@
    */
   public final void triggerCollectionNow(int why) 
     throws LogicallyUninterruptiblePragma {
-    System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Collection.triggerCollection() has
been called why = " + why);
+    System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Collection.triggerCollection() has
been called -3- why = " + why);
+    VM.assertions._assert(false);
   }
 
   /**
@@ -139,7 +145,8 @@
    */
   public final void triggerAsyncCollection()
     throws UninterruptiblePragma {
-    System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Collection.triggerAsyncCollection()
has been called"); 
+    System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Collection.triggerAsyncCollection()
has been called -4-");
+    VM.assertions._assert(false);
   }
 
   /**
@@ -151,6 +158,7 @@
    * @return True if GC is not in progress.
    */
  public final boolean noThreadsInGC() throws UninterruptiblePragma {
+   VM.assertions._assert(false);
    return true;   //wjw for starts, we are doing NoGC with single thread
  }
 
@@ -162,7 +170,8 @@
   public final void prepareMutator(MutatorContext m) {
         //wjw since its single thread NoGC for now, do nothing
         //probably need to suspend the mutator at a safepoint
-        System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Collection.prepareMutator() has
been called"); 
+        //System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Collection.prepareMutator()
has been called -5-"); 
+       // VM.assertions._assert(false);
   }
   
   /**
@@ -173,18 +182,25 @@
   public final void prepareCollector(CollectorContext c) {
       //wjw since its single thread NoGC for now, do nothing
       //probably need to enumerate the roots (???)
-      System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Collection.prepareCollector() has
been called");  
+      //System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Collection.prepareCollector()
has been called -6- ");  
+      //VM.assertions._assert(false);
   }
 
   /**
    * Rendezvous with all other processors, returning the rank
    * (that is, the order this processor arrived at the barrier).
    */
+  private boolean rendFlag = false;
   public final int rendezvous(int where) throws UninterruptiblePragma {
       //wjw since its single thread NoGC for now, do nothing
       //probably need to wait on a sync barrier before proceeding
-      System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Collection.rendezvous() has been
called"); 
-    return 0;
+      if (rendFlag == false) 
+      {
+          System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Collection.rendezvous() has
been called -7-"); 
+          rendFlag = true;
+      }
+      ////////////////VM.assertions._assert(false);
+    return 1;
   }
 
   /***********************************************************************
@@ -201,6 +217,7 @@
   public static final void scheduleFinalizerThread ()
     throws UninterruptiblePragma {
       //wjw since its single thread NoGC for now, do nothing
-      System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Collection.rendezvous() has been
called");
+      System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Collection.rendezvous() has been
called -8-");
+      VM.assertions._assert(false);
     }
 }

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Lock.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Lock.java?rev=433748&r1=433747&r2=433748&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Lock.java
(original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Lock.java
Tue Aug 22 13:52:09 2006
@@ -41,28 +41,62 @@
 public class Lock extends org.mmtk.vm.Lock implements Uninterruptible {
 
 
+  static private int idx;             // lock id (based on a non-resetting counter)
+  static Object criticalSection = new Object();
+
   // Core Instance fields
   private String name;        // logical name of lock
-  private int id;             // lock id (based on a non-resetting counter)
+  private int id;
+  private Thread owningThread;
+  private int recursionCount;
 
-  public Lock(String name) { 
-    this();
-    this.name = name;
+  public Lock() 
+  {
+        this("no name lock");
   }
-  
-  public Lock() { 
 
+  public Lock(String name) {
+    this.name = name;
+    
+      try 
+      {
+          synchronized(criticalSection) 
+          {
+              this.id = Lock.idx;
+              Lock.idx++;
+          }
+      } 
+      catch (Exception e) {System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Lock() has
a problem");  }
   }
+ 
 
   public void setName(String str) {
     name = str;
   }
 
   public void acquire() {
-        System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Lock.acquire(): " + name);
+        //System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Lock.acquire(): " + name);
+   
       try 
       {
-          //this.wait();
+          while(true) 
+          {
+              synchronized(criticalSection) 
+              {
+                  if (recursionCount == 0) 
+                  {
+                      recursionCount++;
+                      owningThread = Thread.currentThread();
+                      break;
+                  }
+                  else if (  owningThread == Thread.currentThread()  ) 
+                      {
+                          recursionCount++;
+                          break;
+                      }
+              }
+              Thread.sleep(500);
+          }
       } 
       catch (Exception e) 
       { 
@@ -71,7 +105,7 @@
   }
 
   public void check (int w) {
-        System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Lock.check(), w = " + w + name);
   
+        //System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Lock.check(), w = " + w + name);
   
   }
 
   // Release the lock by incrementing serving counter.
@@ -81,8 +115,28 @@
   //
   public void release() 
   {
-       System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Lock.release(): " + name);
-       //this.notify();
+       //System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Lock.release(): " + name + "---
" + this);
+      try 
+      {
+              synchronized(criticalSection) 
+              {
+                  if (recursionCount != 0) 
+                  {
+                      if (owningThread != Thread.currentThread() ) 
+                      {
+                          System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Lock.release()
-- locks out of balance 1");
+                      } 
+                      else 
+                      {
+                          recursionCount--;
+                          if (recursionCount ==0) owningThread = null;
+                      }
+                  } else System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Lock.release()
-- locks out of balance 2");
+              }
+      } 
+      catch (Exception e) 
+      { 
+          System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Lock.acquire() has a problem:
" + e);
+      }
   }
-
 }

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Memory.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Memory.java?rev=433748&r1=433747&r2=433748&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Memory.java
(original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Memory.java
Tue Aug 22 13:52:09 2006
@@ -35,7 +35,7 @@
 public class Memory extends org.mmtk.vm.Memory
   implements Constants, Uninterruptible {
 
-    static protected int PHONY_JAVA_HEAP_SIZE = 1024 * 1024 * 256;
+    static protected int PHONY_JAVA_HEAP_SIZE = 1024 * 1024 * 350;
     static protected byte [] immortalPinnedScratchObject;  //wjw -- ugly hack, make it static
so that it is always enumerated
     static protected int dangerousPointerToStartOfScratchArea;
     static protected int dangerousPointerToEndOfScratchArea;
@@ -97,21 +97,21 @@
 
     public final void globalPrepareVMSpace() 
     {
-        System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Memory.globalPrepareVMSpace()
needs fixing");
+        //System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Memory.globalPrepareVMSpace()
needs fixing");
     }
 
     public final void collectorPrepareVMSpace() 
     {
-        System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Memory.collectorPrepareVMSpace()
needs fixing");
+        //System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Memory.collectorPrepareVMSpace()
needs fixing");
     }
 
     public final void collectorReleaseVMSpace() 
     {
-        System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Memory.collectorReleaseVMSpace()
needs fixing");
+        //System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Memory.collectorReleaseVMSpace()
needs fixing");
     }
     public final void globalReleaseVMSpace() 
     {
-        System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Memory.gobalReleaseVMSpace()
needs fixing");
+        //System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Memory.gobalReleaseVMSpace()
needs fixing");
     }
     public final void setHeapRange(int id, Address start, Address end) 
     {
@@ -151,7 +151,8 @@
    * <code>false</code>
    */
   public final boolean mprotect(Address start, int size) {
-    System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Memory.mprotect() needs fixing");
+    System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Memory.mprotect() needs fixing, start
= " + Integer.toHexString(start.toInt())
+     +   " size = " + size);
     return false; //return VM_Memory.mprotect(start, Extent.fromIntZeroExtend(size), VM_Memory.PROT_NONE);
   }
 
@@ -228,10 +229,10 @@
    */
 
   public final void sync() throws InlinePragma {
-    System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Memory.sync() was called"); 
+    //System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Memory.sync() was called"); 
   }
 
   public final void isync() throws InlinePragma {
-    System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Memory.isync() was called");
+    //System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Memory.isync() was called");
   }
 }

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/ObjectModel.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/ObjectModel.java?rev=433748&r1=433747&r2=433748&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/ObjectModel.java
(original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/ObjectModel.java
Tue Aug 22 13:52:09 2006
@@ -28,6 +28,7 @@
 
 import org.vmmagic.unboxed.*;
 import org.vmmagic.pragma.*;
+import org.mmtk.vm.*;
 
 /**
  * $Id: ObjectModel.java,v 1.6 2006/06/19 06:08:15 steveb-oss Exp $ 
@@ -80,6 +81,7 @@
       return copyArray(from, tib, type.asArray(), allocator);
   */
       System.out.println("wjw org.apache.HarmonyDRLVM.mm.mmtk.ObjectModel.copy was called");
+      VM.assertions._assert(false);
       return from;  //wjw -- keep the compiler happy for now
   }
 
@@ -170,6 +172,7 @@
     return start.plus(bytes);
 */
       System.out.println("wjw org.apache.HarmonyDRLVM.mm.mmtk.ObjectModel.copyTo() was called");
+      VM.assertions._assert(false);
       return Address.fromInt(0);
   }
 
@@ -184,6 +187,7 @@
    */
   public ObjectReference getReferenceWhenCopiedTo(ObjectReference from, Address to) {
     System.out.println("wjw org.apache.HarmonyDRLVM.mm.mmtk.ObjectModel.getReferenceWhenCopiedTo()
was called");
+    VM.assertions._assert(false);
     return from;  // keep the compiler happy -- xObjectReference.fromObject(VM_ObjectModel.getReferenceWhenCopiedTo(from,
to));
   }
   
@@ -194,6 +198,7 @@
    */
   public Address getObjectEndAddress(ObjectReference object) {
     System.out.println("wjw org.apache.HarmonyDRLVM.mm.mmtk.ObjectModel.getObjectEndAddress()
was called");
+    VM.assertions._assert(false);
     return Address.fromInt(0);  // keep the compiler happy
   }
   
@@ -206,6 +211,7 @@
   public int getSizeWhenCopied(ObjectReference object) {
     //need to use drlvm's get_object_size_bytes()
     System.out.println("wjw org.apache.HarmonyDRLVM.mm.mmtk.ObjectModel.getSizeWhenCopied()
was called");
+    VM.assertions._assert(false);
     return 0;  // VM_ObjectModel.bytesRequiredWhenCopied(object);
   }
   
@@ -227,6 +233,7 @@
     }
 */
     System.out.println("wjw org.apache.HarmonyDRLVM.mm.mmtk.ObjectModel.getAlignWhenCopied()
was called");
+    VM.assertions._assert(false);
     return 0;
   }
   
@@ -247,6 +254,7 @@
     }
     */
       System.out.println("wjw org.apache.HarmonyDRLVM.mm.mmtk.ObjectModel.getAlignOffsetWhenCopied()
was called");
+      VM.assertions._assert(false);
       return 0;
   }
   
@@ -258,6 +266,7 @@
    */
   public int getCurrentSize(ObjectReference object) {
       System.out.println("wjw org.apache.HarmonyDRLVM.mm.mmtk.ObjectModel.getCurrentSize()
was called");
+      VM.assertions._assert(false);
       return 0;
       // return VM_ObjectModel.bytesUsed(object);
   }
@@ -267,6 +276,7 @@
    */
   public ObjectReference getNextObject(ObjectReference object) {
     System.out.println("wjw org.apache.HarmonyDRLVM.mm.mmtk.ObjectModel.getNextObject() was
called");
+    VM.assertions._assert(false);
     return ObjectReference.fromObject(null);
   }
 
@@ -275,6 +285,7 @@
    */
   public ObjectReference getObjectFromStartAddress(Address start) {
     System.out.println("wjw org.apache.HarmonyDRLVM.mm.mmtk.ObjectModel.getObjectFromStartAddress()
was called");
+    VM.assertions._assert(false);
     return ObjectReference.fromObject(null);
   }
   
@@ -287,12 +298,14 @@
   public byte [] getTypeDescriptor(ObjectReference ref) {
     //VM_Atom descriptor = VM_Magic.getObjectType(ref).getDescriptor();
     System.out.println("wjw org.apache.HarmonyDRLVM.mm.mmtk.ObjectModel.getTypeDescriptor()
was called");
+    VM.assertions._assert(false);
     return new byte[10]; // descriptor.toByteArray();
   }
 
   public int getArrayLength(ObjectReference object) 
     throws InlinePragma {
     System.out.println("wjw org.apache.HarmonyDRLVM.mm.mmtk.ObjectModel.getArrayLength()
was called");
+    VM.assertions._assert(false);
     //return VM_Magic.getArrayLength(object.toObject());
     return 0;
   }
@@ -304,6 +317,7 @@
    */
   public boolean testAvailableBit(ObjectReference object, int idx) {
     System.out.println("wjw org.apache.HarmonyDRLVM.mm.mmtk.ObjectModel.testAvailableBit()
was called");
+    VM.assertions._assert(false);
     //return VM_ObjectModel.testAvailableBit(object.toObject(), idx);
     return false;
   }
@@ -319,6 +333,7 @@
   public void setAvailableBit(ObjectReference object, int idx,
                                      boolean flag) {
     System.out.println("wjw org.apache.HarmonyDRLVM.mm.mmtk.ObjectModel.setAvailableBit()
was called");
+    VM.assertions._assert(false);
     //VM_ObjectModel.setAvailableBit(object.toObject(), idx, flag);
     return;
   }
@@ -339,6 +354,7 @@
   public boolean attemptAvailableBits(ObjectReference object,
                                              Word oldVal, Word newVal) {
     System.out.println("wjw org.apache.HarmonyDRLVM.mm.mmtk.ObjectModel.attemptAvailableBits()
was called");
+    VM.assertions._assert(false);
     //return VM_ObjectModel.attemptAvailableBits(object.toObject(), oldVal, newVal);
     return false;
   }
@@ -352,6 +368,7 @@
    */
   public Word prepareAvailableBits(ObjectReference object) {
     System.out.println("wjw org.apache.HarmonyDRLVM.mm.mmtk.ObjectModel.attemptAvailableBits()
was called");
+    VM.assertions._assert(false);
     //return VM_ObjectModel.prepareAvailableBits(object.toObject());
     return Word.fromInt(0);
   }
@@ -364,6 +381,7 @@
    */
   public void writeAvailableBitsWord(ObjectReference object, Word val) {
     System.out.println("wjw org.apache.HarmonyDRLVM.mm.mmtk.ObjectModel.attemptAvailableBits()
was called");
+    VM.assertions._assert(false);
     //VM_ObjectModel.writeAvailableBitsWord(object.toObject(), val);
     return;
   }
@@ -376,6 +394,7 @@
    */
   public Word readAvailableBitsWord(ObjectReference object) {
       System.out.println("wjw org.apache.HarmonyDRLVM.mm.mmtk.ObjectModel.readAvailableBitsWord()
was called");
+      VM.assertions._assert(false);
       //return VM_ObjectModel.readAvailableBitsWord(object);
       return Word.fromInt(0);
   }
@@ -391,6 +410,7 @@
   /* AJG: Should this be a variable rather than method? */
   public Offset GC_HEADER_OFFSET() {
     System.out.println("wjw org.apache.HarmonyDRLVM.mm.mmtk.ObjectModel.GC_HEADER_OFFSET()
was called");
+    VM.assertions._assert(false);
     //return VM_ObjectModel.GC_HEADER_OFFSET;
     return Offset.fromInt(0);
   }
@@ -404,6 +424,7 @@
   public Address objectStartRef(ObjectReference object)
     throws InlinePragma {
     System.out.println("wjw org.apache.HarmonyDRLVM.mm.mmtk.ObjectModel.objectStartRef()
was called");
+    VM.assertions._assert(false);
     //return VM_ObjectModel.objectStartRef(object);
     return Address.fromInt(0);
   }
@@ -417,6 +438,7 @@
    */
   public Address refToAddress(ObjectReference object) {
     System.out.println("wjw org.apache.HarmonyDRLVM.mm.mmtk.ObjectModel.objectStartRef()
was called");
+    VM.assertions._assert(false);
     //return VM_ObjectModel.getPointerInMemoryRegion(object);
     return Address.fromInt(0);
   }
@@ -442,6 +464,7 @@
 */
   {
       System.out.println("wjw org.apache.HarmonyDRLVM.mm.mmtk.ObjectModel.isAcyclic() was
called");
+      VM.assertions._assert(false);
       return false;
   }
 
@@ -474,6 +497,7 @@
     if (VM.VerifyAssertions) VM._assert(vmType.getMMType() != null);
     return (MMType) vmType.getMMType();
   */
+    VM.assertions._assert(false);
     return new MMType(false, false, false, 0, null);
   }
 }

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Options.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Options.java?rev=433748&r1=433747&r2=433748&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Options.java
(original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Options.java
Tue Aug 22 13:52:09 2006
@@ -39,7 +39,9 @@
    * @return the vm specific key.
    */
   public final String getKey(String name) {
-      /*
+   
+    System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Options.getKey(String) " + name);
   
+
     int space = name.indexOf(' ');
     if (space < 0) return name.toLowerCase();
 
@@ -55,9 +57,7 @@
       }
       key += name.substring(old, space);
     } while (true);
-    */
-    System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Options.getKey(String) " + name);
-    return null;
+
   }
 
   /**

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/ReferenceGlue.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/ReferenceGlue.java?rev=433748&r1=433747&r2=433748&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/ReferenceGlue.java
(original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/ReferenceGlue.java
Tue Aug 22 13:52:09 2006
@@ -48,7 +48,7 @@
      */
     public void scanReferences(int semantics, boolean nursery)
     {
-        System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.ReferenceGlue.scanReferences()
was called");
+        //System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.ReferenceGlue.scanReferences()
was called");
     }
 
     /**

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Scanning.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Scanning.java?rev=433748&r1=433747&r2=433748&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Scanning.java
(original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Scanning.java
Tue Aug 22 13:52:09 2006
@@ -117,6 +117,7 @@
   public final void preCopyGCInstances(TraceLocal trace) 
   throws NoInlinePragma {
         System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Scanning.preCopyGCInstances()
was called");
+        VM.assertions._assert(false);
   }
   
  
@@ -131,6 +132,7 @@
   private static void precopyChildren(TraceLocal trace, Object object) 
     throws UninterruptiblePragma, InlinePragma {
         System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Scanning.precopyChildren() was
called");
+        VM.assertions._assert(false);
   }
 
  /**
@@ -172,7 +174,8 @@
       //trace.addRootLocation(VM_Magic.objectAsAddress(VM_Scheduler.threads).plus(threadIndex<<LOG_BYTES_IN_ADDRESS));
     //}
     //VM_CollectorThread.gcBarrier.rendezvous(4200);
-    System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Scanning.computeAllRoots() was called");
+    //System.out.println("*****************************org.apache.HarmonyDRLVM.mm.mmtk.Scanning.computeAllRoots()
was called TraceLocal = "  + trace);
+    /////////////////VM.assertions._assert(false);
       return;
   }
 }

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SelectedCollectorContext.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SelectedCollectorContext.java?rev=433748&r1=433747&r2=433748&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SelectedCollectorContext.java
(original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SelectedCollectorContext.java
Tue Aug 22 13:52:09 2006
@@ -22,17 +22,20 @@
 package org.apache.HarmonyDRLVM.mm.mmtk;
 
 import org.mmtk.plan.nogc.*;
+import org.mmtk.plan.marksweep.*;
 import org.vmmagic.pragma.*;
+import org.mmtk.plan.CollectorContext;
 
 public final class SelectedCollectorContext implements 
   Uninterruptible {
 
-  public static final NoGCCollector singleton = new NoGCCollector();
+  //public static final CollectorContext singleton = new NoGCCollector();
+  public static final CollectorContext singleton = new  MSCollector();
   
   /**
    * Return the instance of the SelectedPlan
    */
-  public static final NoGCCollector get() throws InlinePragma {
+  public static final CollectorContext get() throws InlinePragma {
     return singleton;
   }
 }

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SelectedMutatorContext.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SelectedMutatorContext.java?rev=433748&r1=433747&r2=433748&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SelectedMutatorContext.java
(original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SelectedMutatorContext.java
Tue Aug 22 13:52:09 2006
@@ -22,17 +22,21 @@
 package org.apache.HarmonyDRLVM.mm.mmtk;
 
 import org.mmtk.plan.nogc.*;
+import org.mmtk.plan.marksweep.*;
 import org.vmmagic.pragma.*;
+import org.mmtk.plan.MutatorContext;
 
 public final class SelectedMutatorContext 
   implements Uninterruptible {
 
-  public static final NoGCMutator singleton = new NoGCMutator();
+  //public static final MutatorContext singleton = new NoGCMutator();
+  public static final MutatorContext singleton = new MSMutator();
   
   /**
    * Return the instance of the SelectedPlan
    */
-  public static final NoGCMutator get() throws InlinePragma {
+  public static final MutatorContext get() throws InlinePragma 
+  {
     return singleton;
   }
 }

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SelectedPlan.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SelectedPlan.java?rev=433748&r1=433747&r2=433748&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SelectedPlan.java
(original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SelectedPlan.java
Tue Aug 22 13:52:09 2006
@@ -22,14 +22,18 @@
 package org.apache.HarmonyDRLVM.mm.mmtk;
 
 import org.mmtk.plan.nogc.*;
+import org.mmtk.plan.marksweep.*;
 import org.vmmagic.pragma.*;
+import org.mmtk.plan.Plan;
 
-public final class SelectedPlan extends NoGC
-  implements Uninterruptible {
+public final class SelectedPlan implements Uninterruptible 
+{
+    //public static final Plan singleton = new NoGC();
+    public static final MS singleton = new MS();
+    public static org.apache.HarmonyDRLVM.mm.mmtk.ActivePlan ap = new org.apache.HarmonyDRLVM.mm.mmtk.ActivePlan();
 
-  public static final SelectedPlan singleton = new SelectedPlan();
-  
-  public static final SelectedPlan get() throws InlinePragma {
-    return singleton;
-  }
+    public static final Plan get() throws InlinePragma 
+    {
+        return singleton;
+    }
 }

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SelectedPlanConstraints.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SelectedPlanConstraints.java?rev=433748&r1=433747&r2=433748&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SelectedPlanConstraints.java
(original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SelectedPlanConstraints.java
Tue Aug 22 13:52:09 2006
@@ -22,20 +22,22 @@
 package org.apache.HarmonyDRLVM.mm.mmtk;
 
 import org.mmtk.plan.nogc.*;
+import org.mmtk.plan.marksweep.*;
 import org.vmmagic.pragma.*;
+import org.mmtk.plan.PlanConstraints;
 
 /**
  * This class extends the selected MMTk constraints class. 
  */
-public final class SelectedPlanConstraints extends NoGCConstraints
-  implements Uninterruptible {
 
-  public static final SelectedPlanConstraints singleton = new SelectedPlanConstraints();
-  
-  /**
-   * Return the instance of the SelectedPlan
-   */
-  public static final SelectedPlanConstraints get() throws InlinePragma {
-    return singleton;
-  }
+public final class SelectedPlanConstraints implements Uninterruptible 
+{
+    //public static final PlanConstraints singleton = new NoGCConstraints();
+    public static final PlanConstraints singleton = new MSConstraints();
+
+    public static final PlanConstraints get() throws InlinePragma 
+    {
+        return singleton;
+    }
 }
+

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Strings.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Strings.java?rev=433748&r1=433747&r2=433748&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Strings.java
(original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/Strings.java
Tue Aug 22 13:52:09 2006
@@ -36,9 +36,12 @@
   public final void write(char [] c, int len) {
       for (int xx=0; xx < c.length; xx++) 
       {
-        System.out.print(c[xx]);    
+        System.out.print(c[xx]);
+        int zz = (int)c[xx];
+        if (zz == 0) break;
       }
       System.out.println("");
+      for (int xx=0; xx < c.length; xx++) c[xx] = 0;
   }
 
   /**
@@ -50,9 +53,12 @@
   public final void writeThreadId(char [] c, int len) {
       for (int xx=0; xx < c.length; xx++) 
       {
-          System.out.print(c[xx]);    
+          System.out.print(c[xx]); 
+          int zz = (int)c[xx];
+          if (zz == 0) break;
       }
-      System.out.println("");    
+      System.out.println("");
+      for (int xx=0; xx < c.length; xx++) c[xx] = 0;
   }
 
   /**
@@ -72,18 +78,14 @@
   public final int copyStringToChars(String src, char [] dst,
                                      int dstBegin, int dstEnd)
     throws LogicallyUninterruptiblePragma {
-      /*
-    if (VM.runningVM)
-      VM_Processor.getCurrentProcessor().disableThreadSwitching();
+  
+    
     int len = src.length();
     int n = (dstBegin + len <= dstEnd) ? len : (dstEnd - dstBegin);
-    for (int i = 0; i < n; i++) 
-      Barriers.setArrayNoBarrierStatic(dst, dstBegin + i, src.charAt(i));
-    if (VM.runningVM)
-      VM_Processor.getCurrentProcessor().enableThreadSwitching();
+      for (int i = 0; i < n; i++) 
+      {
+          Barriers.setArrayNoBarrierStatic(dst, dstBegin + i, src.charAt(i));
+      }
     return n;
-    */
-      System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.Strings.copyStringToChars()");
-      return 0;
   }
 }

Modified: incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SynchronizedCounter.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SynchronizedCounter.java?rev=433748&r1=433747&r2=433748&view=diff
==============================================================================
--- incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SynchronizedCounter.java
(original)
+++ incubator/harmony/enhanced/drlvm/trunk/vm/MMTk/ext/vm/HarmonyDRLVM/org/apache/HarmonyDRLVM/mm/mmtk/SynchronizedCounter.java
Tue Aug 22 13:52:09 2006
@@ -25,6 +25,7 @@
 
 import org.vmmagic.pragma.*;
 import org.vmmagic.unboxed.Offset;
+import org.mmtk.vm.*;
 
 /**
  * A counter that supports atomic increment and reset.
@@ -39,7 +40,7 @@
 
   public static void boot() {
     //offset = VM_Entrypoints.synchronizedCounterField.getOffset();
-      System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.SynchronizedCounter.boot()");
+      //System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.SynchronizedCounter.boot() --
fix VM_Entrypoints...");
   }
 
   private int count = 0;
@@ -55,8 +56,13 @@
     }
     return oldValue;
     */
-    System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.SynchronizedCounter.reset()");
-      return 0;
+    int oldValue = count;  // unsynchronized access for now, single thread operation only
+    count = 0;
+    //System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.SynchronizedCounter.reset() oldValue
= " + oldValue);
+      //return 0;
+
+ 
+      return oldValue;
   }
 
   // Returns the value before the add
@@ -64,14 +70,19 @@
   public int increment() {
     //if (VM.VerifyAssertions) VM._assert(!offset.isMax());
     //return VM_Synchronization.fetchAndAdd(this, offset, 1);
-    System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.SynchronizedCounter.increment()");
-    return 0;
+      //VM.assertions._assert(false);
+    //return 0;
+
+    int oldValue = count;
+    count++;
+      //if (count == 1)
+            //System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.SynchronizedCounter.increment()
oldValue = " + oldValue);
+    return oldValue;
   }
 
   public int peek () {
-    //return count;
-    System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.SynchronizedCounter.peek()");
-      return 0;
+    //System.out.println("org.apache.HarmonyDRLVM.mm.mmtk.SynchronizedCounter.peek() count
= " + count);
+    return count;
   }
 
 }



Mime
View raw message