diff --git a/MMTk/src/org/mmtk/plan/Plan.java b/MMTk/src/org/mmtk/plan/Plan.java index a9f556242..fa5ed387c 100644 --- a/MMTk/src/org/mmtk/plan/Plan.java +++ b/MMTk/src/org/mmtk/plan/Plan.java @@ -129,7 +129,6 @@ public abstract class Plan implements Constants { public static final LargeObjectSpace largeCodeSpace = USE_CODE_SPACE ? new LargeObjectSpace("lg-code", VMRequest.discontiguous()) : null; public static int pretenureThreshold = Integer.MAX_VALUE; - public static int stwTrigger = 0; /* Space descriptors */ public static final int IMMORTAL = immortalSpace.getDescriptor(); @@ -175,7 +174,6 @@ public Plan() { Options.variableSizeHeap = new VariableSizeHeap(); Options.eagerMmapSpaces = new EagerMmapSpaces(); Options.sanityCheck = new SanityCheck(); - Options.stwTrigger = new STWTrigger(); Options.debugAddress = new DebugAddress(); Options.perfEvents = new PerfEvents(); Options.useReturnBarrier = new UseReturnBarrier(); @@ -234,7 +232,6 @@ public void processOptions() { if (Options.verbose.getValue() > 0) Stats.startAll(); if (Options.eagerMmapSpaces.getValue()) Space.eagerlyMmapMMTkSpaces(); pretenureThreshold = (int) ((Options.nurserySize.getMaxNursery()< 0) { - heapFull = getPagesReserved() > stwTrigger; - } else { - heapFull = getPagesReserved() > getTotalPages(); - } + boolean heapFull = getPagesReserved() > getTotalPages(); return spaceFull || stressForceGC || heapFull; } diff --git a/MMTk/src/org/mmtk/plan/otfsapphire/OTFSapphire.java b/MMTk/src/org/mmtk/plan/otfsapphire/OTFSapphire.java index 8e6040cd2..3d4131129 100644 --- a/MMTk/src/org/mmtk/plan/otfsapphire/OTFSapphire.java +++ b/MMTk/src/org/mmtk/plan/otfsapphire/OTFSapphire.java @@ -19,7 +19,6 @@ import org.mmtk.policy.Space; import org.mmtk.plan.*; import org.mmtk.plan.onthefly.OnTheFly; -import org.mmtk.utility.Conversions; import org.mmtk.utility.Log; import org.mmtk.utility.alloc.Allocator; import org.mmtk.utility.alloc.BumpPointer; @@ -488,7 +487,6 @@ public void scan(ObjectReference object, boolean live, Address cellAddress, Exte public OTFSapphireCopyScan copyScan; private int concurrentTriggerMethod; private int concurrentTrigger; - private int stwTrigger = 0; private int lastCollectionUsedPages = 0; private long lastCollectionStartTime = 0; private long lastCollectionCompleteTime = 0; @@ -726,7 +724,6 @@ public void collectionPhase(short phaseId) { if (phaseId == RELEASE_FLIP) { if (VM.VERIFY_ASSERTIONS) assert_TO_SPLACE_LOCAL_IS_EMPTY = true; - printHeapUsage(); low = !low; // flip the semi-spaces toSpace().release(); OTFSapphire.tackOnLock.acquire(); @@ -757,13 +754,6 @@ public void collectionPhase(short phaseId) { super.collectionPhase(phaseId); } - protected void printHeapUsage() { - Log.write("->"); Log.write(Conversions.pagesToKBytes(getPagesUsed())); Log.write(" KB"); - Log.write(" (From = "); Log.write(Conversions.pagesToKBytes(fromSpace().reservedPages())); - Log.write(" KB To = "); Log.write(Conversions.pagesToKBytes(toSpace().reservedPages())); - Log.write(" KB Other = "); Log.write(Conversions.pagesToKBytes(super.getPagesUsed())); Log.write(" KB) "); - } - @Override @Inline protected boolean collectorHasWork() { @@ -799,11 +789,7 @@ protected int getWeakReferenceTerminationLoopPhase() { */ public final int getCollectionReserve() { // our copy reserve is the size of fromSpace less any copying we have done so far - if (stwTrigger == 0) { - return (fromSpace().reservedPages() - toSpace().reservedPages()) + super.getCollectionReserve(); - } else { - return super.getCollectionReserve(); - } + return fromSpace().reservedPages() + super.getCollectionReserve(); } /** @@ -1027,7 +1013,6 @@ public void processOptions() { copyScanSTW = new OTFSapphireCopyScan.CopyScanUnsafe2(flipRootTrace); concurrentTriggerMethod = Options.concurrentTriggerMethod.method(); concurrentTrigger = Options.concurrentTrigger.getValueForMethod(concurrentTriggerMethod); - stwTrigger = Options.stwTrigger.getValue(); if (MERGE_REPLICATE_PHASE) Log.writeln("Option: MERGE_REPLICATE_PHASE"); if (REPLICATE_WITH_CAS) Log.writeln("Option: REPLICATE_WITH_CAS"); diff --git a/MMTk/src/org/mmtk/plan/otfsapphire/OTFSapphireConstraints.java b/MMTk/src/org/mmtk/plan/otfsapphire/OTFSapphireConstraints.java index e04b9745b..b06e7c0ad 100644 --- a/MMTk/src/org/mmtk/plan/otfsapphire/OTFSapphireConstraints.java +++ b/MMTk/src/org/mmtk/plan/otfsapphire/OTFSapphireConstraints.java @@ -33,7 +33,7 @@ public int gcHeaderWords() { public int numSpecializedScans() { return 0; } @Override - public int maxNonLOSDefaultAllocBytes() { return !OTFSapphire.NO_LOS ? BYTES_IN_PAGE * 32: org.mmtk.utility.Constants.MAX_INT; } + public int maxNonLOSDefaultAllocBytes() { return !OTFSapphire.NO_LOS ? BYTES_IN_PAGE : org.mmtk.utility.Constants.MAX_INT; } // LPJH: later implement bulkCopy support diff --git a/MMTk/src/org/mmtk/plan/otfsapphire/OTFSapphireMutator.java b/MMTk/src/org/mmtk/plan/otfsapphire/OTFSapphireMutator.java index 553c76369..4365936a0 100644 --- a/MMTk/src/org/mmtk/plan/otfsapphire/OTFSapphireMutator.java +++ b/MMTk/src/org/mmtk/plan/otfsapphire/OTFSapphireMutator.java @@ -117,9 +117,6 @@ final void setupBarrier() { protected ReplicatingSpace fromSpace; private Address fromSpaceReplica = Address.zero(); - private boolean inGC = false; - private int allocInGC = 0; - /**************************************************************************** * * Initialization @@ -242,8 +239,6 @@ public int checkAllocator(int bytes, int align, int allocator) { @Inline public Address alloc(int bytes, int align, int offset, int allocator, int site) { Address addy; - if (inGC) - allocInGC += bytes; if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(fromSpaceReplica.isZero()); if (allocator == OTFSapphire.ALLOC_REPLICATING) { addy = fromSpaceLocal.alloc(bytes, align, offset); // may cause GC @@ -432,8 +427,6 @@ public void collectionPhase(short phaseId, boolean primary) { if (!prepared) super.collectionPhase(Simple.PREPARE, primary); prepared = false; - allocInGC = 0; - inGC = true; return; } @@ -585,11 +578,6 @@ public void collectionPhase(short phaseId, boolean primary) { setupBarrier(); if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!barrierEnable()); super.collectionPhase(Simple.RELEASE, primary); - inGC = false; - if (allocInGC > 0) { - Log.writeln("allocInGC ", allocInGC); - allocInGC = 0; - } return; } diff --git a/MMTk/src/org/mmtk/utility/options/Options.java b/MMTk/src/org/mmtk/utility/options/Options.java index 997dda134..e6349d0cc 100644 --- a/MMTk/src/org/mmtk/utility/options/Options.java +++ b/MMTk/src/org/mmtk/utility/options/Options.java @@ -62,7 +62,6 @@ public final class Options { public static SanityCheck sanityCheck; public static SapphireSTWPhase sapphireSTWPhase; public static StressFactor stressFactor; - public static STWTrigger stwTrigger; public static Threads threads; public static TraceRate traceRate; public static UseReturnBarrier useReturnBarrier; diff --git a/tools/bootImageRunner/sys.C b/tools/bootImageRunner/sys.C index 493077d4c..7e1bd11ff 100644 --- a/tools/bootImageRunner/sys.C +++ b/tools/bootImageRunner/sys.C @@ -145,9 +145,6 @@ extern "C" void sysMonitorTimedWait(Word, long long); extern "C" void sysMonitorWait(Word); extern "C" void sysMonitorBroadcast(Word); -static void* checkMalloc(int); -static void checkFree(void*); - // #define DEBUG_SYS // #define DEBUG_THREAD @@ -1029,7 +1026,7 @@ sysThreadCreate(Address tr, Address ip, Address fp) // create arguments // - sysThreadArguments = (Address*) checkMalloc(sizeof(Address) * 3); + sysThreadArguments = new Address[3]; sysThreadArguments[0] = tr; sysThreadArguments[1] = ip; sysThreadArguments[2] = fp; @@ -1137,7 +1134,7 @@ sysThreadStartup(void *args) char *stackBuf; memset (&stack, 0, sizeof stack); - stack.ss_sp = stackBuf = (char*) checkMalloc(sizeof(char) * SIGSTKSZ); + stack.ss_sp = stackBuf = new char[SIGSTKSZ]; stack.ss_flags = 0; stack.ss_size = SIGSTKSZ; if (sigaltstack (&stack, 0)) { @@ -1147,18 +1144,18 @@ sysThreadStartup(void *args) Address tr = ((Address *)args)[0]; - jmp_buf *jb = (jmp_buf*)checkMalloc(sizeof(jmp_buf)); + jmp_buf *jb = (jmp_buf*)malloc(sizeof(jmp_buf)); if (setjmp(*jb)) { // this is where we come to terminate the thread #ifdef RVM_FOR_HARMONY hythread_detach(NULL); #endif - checkFree(jb); + free(jb); *(int*)(tr + RVMThread_execStatus_offset) = RVMThread_TERMINATED; stack.ss_flags = SS_DISABLE; sigaltstack(&stack, 0); - checkFree(stackBuf); + delete[] stackBuf; } else { setThreadLocal(TerminateJmpBufKey, (void*)jb); @@ -1245,7 +1242,7 @@ sysSetupHardwareTrapHandler() stack_t stack; memset (&stack, 0, sizeof stack); - stack.ss_sp = (char*) checkMalloc(sizeof(char) * SIGSTKSZ); + stack.ss_sp = new char[SIGSTKSZ]; stack.ss_size = SIGSTKSZ; if (sigaltstack (&stack, 0)) { @@ -1420,7 +1417,7 @@ sysMonitorCreate() hythread_monitor_t monitor; hythread_monitor_init_with_name(&monitor, 0, NULL); #else - vmmonitor_t *monitor = (vmmonitor_t*) checkMalloc(sizeof(vmmonitor_t)); + vmmonitor_t *monitor = new vmmonitor_t; pthread_mutex_init(&monitor->mutex, NULL); pthread_cond_init(&monitor->cond, NULL); #endif @@ -1436,7 +1433,7 @@ sysMonitorDestroy(Word _monitor) vmmonitor_t *monitor = (vmmonitor_t*)_monitor; pthread_mutex_destroy(&monitor->mutex); pthread_cond_destroy(&monitor->cond); - checkFree(monitor); + delete monitor; #endif } @@ -1735,8 +1732,10 @@ sysMemmove(void *dst, const void *src, Extent cnt) int inRVMAddressSpace(Address a); -static void* -checkMalloc(int length) +// Allocate memory. +// +extern "C" void * +sysMalloc(int length) { void *result=malloc(length); if (inRVMAddressSpace((Address)result)) { @@ -1745,20 +1744,6 @@ checkMalloc(int length) return result; } -static void -checkFree(void* mem) -{ - free(mem); -} - -// Allocate memory. -// -extern "C" void * -sysMalloc(int length) -{ - return checkMalloc(length); -} - extern "C" void * sysCalloc(int length) { @@ -1770,7 +1755,7 @@ sysCalloc(int length) extern "C" void sysFree(void *location) { - checkFree(location); + free(location); } // Zero a range of memory with non-temporal instructions on x86