├── CREDITS.TXT ├── LICENSE.TXT ├── Makefile ├── Makefile.common.in ├── Makefile.rules ├── README.TXT ├── autoconf ├── .gitignore ├── AutoRegen.sh ├── config.guess ├── config.sub ├── configure.ac └── install-sh ├── configure ├── docs └── index.html ├── include ├── debug.h ├── j3 │ ├── J3Intrinsics.h │ ├── JavaAOTCompiler.h │ ├── JavaCompiler.h │ ├── JavaJITCompiler.h │ ├── JavaLLVMCompiler.h │ ├── LLVMInfo.h │ ├── OpcodeNames.def │ ├── jni.h │ ├── jni_md.h │ └── openjdk │ │ └── jvm.h ├── types.h └── vmkit │ ├── Allocator.h │ ├── CollectionRV.h │ ├── Cond.h │ ├── FinalizerThread.h │ ├── GC.h │ ├── InlineCommon.h │ ├── JIT.h │ ├── Locks.h │ ├── MethodInfo.h │ ├── ObjectLocks.h │ ├── ReferenceThread.h │ ├── System.h │ ├── Thread.h │ ├── UTF8.h │ ├── VirtualMachine.h │ ├── VmkitDenseMap.h │ ├── VmkitDenseSet.h │ ├── config.h.in │ └── config.h.in.orig ├── lib ├── Makefile ├── j3 │ ├── ClassLib │ │ ├── ArrayCopy.inc │ │ ├── ClassContext.inc │ │ ├── Classpath.h.in │ │ ├── ClasspathConstructor.inc │ │ ├── ClasspathField.inc │ │ ├── ClasspathMethod.inc │ │ ├── DefineClass.inc │ │ ├── GNUClasspath │ │ │ ├── Classpath.inc │ │ │ ├── ClasspathReflect.cpp │ │ │ ├── ClasspathReflect.h │ │ │ ├── ClasspathVMClass.inc │ │ │ ├── ClasspathVMClassLoader.inc │ │ │ ├── ClasspathVMConstructor.inc │ │ │ ├── ClasspathVMField.inc │ │ │ ├── ClasspathVMMethod.inc │ │ │ ├── ClasspathVMObject.inc │ │ │ ├── ClasspathVMRuntime.inc │ │ │ ├── ClasspathVMStackWalker.inc │ │ │ ├── ClasspathVMSystem.inc │ │ │ ├── ClasspathVMSystemProperties.inc │ │ │ ├── ClasspathVMThread.inc │ │ │ ├── ClasspathVMThrowable.inc │ │ │ ├── GNuClasspathUnsafe.inc │ │ │ ├── JavaUpcalls.cpp │ │ │ ├── JavaUpcalls.h │ │ │ └── Makefile │ │ ├── Makefile │ │ ├── OpenJDK │ │ │ ├── ClasspathReflect.cpp │ │ │ ├── ClasspathReflect.h │ │ │ ├── JavaUpcalls.cpp │ │ │ ├── JavaUpcalls.h │ │ │ ├── Makefile │ │ │ ├── OpenJDK.inc │ │ │ ├── UnsafeForOpenJDK.inc │ │ │ └── java │ │ │ │ └── lang │ │ │ │ └── VMString.java │ │ ├── Reflect.inc │ │ ├── SetProperties.inc │ │ ├── Unsafe.inc │ │ └── VMStaticInstance.h │ ├── Compiler │ │ ├── EscapeAnalysis.cpp │ │ ├── J3Intrinsics.cpp │ │ ├── JavaAOTCompiler.cpp │ │ ├── JavaJIT.cpp │ │ ├── JavaJIT.h │ │ ├── JavaJITClasspath.inc │ │ ├── JavaJITCompiler.cpp │ │ ├── JavaJITOpcodes.cpp │ │ ├── JavaJITOpenJDK.inc │ │ ├── JavaLLVMCompiler.cpp │ │ ├── LLVMInfo.cpp │ │ ├── LowerConstantCalls.cpp │ │ └── Makefile │ ├── LLVMRuntime │ │ ├── Makefile │ │ ├── runtime-default.ll │ │ ├── runtime-mmtk-thread.ll │ │ └── runtime-single.ll │ ├── Makefile │ ├── README.txt │ └── VMCore │ │ ├── JNIReferences.h │ │ ├── JavaAccess.h │ │ ├── JavaArray.cpp │ │ ├── JavaArray.h │ │ ├── JavaClass.cpp │ │ ├── JavaClass.h │ │ ├── JavaConstantPool.cpp │ │ ├── JavaConstantPool.h │ │ ├── JavaMetaJIT.cpp │ │ ├── JavaObject.cpp │ │ ├── JavaObject.h │ │ ├── JavaReferenceQueue.cpp │ │ ├── JavaReferenceQueue.h │ │ ├── JavaRuntimeJIT.cpp │ │ ├── JavaString.cpp │ │ ├── JavaString.h │ │ ├── JavaThread.cpp │ │ ├── JavaThread.h │ │ ├── JavaTypes.cpp │ │ ├── JavaTypes.h │ │ ├── Jni.cpp │ │ ├── JniClasspath.inc │ │ ├── JniOpenJDK.inc │ │ ├── Jnjvm.cpp │ │ ├── Jnjvm.h │ │ ├── JnjvmClassLoader.cpp │ │ ├── JnjvmClassLoader.h │ │ ├── JnjvmConfig.h │ │ ├── LinkJavaRuntime.h │ │ ├── LockedMap.h │ │ ├── Makefile │ │ ├── Precompiled.cpp │ │ ├── Reader.cpp │ │ ├── Reader.h │ │ ├── UTF8.h │ │ ├── VirtualTables.cpp │ │ ├── Zip.cpp │ │ └── Zip.h ├── static-gc-pass │ ├── Makefile │ └── StaticGCPass.cpp ├── static-gc-printer │ ├── Makefile │ └── VmkitGCPrinter.cpp └── vmkit │ ├── CommonThread │ ├── CollectionRV.cpp │ ├── Makefile │ ├── ObjectLocks.cpp │ ├── Sigsegv-linux-x64.inc │ ├── Sigsegv-linux-x86.inc │ ├── Sigsegv-macos-x64.inc │ ├── Sigsegv.cpp │ ├── ctlock.cpp │ └── ctthread.cpp │ ├── Compiler │ ├── Disassembler.cpp │ ├── InlineMalloc.cpp │ ├── JIT.cpp │ ├── LLVMRuntime.ll │ ├── Makefile │ └── VmkitGC.cpp │ ├── JITGCPass │ ├── JITGCPass.cpp │ └── Makefile │ ├── MMTk │ ├── Makefile │ ├── MutatorThread.h │ ├── VmkitGC.cpp │ └── VmkitGC.h │ ├── Makefile │ └── Runtime │ ├── Makefile │ ├── MethodInfo.cpp │ ├── Object.cpp │ └── UTF8.cpp ├── mmtk ├── LICENSE.html ├── Makefile ├── inline │ └── InlineMethods.cpp ├── java │ ├── Makefile │ ├── build.xml.in │ ├── src │ │ └── org │ │ │ ├── j3 │ │ │ ├── bindings │ │ │ │ └── Bindings.java │ │ │ ├── config │ │ │ │ └── Selected.java.in │ │ │ ├── mmtk │ │ │ │ ├── ActivePlan.java │ │ │ │ ├── Assert.java │ │ │ │ ├── Barriers.java │ │ │ │ ├── BuildTimeConfig.java │ │ │ │ ├── Collection.java │ │ │ │ ├── Debug.java │ │ │ │ ├── Factory.java │ │ │ │ ├── FinalizableProcessor.java │ │ │ │ ├── Lock.java │ │ │ │ ├── MMTk_Events.java │ │ │ │ ├── Memory.java │ │ │ │ ├── ObjectModel.java │ │ │ │ ├── ReferenceProcessor.java │ │ │ │ ├── Scanning.java │ │ │ │ ├── Statistics.java │ │ │ │ ├── Strings.java │ │ │ │ ├── SynchronizedCounter.java │ │ │ │ └── TraceInterface.java │ │ │ ├── options │ │ │ │ └── OptionSet.java │ │ │ └── runtime │ │ │ │ └── VM.java │ │ │ ├── jikesrvm │ │ │ ├── Magic.java │ │ │ └── SizeConstants.java │ │ │ ├── mmtk │ │ │ ├── plan │ │ │ │ ├── CollectorContext.java │ │ │ │ ├── ComplexPhase.java │ │ │ │ ├── GCspyPlan.java │ │ │ │ ├── MutatorContext.java │ │ │ │ ├── Phase.java │ │ │ │ ├── Plan.java │ │ │ │ ├── PlanConstraints.java │ │ │ │ ├── Simple.java │ │ │ │ ├── SimpleCollector.java │ │ │ │ ├── SimpleConstraints.java │ │ │ │ ├── SimpleMutator.java │ │ │ │ ├── SimplePhase.java │ │ │ │ ├── StopTheWorld.java │ │ │ │ ├── StopTheWorldCollector.java │ │ │ │ ├── StopTheWorldConstraints.java │ │ │ │ ├── StopTheWorldMutator.java │ │ │ │ ├── Trace.java │ │ │ │ ├── TraceLocal.java │ │ │ │ ├── TraceWriteBuffer.java │ │ │ │ ├── TransitiveClosure.java │ │ │ │ ├── copyms │ │ │ │ │ ├── CopyMS.java │ │ │ │ │ ├── CopyMSCollector.java │ │ │ │ │ ├── CopyMSConstraints.java │ │ │ │ │ ├── CopyMSMutator.java │ │ │ │ │ └── CopyMSTraceLocal.java │ │ │ │ ├── generational │ │ │ │ │ ├── Gen.java │ │ │ │ │ ├── GenCollector.java │ │ │ │ │ ├── GenConstraints.java │ │ │ │ │ ├── GenMatureTraceLocal.java │ │ │ │ │ ├── GenMutator.java │ │ │ │ │ ├── GenNurseryTraceLocal.java │ │ │ │ │ ├── copying │ │ │ │ │ │ ├── GenCopy.java │ │ │ │ │ │ ├── GenCopyCollector.java │ │ │ │ │ │ ├── GenCopyConstraints.java │ │ │ │ │ │ ├── GenCopyMatureTraceLocal.java │ │ │ │ │ │ └── GenCopyMutator.java │ │ │ │ │ ├── immix │ │ │ │ │ │ ├── GenImmix.java │ │ │ │ │ │ ├── GenImmixCollector.java │ │ │ │ │ │ ├── GenImmixConstraints.java │ │ │ │ │ │ ├── GenImmixMatureDefragTraceLocal.java │ │ │ │ │ │ ├── GenImmixMatureTraceLocal.java │ │ │ │ │ │ └── GenImmixMutator.java │ │ │ │ │ └── marksweep │ │ │ │ │ │ ├── GenMS.java │ │ │ │ │ │ ├── GenMSCollector.java │ │ │ │ │ │ ├── GenMSConstraints.java │ │ │ │ │ │ ├── GenMSMatureTraceLocal.java │ │ │ │ │ │ └── GenMSMutator.java │ │ │ │ ├── immix │ │ │ │ │ ├── Immix.java │ │ │ │ │ ├── ImmixCollector.java │ │ │ │ │ ├── ImmixConstraints.java │ │ │ │ │ ├── ImmixDefragTraceLocal.java │ │ │ │ │ ├── ImmixMutator.java │ │ │ │ │ └── ImmixTraceLocal.java │ │ │ │ ├── markcompact │ │ │ │ │ ├── MC.java │ │ │ │ │ ├── MCCollector.java │ │ │ │ │ ├── MCConstraints.java │ │ │ │ │ ├── MCForwardTraceLocal.java │ │ │ │ │ ├── MCMarkTraceLocal.java │ │ │ │ │ └── MCMutator.java │ │ │ │ ├── marksweep │ │ │ │ │ ├── MS.java │ │ │ │ │ ├── MSCollector.java │ │ │ │ │ ├── MSConstraints.java │ │ │ │ │ ├── MSMutator.java │ │ │ │ │ └── MSTraceLocal.java │ │ │ │ ├── nogc │ │ │ │ │ ├── NoGC.java │ │ │ │ │ ├── NoGCCollector.java │ │ │ │ │ ├── NoGCConstraints.java │ │ │ │ │ ├── NoGCMutator.java │ │ │ │ │ └── NoGCTraceLocal.java │ │ │ │ ├── poisoned │ │ │ │ │ ├── Poisoned.java │ │ │ │ │ ├── PoisonedCollector.java │ │ │ │ │ ├── PoisonedConstraints.java │ │ │ │ │ └── PoisonedMutator.java │ │ │ │ ├── refcount │ │ │ │ │ ├── RCBase.java │ │ │ │ │ ├── RCBaseCollector.java │ │ │ │ │ ├── RCBaseConstraints.java │ │ │ │ │ ├── RCBaseMutator.java │ │ │ │ │ ├── RCDecBuffer.java │ │ │ │ │ ├── RCHeader.java │ │ │ │ │ ├── RCZero.java │ │ │ │ │ ├── backuptrace │ │ │ │ │ │ ├── BTDecMarked.java │ │ │ │ │ │ ├── BTDecMarkedAndZero.java │ │ │ │ │ │ ├── BTFreeLargeObjectSweeper.java │ │ │ │ │ │ ├── BTScanLargeObjectSweeper.java │ │ │ │ │ │ ├── BTSweepImmortalScanner.java │ │ │ │ │ │ ├── BTSweeper.java │ │ │ │ │ │ └── BTTraceLocal.java │ │ │ │ │ ├── fullheap │ │ │ │ │ │ ├── RC.java │ │ │ │ │ │ ├── RCCollector.java │ │ │ │ │ │ ├── RCConstraints.java │ │ │ │ │ │ ├── RCFindRootSetTraceLocal.java │ │ │ │ │ │ ├── RCModifiedProcessor.java │ │ │ │ │ │ └── RCMutator.java │ │ │ │ │ └── generational │ │ │ │ │ │ ├── GenRC.java │ │ │ │ │ │ ├── GenRCCollector.java │ │ │ │ │ │ ├── GenRCConstraints.java │ │ │ │ │ │ ├── GenRCFindRootSetTraceLocal.java │ │ │ │ │ │ ├── GenRCModifiedProcessor.java │ │ │ │ │ │ └── GenRCMutator.java │ │ │ │ ├── semispace │ │ │ │ │ ├── SS.java │ │ │ │ │ ├── SSCollector.java │ │ │ │ │ ├── SSConstraints.java │ │ │ │ │ ├── SSMutator.java │ │ │ │ │ ├── SSTraceLocal.java │ │ │ │ │ ├── gcspy │ │ │ │ │ │ ├── SSGCspy.java │ │ │ │ │ │ ├── SSGCspyCollector.java │ │ │ │ │ │ ├── SSGCspyConstraints.java │ │ │ │ │ │ ├── SSGCspyMutator.java │ │ │ │ │ │ └── SSGCspyTraceLocal.java │ │ │ │ │ ├── gctrace │ │ │ │ │ │ ├── GCTrace.java │ │ │ │ │ │ ├── GCTraceCollector.java │ │ │ │ │ │ ├── GCTraceConstraints.java │ │ │ │ │ │ ├── GCTraceMutator.java │ │ │ │ │ │ └── GCTraceTraceLocal.java │ │ │ │ │ └── usePrimitiveWriteBarriers │ │ │ │ │ │ ├── UsePrimitiveWriteBarriers.java │ │ │ │ │ │ ├── UsePrimitiveWriteBarriersCollector.java │ │ │ │ │ │ ├── UsePrimitiveWriteBarriersConstraints.java │ │ │ │ │ │ └── UsePrimitiveWriteBarriersMutator.java │ │ │ │ ├── stickyimmix │ │ │ │ │ ├── StickyImmix.java │ │ │ │ │ ├── StickyImmixCollector.java │ │ │ │ │ ├── StickyImmixConstraints.java │ │ │ │ │ ├── StickyImmixMutator.java │ │ │ │ │ └── StickyImmixNurseryTraceLocal.java │ │ │ │ └── stickyms │ │ │ │ │ ├── StickyMS.java │ │ │ │ │ ├── StickyMSCollector.java │ │ │ │ │ ├── StickyMSConstraints.java │ │ │ │ │ ├── StickyMSMutator.java │ │ │ │ │ └── StickyMSNurseryTraceLocal.java │ │ │ ├── policy │ │ │ │ ├── BaseLargeObjectSpace.java │ │ │ │ ├── CopyLocal.java │ │ │ │ ├── CopySpace.java │ │ │ │ ├── ExplicitFreeListLocal.java │ │ │ │ ├── ExplicitFreeListSpace.java │ │ │ │ ├── ExplicitLargeObjectSpace.java │ │ │ │ ├── ImmortalLocal.java │ │ │ │ ├── ImmortalSpace.java │ │ │ │ ├── LargeObjectLocal.java │ │ │ │ ├── LargeObjectSpace.java │ │ │ │ ├── MarkCompactCollector.java │ │ │ │ ├── MarkCompactLocal.java │ │ │ │ ├── MarkCompactSpace.java │ │ │ │ ├── MarkSweepLocal.java │ │ │ │ ├── MarkSweepSpace.java │ │ │ │ ├── RawPageSpace.java │ │ │ │ ├── SegregatedFreeListSpace.java │ │ │ │ ├── Space.java │ │ │ │ └── immix │ │ │ │ │ ├── Block.java │ │ │ │ │ ├── Chunk.java │ │ │ │ │ ├── ChunkList.java │ │ │ │ │ ├── CollectorLocal.java │ │ │ │ │ ├── Defrag.java │ │ │ │ │ ├── ImmixConstants.java │ │ │ │ │ ├── ImmixSpace.java │ │ │ │ │ ├── Line.java │ │ │ │ │ ├── MutatorLocal.java │ │ │ │ │ └── ObjectHeader.java │ │ │ ├── utility │ │ │ │ ├── BaseGenericFreeList.java │ │ │ │ ├── CallSite.java │ │ │ │ ├── Constants.java │ │ │ │ ├── Conversions.java │ │ │ │ ├── CycleDetector.java │ │ │ │ ├── DoublyLinkedList.java │ │ │ │ ├── ForwardingWord.java │ │ │ │ ├── GenericFreeList.java │ │ │ │ ├── HeaderByte.java │ │ │ │ ├── Log.java │ │ │ │ ├── Memory.java │ │ │ │ ├── SimpleHashtable.java │ │ │ │ ├── Synchronize.java │ │ │ │ ├── TraceGenerator.java │ │ │ │ ├── TracingConstants.java │ │ │ │ ├── Treadmill.java │ │ │ │ ├── alloc │ │ │ │ │ ├── Allocator.java │ │ │ │ │ ├── BlockAllocator.java │ │ │ │ │ ├── BumpPointer.java │ │ │ │ │ ├── DumpLinearScan.java │ │ │ │ │ ├── EmbeddedMetaData.java │ │ │ │ │ ├── ImmixAllocator.java │ │ │ │ │ ├── LargeObjectAllocator.java │ │ │ │ │ ├── LinearScan.java │ │ │ │ │ ├── SegregatedFreeList.java │ │ │ │ │ └── SegregatedFreeListLocal.java │ │ │ │ ├── deque │ │ │ │ │ ├── AddressDeque.java │ │ │ │ │ ├── AddressPairDeque.java │ │ │ │ │ ├── AddressTripleDeque.java │ │ │ │ │ ├── Deque.java │ │ │ │ │ ├── LocalDeque.java │ │ │ │ │ ├── LocalQueue.java │ │ │ │ │ ├── LocalSSB.java │ │ │ │ │ ├── ObjectReferenceBuffer.java │ │ │ │ │ ├── ObjectReferenceDeque.java │ │ │ │ │ ├── SharedDeque.java │ │ │ │ │ ├── SortSharedDeque.java │ │ │ │ │ ├── SortTODAddressStack.java │ │ │ │ │ ├── SortTODObjectReferenceStack.java │ │ │ │ │ ├── SortTODSharedDeque.java │ │ │ │ │ ├── TraceBuffer.java │ │ │ │ │ └── WriteBuffer.java │ │ │ │ ├── gcspy │ │ │ │ │ ├── Color.java │ │ │ │ │ ├── GCspy.java │ │ │ │ │ ├── LinearScan.java │ │ │ │ │ ├── StreamConstants.java │ │ │ │ │ ├── Subspace.java │ │ │ │ │ └── drivers │ │ │ │ │ │ ├── AbstractDriver.java │ │ │ │ │ │ ├── GenImmortalSpaceDriver.java │ │ │ │ │ │ ├── GenLOSDriver.java │ │ │ │ │ │ ├── ImmortalSpaceDriver.java │ │ │ │ │ │ ├── LinearSpaceDriver.java │ │ │ │ │ │ └── TreadmillDriver.java │ │ │ │ ├── heap │ │ │ │ │ ├── FreeListPageResource.java │ │ │ │ │ ├── HeapGrowthManager.java │ │ │ │ │ ├── Map.java │ │ │ │ │ ├── Mmapper.java │ │ │ │ │ ├── MonotonePageResource.java │ │ │ │ │ ├── PageResource.java │ │ │ │ │ ├── SpaceDescriptor.java │ │ │ │ │ └── VMRequest.java │ │ │ │ ├── options │ │ │ │ │ ├── BoundedNursery.java │ │ │ │ │ ├── ConcurrentTrigger.java │ │ │ │ │ ├── CycleFilterThreshold.java │ │ │ │ │ ├── CycleMetaDataLimit.java │ │ │ │ │ ├── CycleTriggerThreshold.java │ │ │ │ │ ├── DebugAddress.java │ │ │ │ │ ├── DefragFreeHeadroom.java │ │ │ │ │ ├── DefragFreeHeadroomFraction.java │ │ │ │ │ ├── DefragHeadroom.java │ │ │ │ │ ├── DefragHeadroomFraction.java │ │ │ │ │ ├── DefragLineReuseRatio.java │ │ │ │ │ ├── DefragSimpleSpillThreshold.java │ │ │ │ │ ├── DefragStress.java │ │ │ │ │ ├── DummyEnum.java │ │ │ │ │ ├── EagerCompleteSweep.java │ │ │ │ │ ├── EagerMmapSpaces.java │ │ │ │ │ ├── EchoOptions.java │ │ │ │ │ ├── FixedNursery.java │ │ │ │ │ ├── FragmentationStats.java │ │ │ │ │ ├── FullHeapSystemGC.java │ │ │ │ │ ├── GCTimeCap.java │ │ │ │ │ ├── GCspyPort.java │ │ │ │ │ ├── GCspyTileSize.java │ │ │ │ │ ├── GCspyWait.java │ │ │ │ │ ├── GenCycleDetection.java │ │ │ │ │ ├── HarnessAll.java │ │ │ │ │ ├── IgnoreSystemGC.java │ │ │ │ │ ├── LineReuseRatio.java │ │ │ │ │ ├── MarkSweepMarkBits.java │ │ │ │ │ ├── MetaDataLimit.java │ │ │ │ │ ├── NoFinalizer.java │ │ │ │ │ ├── NoReferenceTypes.java │ │ │ │ │ ├── NurserySize.java │ │ │ │ │ ├── Options.java │ │ │ │ │ ├── PerfEvents.java │ │ │ │ │ ├── PrintPhaseStats.java │ │ │ │ │ ├── ProtectOnRelease.java │ │ │ │ │ ├── SanityCheck.java │ │ │ │ │ ├── StressFactor.java │ │ │ │ │ ├── TraceRate.java │ │ │ │ │ ├── VariableSizeHeap.java │ │ │ │ │ ├── Verbose.java │ │ │ │ │ ├── VerboseFragmentationStats.java │ │ │ │ │ ├── VerboseTiming.java │ │ │ │ │ └── XmlStats.java │ │ │ │ ├── sanitychecker │ │ │ │ │ ├── SanityChecker.java │ │ │ │ │ ├── SanityCheckerLocal.java │ │ │ │ │ ├── SanityDataTable.java │ │ │ │ │ ├── SanityLinearScan.java │ │ │ │ │ ├── SanityRootTraceLocal.java │ │ │ │ │ └── SanityTraceLocal.java │ │ │ │ └── statistics │ │ │ │ │ ├── BooleanCounter.java │ │ │ │ │ ├── Counter.java │ │ │ │ │ ├── EventCounter.java │ │ │ │ │ ├── LongCounter.java │ │ │ │ │ ├── PerfEvent.java │ │ │ │ │ ├── SizeCounter.java │ │ │ │ │ ├── Stats.java │ │ │ │ │ ├── Timer.java │ │ │ │ │ └── Xml.java │ │ │ └── vm │ │ │ │ ├── ActivePlan.java │ │ │ │ ├── Assert.java │ │ │ │ ├── Barriers.java │ │ │ │ ├── BuildTimeConfig.java │ │ │ │ ├── Collection.java │ │ │ │ ├── Config.java │ │ │ │ ├── Debug.java │ │ │ │ ├── Factory.java │ │ │ │ ├── FinalizableProcessor.java │ │ │ │ ├── Lock.java │ │ │ │ ├── MMTk_Events.java │ │ │ │ ├── Memory.java │ │ │ │ ├── ObjectModel.java │ │ │ │ ├── ReferenceProcessor.java │ │ │ │ ├── Scanning.java │ │ │ │ ├── Statistics.java │ │ │ │ ├── Strings.java │ │ │ │ ├── SynchronizedCounter.java │ │ │ │ ├── TraceInterface.java │ │ │ │ ├── VM.java │ │ │ │ └── gcspy │ │ │ │ ├── ByteStream.java │ │ │ │ ├── IntStream.java │ │ │ │ ├── ServerInterpreter.java │ │ │ │ ├── ServerSpace.java │ │ │ │ ├── ShortStream.java │ │ │ │ ├── Stream.java │ │ │ │ └── Util.java │ │ │ ├── vmmagic │ │ │ ├── Intrinsic.java │ │ │ ├── Pragma.java │ │ │ ├── Unboxed.java │ │ │ ├── pragma │ │ │ │ ├── BaselineNoRegisters.java │ │ │ │ ├── BaselineSaveLSRegisters.java │ │ │ │ ├── DynamicBridge.java │ │ │ │ ├── Entrypoint.java │ │ │ │ ├── Inline.java │ │ │ │ ├── Interruptible.java │ │ │ │ ├── LogicallyUninterruptible.java │ │ │ │ ├── NativeBridge.java │ │ │ │ ├── NoBoundsCheck.java │ │ │ │ ├── NoEscapes.java │ │ │ │ ├── NoInline.java │ │ │ │ ├── NoNullCheck.java │ │ │ │ ├── NoOptCompile.java │ │ │ │ ├── NonMoving.java │ │ │ │ ├── NonMovingAllocation.java │ │ │ │ ├── Preemptible.java │ │ │ │ ├── Pure.java │ │ │ │ ├── RawStorage.java │ │ │ │ ├── RuntimeFinal.java │ │ │ │ ├── RuntimePure.java │ │ │ │ ├── SaveVolatile.java │ │ │ │ ├── SpecializedMethodInvoke.java │ │ │ │ ├── SynchronizedObject.java │ │ │ │ ├── SysCallNative.java │ │ │ │ ├── Uninterruptible.java │ │ │ │ ├── UninterruptibleNoWarn.java │ │ │ │ ├── Unpreemptible.java │ │ │ │ ├── UnpreemptibleNoWarn.java │ │ │ │ └── Untraced.java │ │ │ └── unboxed │ │ │ │ ├── Address.java │ │ │ │ ├── AddressArray.java │ │ │ │ ├── Extent.java │ │ │ │ ├── ExtentArray.java │ │ │ │ ├── ObjectReference.java │ │ │ │ ├── ObjectReferenceArray.java │ │ │ │ ├── Offset.java │ │ │ │ ├── OffsetArray.java │ │ │ │ ├── Word.java │ │ │ │ └── WordArray.java │ │ │ └── vmutil │ │ │ └── options │ │ │ ├── AddressOption.java │ │ │ ├── BooleanOption.java │ │ │ ├── EnumOption.java │ │ │ ├── FloatOption.java │ │ │ ├── IntOption.java │ │ │ ├── MicrosecondsOption.java │ │ │ ├── Option.java │ │ │ ├── OptionSet.java │ │ │ ├── PagesOption.java │ │ │ └── StringOption.java │ └── vmkit.properties ├── magic │ ├── LowerJavaRT.cpp │ ├── LowerMagic.cpp │ └── Makefile ├── mmtk-alloc │ ├── Makefile │ └── Selected.cpp └── mmtk-j3 │ ├── ActivePlan.cpp │ ├── Assert.cpp │ ├── Collection.cpp │ ├── FinalizableProcessor.cpp │ ├── Lock.cpp │ ├── MMTkObject.h │ ├── MMTk_Events.cpp │ ├── Makefile │ ├── Memory.cpp │ ├── ObjectModel.cpp │ ├── ReferenceProcessor.cpp │ ├── RuntimeHelpers.cpp │ ├── Scanning.cpp │ ├── Selected.cpp │ ├── Statistics.cpp │ ├── Strings.cpp │ ├── SynchronizedCounter.cpp │ ├── TraceInterface.cpp │ └── VM.cpp ├── patches ├── classpath-0.99.macos.patch └── llvm.patch ├── tests ├── AnnotationClassTest.java └── MyAnnotation.java ├── tools ├── Makefile ├── j3 │ ├── Main.cpp │ └── Makefile ├── llcj │ ├── LinkPaths.h.in │ ├── Makefile │ └── llcj.cpp ├── precompiler │ ├── Makefile │ └── Precompiler.cpp ├── trainer │ ├── HelloWorld.java │ └── Makefile └── vmjc │ ├── Makefile │ ├── libvmjc │ └── Makefile │ └── vmjc.cpp └── www ├── OpenProjects.html ├── content.css ├── get_involved.html ├── get_started.html ├── index.html ├── lip6.png ├── menu.css ├── menu.html.incl ├── publications ├── ladyvm.html ├── osgi_dsn.html ├── osgi_iies.html ├── thesis.html └── vmkit.html ├── pubs.html ├── releases └── index.html ├── tuto ├── VMKit_pres_eng.pdf ├── VMKit_pres_fr.pdf ├── VMKit_tutorial.pdf ├── VMKit_tutorial.tar.gz ├── VMKit_tutorial_eng.pdf └── toy-vm-base.tar.gz └── tutorial.html /CREDITS.TXT: -------------------------------------------------------------------------------- 1 | This file is a partial list of people who have contributed to the VMKit 2 | project. If you have contributed a patch or made some other contribution to 3 | VMKit, please submit a patch to this file to add yourself, and it will be 4 | done! 5 | 6 | The list is sorted by name and formatted to allow easy grepping and 7 | beautification by scripts. The fields are: name (N), email (E), web-address 8 | (W), PGP key ID and fingerprint (P), description (D), and snail-mail address 9 | (S). 10 | 11 | N: Will Dietz 12 | E: wdietz2@illinois.edu 13 | D: J3 OpenJDK port 14 | D: General robustification, misc bug fixes 15 | 16 | N: Bertil Folliot 17 | E: bertil.folliot@lip6.fr 18 | W: http://lip6.fr/Bertil.Folliot/ 19 | D: Provider of much wisdom 20 | 21 | N: Nicolas Geoffray 22 | E: nicolas.geoffray@lip6.fr 23 | W: http://lip6.fr/Nicolas.Geoffray/ 24 | D: Architect of J3, originally a port of JnJVM to LLVM 25 | D: Architect of N3 26 | 27 | N: Sylvain Marechal 28 | E: sylvain.marechal@lip6.fr 29 | D: Original autoconf support 30 | 31 | N: Tilmann Scheller 32 | D: Generics support in N3. 33 | 34 | N: Gael Thomas 35 | E: gael.thomas@lip6.fr 36 | W: http://lip6.fr/Gael.Thomas/ 37 | D: Primary architect of JnJVM 38 | 39 | N: Koutheir Attouchi 40 | E: koutheir@gmail.com 41 | W: http://koutheir.blogspot.com/ 42 | D: Debug support for VMKit. 43 | D: Correction of stale references for J3. 44 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | #===- ./Makefile -------------------------------------------*- Makefile -*--===# 2 | # 3 | # The vmkit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | #===------------------------------------------------------------------------===# 9 | 10 | LEVEL := . 11 | 12 | DIRS := lib/static-gc-pass lib/static-gc-printer lib tools/vmjc mmtk tools/precompiler tools/trainer tools 13 | 14 | include $(LEVEL)/Makefile.common 15 | -------------------------------------------------------------------------------- /autoconf/.gitignore: -------------------------------------------------------------------------------- 1 | aclocal.m4 2 | autom4te.cache/ 3 | configure.bak 4 | -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | vmkit dox go here. 2 | -------------------------------------------------------------------------------- /include/types.h: -------------------------------------------------------------------------------- 1 | //===------------------- types.h - bitsized types -------------------------===// 2 | // 3 | // VMKIT 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | #ifndef TYPES_H 11 | #define TYPES_H 12 | 13 | #include 14 | 15 | typedef uint8_t uint8; 16 | typedef int8_t sint8; 17 | typedef uint16_t uint16; 18 | typedef int16_t sint16; 19 | typedef uint32_t uint32; 20 | typedef int32_t sint32; 21 | typedef uint64_t uint64; 22 | typedef int64_t sint64; 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /include/vmkit/Cond.h: -------------------------------------------------------------------------------- 1 | //===---------------- Cond.h - Threads conditions -------------------------===// 2 | // 3 | // The Micro Virtual Machine 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | #ifndef VMKIT_COND_H 11 | #define VMKIT_COND_H 12 | 13 | #include 14 | #include 15 | 16 | namespace vmkit { 17 | 18 | class Lock; 19 | 20 | class Cond { 21 | pthread_cond_t internalCond; 22 | public: 23 | 24 | Cond(); 25 | ~Cond(); 26 | void broadcast(void) __attribute__ ((noinline)); 27 | void wait(Lock *l) __attribute__ ((noinline)); 28 | int timedWait(Lock *l, timeval *tv) __attribute__ ((noinline)); 29 | int myTimeWait(Lock* l, bool isAbsolute, int64_t nsec) __attribute__ ((noinline)); 30 | void signal(void) __attribute__ ((noinline)); 31 | }; 32 | 33 | } // end namespace vmkit 34 | 35 | #endif // VMKIT_COND_H 36 | -------------------------------------------------------------------------------- /include/vmkit/GC.h: -------------------------------------------------------------------------------- 1 | //===----------- GC.h - Garbage Collection Interface -----------------------===// 2 | // 3 | // The Micro Virtual Machine 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | 11 | #ifndef VMKIT_GC_H 12 | #define VMKIT_GC_H 13 | 14 | #include 15 | #include "vmkit/System.h" 16 | 17 | class gc; 18 | 19 | class gcHeader { 20 | public: 21 | word_t _header; 22 | inline gc* toReference() { return (gc*)((uintptr_t)this + hiddenHeaderSize()); } 23 | static inline size_t hiddenHeaderSize() { return sizeof(gcHeader); } 24 | }; 25 | 26 | class gcRoot { 27 | public: 28 | word_t& header(){return toHeader()->_header; } 29 | inline gcHeader* toHeader() { return (gcHeader*)((uintptr_t)this - gcHeader::hiddenHeaderSize()); } 30 | }; 31 | 32 | namespace vmkit { 33 | // TODO(ngeoffray): Make these two constants easily configurable. For now they 34 | // work for all our supported GCs. 35 | static const uint32_t GCBits = 8; 36 | static const bool MovesObject = true; 37 | 38 | static const uint32_t HashBits = 8; 39 | static const uint64_t GCBitMask = ((1 << GCBits) - 1); 40 | } 41 | 42 | #endif 43 | -------------------------------------------------------------------------------- /include/vmkit/InlineCommon.h: -------------------------------------------------------------------------------- 1 | #ifndef _INLINE_COMMON_H_ 2 | #define _INLINE_COMMON_H_ 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | namespace vmkit { 13 | extern "C" void makeLLVMFunctions_FinalMMTk(llvm::Module*); 14 | } 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /include/vmkit/config.h.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llvm-mirror/vmkit/8a76c22d56f7b8434ad52b81436981d757ad671e/include/vmkit/config.h.in -------------------------------------------------------------------------------- /lib/Makefile: -------------------------------------------------------------------------------- 1 | ##===- lib/Makefile ----------------------------------------*- Makefile -*-===## 2 | # 3 | # The vmkit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | LEVEL = .. 10 | 11 | DIRS=vmkit j3 12 | 13 | include $(LEVEL)/Makefile.common 14 | 15 | -------------------------------------------------------------------------------- /lib/j3/ClassLib/ClassContext.inc: -------------------------------------------------------------------------------- 1 | //===------------ ClassContext.inc -- Implement GetClassContext -----------===// 2 | // 3 | // The VMKit project 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | ArrayObject* GetClassContext(uint32 level = 0) { 11 | ArrayObject* result = NULL; 12 | JavaObject* delegatee = NULL; 13 | llvm_gcroot(result, 0); 14 | llvm_gcroot(delegatee, 0); 15 | 16 | JavaThread* th = JavaThread::get(); 17 | Jnjvm* vm = th->getJVM(); 18 | uint32 length = th->getFrameContextLength(); 19 | 20 | vmkit::ThreadAllocator allocator; 21 | uintptr_t* buffer = (uintptr_t*)allocator.Allocate(length * sizeof(uintptr_t)); 22 | 23 | uint32 finalSize = th->getJavaFrameContext((void**)buffer); 24 | 25 | assert(level < finalSize); 26 | result = (ArrayObject*) 27 | vm->upcalls->classArrayClass->doNew(finalSize - level, vm); 28 | 29 | for (uint32 i = level; i != finalSize; ++i) { 30 | JavaMethod* meth = ((JavaMethod**)buffer)[i]; 31 | assert(meth && "Wrong stack trace"); 32 | delegatee = meth->classDef->getClassDelegatee(vm);; 33 | ArrayObject::setElement(result, delegatee, i - level); 34 | } 35 | 36 | return result; 37 | } 38 | -------------------------------------------------------------------------------- /lib/j3/ClassLib/DefineClass.inc: -------------------------------------------------------------------------------- 1 | // DefineClass.inc 2 | 3 | UserClass* defineClass(JnjvmClassLoader * JCL, const UTF8* className, 4 | const char* buf, size_t bufLen) { 5 | JavaObject* excp = 0; 6 | llvm_gcroot(excp, 0); 7 | 8 | Jnjvm* vm = JavaThread::get()->getJVM(); 9 | ClassBytes * classBytes = new (JCL->allocator, bufLen) ClassBytes(bufLen); 10 | memcpy(classBytes->elements, buf, bufLen); 11 | Reader reader(classBytes); 12 | 13 | // Before creating a class, do a check on the bytes. 14 | uint32 magic = reader.readU4(); 15 | if (magic != Jnjvm::Magic) { 16 | JavaThread::get()->getJVM()->classFormatError("bad magic number"); 17 | UNREACHABLE(); 18 | } 19 | 20 | // Also check that we don't already have a class for this name 21 | if (JCL->lookupClass(className)) { 22 | excp = vm->CreateLinkageError("duplicate class definition"); 23 | JavaThread::get()->throwException(excp); 24 | UNREACHABLE(); 25 | } 26 | 27 | // Construct the class 28 | UserClass* cl = JCL->constructClass(className, classBytes); 29 | cl->resolveClass(); 30 | return cl; 31 | } 32 | -------------------------------------------------------------------------------- /lib/j3/ClassLib/GNUClasspath/ClasspathVMSystem.inc: -------------------------------------------------------------------------------- 1 | //===-- ClasspathVMSystem.cpp - GNU classpath java/lang/VMSystem ----------===// 2 | // 3 | // The VMKit project 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | #include "types.h" 11 | 12 | #include "ArrayCopy.inc" 13 | #include "Classpath.h" 14 | #include "JavaArray.h" 15 | #include "JavaClass.h" 16 | #include "JavaObject.h" 17 | #include "JavaThread.h" 18 | #include "Jnjvm.h" 19 | 20 | using namespace j3; 21 | 22 | extern "C" { 23 | 24 | JNIEXPORT void JNICALL Java_java_lang_VMSystem_arraycopy( 25 | #ifdef NATIVE_JNI 26 | JNIEnv *env, 27 | jclass _cl, 28 | #endif 29 | JavaObject* src, 30 | jint sstart, 31 | JavaObject* dst, 32 | jint dstart, 33 | jint len) { 34 | ArrayCopy(src, sstart, dst, dstart, len); 35 | } 36 | 37 | JNIEXPORT jint JNICALL Java_java_lang_VMSystem_identityHashCode( 38 | #ifdef NATIVE_JNI 39 | JNIEnv *env, 40 | jclass clazz, 41 | #endif 42 | JavaObject* obj) { 43 | 44 | llvm_gcroot(obj, 0); 45 | if (obj == NULL) return 0; 46 | return JavaObject::hashCode(obj); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /lib/j3/ClassLib/GNUClasspath/ClasspathVMSystemProperties.inc: -------------------------------------------------------------------------------- 1 | //===- ClasspathVMSystem/Properties.cpp -----------------------------------===// 2 | //===--------------------- GNU classpath gnu/classpath/VMSystemProperties -===// 3 | // 4 | // The VMKit project 5 | // 6 | // This file is distributed under the University of Illinois Open Source 7 | // License. See LICENSE.TXT for details. 8 | // 9 | //===----------------------------------------------------------------------===// 10 | 11 | #include 12 | 13 | #include "types.h" 14 | 15 | #include "Classpath.h" 16 | #include "JavaArray.h" 17 | #include "JavaClass.h" 18 | #include "JavaObject.h" 19 | #include "JavaThread.h" 20 | #include "JavaUpcalls.h" 21 | #include "Jnjvm.h" 22 | 23 | #include "SetProperties.inc" 24 | 25 | using namespace j3; 26 | 27 | extern "C" { 28 | 29 | 30 | JNIEXPORT void JNICALL Java_gnu_classpath_VMSystemProperties_preInit( 31 | #ifdef NATIVE_JNI 32 | JNIEnv *env, 33 | jclass clazz, 34 | #endif 35 | JavaObject* prop) { 36 | 37 | llvm_gcroot(prop, 0); 38 | 39 | BEGIN_NATIVE_EXCEPTION(0) 40 | 41 | setProperties(prop); 42 | 43 | Jnjvm* vm = JavaThread::get()->getJVM(); 44 | const char * tmp = getenv("JAVA_COMPILER"); 45 | if (!tmp) tmp = "gcj"; 46 | setProperty(vm, prop, "java.compiler", tmp); 47 | 48 | END_NATIVE_EXCEPTION 49 | } 50 | 51 | extern "C" void Java_gnu_classpath_VMSystemProperties_postInit__Ljava_util_Properties_2(JavaObject* prop) { 52 | 53 | llvm_gcroot(prop, 0); 54 | 55 | BEGIN_NATIVE_EXCEPTION(0) 56 | 57 | setCommandLineProperties(prop); 58 | 59 | END_NATIVE_EXCEPTION 60 | } 61 | 62 | } 63 | -------------------------------------------------------------------------------- /lib/j3/ClassLib/GNUClasspath/GNuClasspathUnsafe.inc: -------------------------------------------------------------------------------- 1 | #include "VMStaticInstance.h" 2 | #include 3 | 4 | extern "C" { 5 | 6 | JNIEXPORT void JNICALL Java_sun_misc_Unsafe_unpark( 7 | JavaObject* unsafe, JavaObject* thread) { 8 | //return; 9 | llvm_gcroot(unsafe, 0); 10 | llvm_gcroot(thread, 0); 11 | JavaObject* vmthread; 12 | llvm_gcroot(vmthread, 0); 13 | Jnjvm* vm = JavaThread::get()->getJVM(); 14 | JavaField* field = vm->upcalls->vmdataVMThread; 15 | JavaField* field2 = vm->upcalls->vmThread; 16 | 17 | // It's possible that the thread to be interrupted has not finished 18 | // its initialization. Wait until the initialization is done. 19 | vmthread = field2->getInstanceObjectField(thread); 20 | while (vmthread == 0) { 21 | JavaThread::yield(); 22 | vmthread = field2->getInstanceObjectField(thread); 23 | } 24 | JavaThread* th = (JavaThread*)field->getInstanceObjectField(vmthread); 25 | while (th == 0) { 26 | JavaThread::yield(); 27 | fprintf(stderr, "Case 1\n"); 28 | th = (JavaThread*)field->getInstanceObjectField(vmthread); 29 | } 30 | //fprintf(stderr, "unparking started %lld\n", th->getThreadID()); 31 | th->parkLock.unpark(); 32 | //fprintf(stderr, "unparking done %lld\n", th->getThreadID()); 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /lib/j3/ClassLib/GNUClasspath/Makefile: -------------------------------------------------------------------------------- 1 | ##===- lib/j3/ClassLib/GNUClasspath/Makefile ---------------*- Makefile -*-===## 2 | # 3 | # The vmkit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | LEVEL = ../../../.. 10 | 11 | MODULE_WITH_GC=Classpath 12 | INCLUDES+=-I$(PROJ_SRC_ROOT)/lib/j3/VMCore -I$(PROJ_SRC_ROOT)/lib/j3/ClassLib 13 | 14 | include $(LEVEL)/Makefile.common 15 | 16 | -------------------------------------------------------------------------------- /lib/j3/ClassLib/Makefile: -------------------------------------------------------------------------------- 1 | ##===- lib/j3/ClassLib/Makefile ----------------------------*- Makefile -*-===## 2 | # 3 | # The vmkit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | LEVEL = ../../.. 10 | 11 | DIRS = $(CLASSPATH_DIR) 12 | 13 | include $(LEVEL)/Makefile.common 14 | -------------------------------------------------------------------------------- /lib/j3/ClassLib/OpenJDK/Makefile: -------------------------------------------------------------------------------- 1 | ##===- lib/j3/ClassLib/OpenJDK/Makefile --------------------*- Makefile -*-===## 2 | # 3 | # The vmkit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | LEVEL = ../../../.. 10 | 11 | EXTRA_DIST = OpenJDK.inc 12 | 13 | MODULE_WITH_GC = Classpath 14 | 15 | INCLUDES+=-I$(PROJ_SRC_ROOT)/lib/j3/VMCore -I$(PROJ_SRC_ROOT)/include/j3 -I$(PROJ_SRC_ROOT)/lib/j3/ClassLib -I$(PROJ_SRC_ROOT)/include/j3/openjdk 16 | COMMON_CFLAGS+= -DVMKitOpenJDKZip=\"$(VMKIT_OPENJDK_ZIP)\" 17 | 18 | include $(LEVEL)/Makefile.common 19 | 20 | INCLUDES+=-I$(PROJ_SRC_ROOT)/lib/j3/VMCore -I$(PROJ_SRC_ROOT)/include/j3 -I$(PROJ_SRC_ROOT)/lib/j3/ClassLib -I$(PROJ_SRC_ROOT)/include/j3/openjdk 21 | COMMON_CFLAGS+= -DVMKitOpenJDKZip=\"$(VMKIT_OPENJDK_ZIP)\" 22 | 23 | $(VMKIT_OPENJDK_ZIP): $(OPENJDK_JAVA_SOURCES) 24 | $(Echo) "**[13] Building OpenJDK java sources into zip" 25 | -$(Verb) $(RM) -rf $@ $(CLASSES_DIR) 26 | $(Verb) $(MKDIR) $(CLASSES_DIR) 27 | $(Verb) $(JAVAC) $^ -d $(CLASSES_DIR) 28 | cd $(CLASSES_DIR) && $(ZIP) -qr $(VMKIT_OPENJDK_ZIP) . 29 | 30 | -------------------------------------------------------------------------------- /lib/j3/ClassLib/OpenJDK/UnsafeForOpenJDK.inc: -------------------------------------------------------------------------------- 1 | #include "VMStaticInstance.h" 2 | #include 3 | 4 | extern "C" { 5 | 6 | JNIEXPORT void JNICALL Java_sun_misc_Unsafe_unpark( 7 | JavaObject* unsafe, JavaObject* thread) { 8 | llvm_gcroot(unsafe, 0); 9 | llvm_gcroot(thread, 0); 10 | Jnjvm* vm = JavaThread::get()->getJVM(); 11 | JavaField * field = vm->upcalls->eetop; 12 | 13 | // Get the eetop field 14 | // It's possible that the thread to be interrupted has not finished 15 | // its initialization. Wait until the initialization is done. 16 | while (field->getInstanceLongField(thread) == 0) 17 | vmkit::Thread::yield(); 18 | 19 | JavaThread* jth = (JavaThread*)field->getInstanceLongField(thread); 20 | 21 | jth->parkLock.unpark(); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /lib/j3/Compiler/JavaJITOpenJDK.inc: -------------------------------------------------------------------------------- 1 | //===-- JavaJITOpenJDK.h - OpenJDK-specific JavaJIT Methods ---------------===// 2 | // 3 | // The VMKit project 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | void JavaJIT::lowerArraycopy(std::vector& args) { 11 | UNIMPLEMENTED(); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /lib/j3/Compiler/Makefile: -------------------------------------------------------------------------------- 1 | ##===- lib/j3/Compiler/Makefile ----------------------------*- Makefile -*-===## 2 | # 3 | # The VMKit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | LEVEL = ../../.. 10 | 11 | MODULE_WITH_GC = J3Compiler 12 | INCLUDES+=-I$(PROJ_SRC_ROOT)/lib/j3/ClassLib/$(CLASSPATH_DIR) \ 13 | -I$(PROJ_SRC_ROOT)/lib/j3/ClassLib \ 14 | -I$(PROJ_SRC_ROOT)/lib/j3/VMCore \ 15 | -I$(PROJ_SRC_ROOT)/lib/j3/LLVMRuntime/$(BUILD_NAME) 16 | 17 | include $(LEVEL)/Makefile.common 18 | -------------------------------------------------------------------------------- /lib/j3/LLVMRuntime/Makefile: -------------------------------------------------------------------------------- 1 | ##===- lib/JnJVM/LLVMRuntime/Makefile ----------------------*- Makefile -*-===## 2 | # 3 | # The vmkit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | LEVEL = ../../.. 10 | 11 | VMKIT_RUNTIME_IN=runtime-default.ll runtime-mmtk-thread.ll runtime-single.ll 12 | VMKIT_RUNTIME_OUT=LLVMRuntime.inc 13 | 14 | include $(LEVEL)/Makefile.common 15 | -------------------------------------------------------------------------------- /lib/j3/LLVMRuntime/runtime-mmtk-thread.ll: -------------------------------------------------------------------------------- 1 | %ThreadAllocator = type { i8*, i8*, i8*, i8*, i8*, i8*, i8* } 2 | 3 | ;;; Field 0: the thread 4 | ;;; field 1: allocator 5 | ;;; field 2: MutatorContext 6 | ;;; field 3: realRoutine 7 | ;;; field 4: CollectionAttempts 8 | %MutatorThread = type { %Thread, %ThreadAllocator, i8*, i8*, i32 } 9 | -------------------------------------------------------------------------------- /lib/j3/LLVMRuntime/runtime-single.ll: -------------------------------------------------------------------------------- 1 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 2 | ;;;;;;;;;;;;;;;;;;;;;;;;; Isolate specific types ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 3 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; 4 | 5 | %JavaCommonClass = type { [1 x %JavaObject*], i32, 6 | %JavaClass**, i16, %UTF8*, %JavaClass*, i8*, %VT* } 7 | 8 | %ClassBytes = type { i32, i8* } 9 | 10 | %JavaClass = type { %JavaCommonClass, i32, i32, [1 x %TaskClassMirror], 11 | %JavaField*, i16, %JavaField*, i16, %JavaMethod*, i16, 12 | %JavaMethod*, i16, i8*, %ClassBytes*, %JavaConstantPool*, %Attribute*, 13 | i16, %JavaClass**, i16, %JavaClass*, i16, i8, i8, i32, i32, i16, i16, i16 } 14 | -------------------------------------------------------------------------------- /lib/j3/Makefile: -------------------------------------------------------------------------------- 1 | ##===- lib/JnJVM/Makefile ----------------------------------*- Makefile -*-===## 2 | # 3 | # The vmkit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | LEVEL = ../.. 10 | 11 | DIRS = LLVMRuntime VMCore ClassLib Compiler 12 | 13 | include $(LEVEL)/Makefile.common 14 | 15 | -------------------------------------------------------------------------------- /lib/j3/README.txt: -------------------------------------------------------------------------------- 1 | GNU Classpath 2 | Current version 0.97.2. Use ecj to compile Classpath. 3 | 4 | a - unzip classpath 5 | tar -xzf classpath-0.97.2 6 | b - compile classpath 7 | cd classpath-0.97.2 8 | ./configure --disable-plugin --disable-examples && make 9 | 10 | IMPORTANT: for local use 11 | cd classpath-x.y/lib; 12 | ln -s ../native/jni/gtk-peer/.libs/libgtkpeer.so; 13 | ln -s ../native/jni/gconf-peer/.libs/libgconfpeer.so; 14 | ln -s ../native/jni/java-io/.libs/libjavaio.so; 15 | ln -s ../native/jni/java-lang/.libs/libjavalangreflect.so; 16 | ln -s ../native/jni/java-lang/.libs/libjavalang.so; 17 | ln -s ../native/jni/java-net/.libs/libjavanet.so; 18 | ln -s ../native/jni/java-nio/.libs/libjavanio.so; 19 | ln -s ../native/jni/java-util/.libs/libjavautil.so; 20 | 21 | Or for Darwin 22 | ln -s ../native/jni/gtk-peer/.libs/libgtkpeer.dylib; 23 | ln -s ../native/jni/gconf-peer/.libs/libgconfpeer.dylib; 24 | ln -s ../native/jni/java-io/.libs/libjavaio.dylib; 25 | ln -s ../native/jni/java-lang/.libs/libjavalangreflect.dylib; 26 | ln -s ../native/jni/java-lang/.libs/libjavalang.dylib; 27 | ln -s ../native/jni/java-net/.libs/libjavanet.dylib; 28 | ln -s ../native/jni/java-nio/.libs/libjavanio.dylib; 29 | ln -s ../native/jni/java-util/.libs/libjavautil.dylib; 30 | -------------------------------------------------------------------------------- /lib/j3/VMCore/JavaArray.cpp: -------------------------------------------------------------------------------- 1 | //===----------------- JavaArray.cpp - Java arrays ------------------------===// 2 | // 3 | // The VMKit project 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | #include 11 | #include 12 | 13 | #include "JavaArray.h" 14 | #include "JavaClass.h" 15 | #include "JavaObject.h" 16 | #include "JavaTypes.h" 17 | #include "Jnjvm.h" 18 | #include "JavaThread.h" 19 | #include "JavaUpcalls.h" 20 | #include "LockedMap.h" 21 | 22 | 23 | using namespace j3; 24 | 25 | /// This value is the same value than IBM's JVM. 26 | const sint32 JavaArray::MaxArraySize = 268435455; 27 | 28 | /// The JVM defines constants for referencing arrays of primitive types. 29 | const unsigned int JavaArray::T_BOOLEAN = 4; 30 | const unsigned int JavaArray::T_CHAR = 5; 31 | const unsigned int JavaArray::T_FLOAT = 6; 32 | const unsigned int JavaArray::T_DOUBLE = 7; 33 | const unsigned int JavaArray::T_BYTE = 8; 34 | const unsigned int JavaArray::T_SHORT = 9; 35 | const unsigned int JavaArray::T_INT = 10; 36 | const unsigned int JavaArray::T_LONG = 11; 37 | 38 | template<> 39 | void TJavaArray::setElement(TJavaArray* self, JavaObject* value, uint32_t i) { 40 | llvm_gcroot(self, 0); 41 | llvm_gcroot(value, 0); 42 | assert((ssize_t)i < self->size); 43 | if (value != NULL) assert(value->getVirtualTable()); 44 | vmkit::Collector::objectReferenceArrayWriteBarrier( 45 | (gc*)self, (gc**)&(self->elements[i]), (gc*)value); 46 | } 47 | -------------------------------------------------------------------------------- /lib/j3/VMCore/JavaReferenceQueue.h: -------------------------------------------------------------------------------- 1 | //===---ReferenceQueue.h - Implementation of soft/weak/phantom references--===// 2 | // 3 | // The VMKit project 4 | // 5 | // This file is distributed under the University of Pierre et Marie Curie 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | #ifndef J3_REFERENCE_QUEUE_H 11 | #define J3_REFERENCE_QUEUE_H 12 | 13 | #include "vmkit/ReferenceThread.h" 14 | #include "vmkit/FinalizerThread.h" 15 | #include "JavaThread.h" 16 | 17 | namespace j3 { 18 | 19 | class Jnjvm; 20 | 21 | class JavaFinalizerThread : public vmkit::FinalizerThread{ 22 | public: 23 | JavaFinalizerThread(Jnjvm* vm) : FinalizerThread(vm) {} 24 | }; 25 | 26 | class JavaReferenceThread : public vmkit::ReferenceThread { 27 | public: 28 | JavaReferenceThread(Jnjvm* vm) : ReferenceThread(vm) {} 29 | }; 30 | 31 | } // namespace j3 32 | 33 | #endif //J3_REFERENCE_QUEUE_H 34 | -------------------------------------------------------------------------------- /lib/j3/VMCore/JniOpenJDK.inc: -------------------------------------------------------------------------------- 1 | // OpenJDK-specific JNI implementation 2 | 3 | jobject NewDirectByteBuffer(JNIEnv *env, void *address, jlong capacity) { 4 | JavaObject* res = 0; 5 | llvm_gcroot(res, 0); 6 | 7 | BEGIN_JNI_EXCEPTION 8 | 9 | JavaThread* th = JavaThread::get(); 10 | Jnjvm* myvm = th->getJVM(); 11 | UserClass* BB = myvm->upcalls->newDirectByteBuffer; 12 | 13 | res = BB->doNew(myvm); 14 | 15 | myvm->upcalls->InitDirectByteBuffer->invokeIntSpecial(myvm, BB, res, 16 | (uint64_t)(uintptr_t)address, (int)capacity); 17 | 18 | jobject ret = (jobject)th->pushJNIRef(res); 19 | RETURN_FROM_JNI(ret); 20 | END_JNI_EXCEPTION 21 | 22 | RETURN_FROM_JNI(0); 23 | } 24 | 25 | void *GetDirectBufferAddress(JNIEnv *env, jobject _buf) { 26 | JavaObject* buf = 0; 27 | llvm_gcroot(buf, 0); 28 | 29 | BEGIN_JNI_EXCEPTION 30 | 31 | // Local object references. 32 | buf = *(JavaObject**)_buf; 33 | jlong address; 34 | 35 | Jnjvm* vm = myVM(env); 36 | address = vm->upcalls->bufferAddress->getInstanceLongField(buf); 37 | RETURN_FROM_JNI((void*)address); 38 | 39 | END_JNI_EXCEPTION 40 | RETURN_FROM_JNI(0); 41 | } 42 | -------------------------------------------------------------------------------- /lib/j3/VMCore/JnjvmConfig.h: -------------------------------------------------------------------------------- 1 | //===---------- JnjvmConfig.h - Jnjvm configuration file ------------------===// 2 | // 3 | // The VMKit project 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | 11 | #ifndef JNJVM_CONFIG_H 12 | #define JNJVM_CONFIG_H 13 | 14 | namespace j3 { 15 | 16 | class ClassArray; 17 | class ClassPrimitive; 18 | class Class; 19 | class CommonClass; 20 | class JavaConstantPool; 21 | 22 | #define UserClassArray ClassArray 23 | #define UserClassPrimitive ClassPrimitive 24 | #define UserClass Class 25 | #define UserCommonClass CommonClass 26 | #define UserConstantPool JavaConstantPool 27 | 28 | } 29 | #define ISOLATE_STATIC static 30 | 31 | #define NR_ISOLATES 1 32 | 33 | #endif // JNJVM_CONFIG_H 34 | -------------------------------------------------------------------------------- /lib/j3/VMCore/Makefile: -------------------------------------------------------------------------------- 1 | ##===- lib/j3/VMCore/Makefile ------------------------------*- Makefile -*-===## 2 | # 3 | # The vmkit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | LEVEL = ../../.. 10 | 11 | MODULE_WITH_GC = J3 12 | INCLUDES+=-I$(PROJ_SRC_ROOT)/lib/j3/ClassLib/$(CLASSPATH_DIR) -I$(PROJ_SRC_ROOT)/lib/j3/ClassLib 13 | 14 | include $(LEVEL)/Makefile.common 15 | 16 | -------------------------------------------------------------------------------- /lib/static-gc-pass/Makefile: -------------------------------------------------------------------------------- 1 | ##===- lib/vmkit/StaticGCPass/Makefile -----------------------*- Makefile -*-===## 2 | # 3 | # The VMKit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | 10 | LEVEL = ../.. 11 | 12 | LIBRARY=static-gc-pass 13 | LOADABLE_MODULE = 1 14 | 15 | include $(LEVEL)/Makefile.common 16 | 17 | -------------------------------------------------------------------------------- /lib/static-gc-printer/Makefile: -------------------------------------------------------------------------------- 1 | ##===- lib/vmkit/StaticGCPass/Makefile -----------------------*- Makefile -*-===## 2 | # 3 | # The VMKit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | 10 | LEVEL = ../.. 11 | 12 | LIBRARY=static-gc-printer 13 | LOADABLE_MODULE = 1 14 | 15 | include $(LEVEL)/Makefile.common 16 | 17 | -------------------------------------------------------------------------------- /lib/vmkit/CommonThread/Makefile: -------------------------------------------------------------------------------- 1 | ##===- lib/vmkit/CommonThread/Makefile -----------------------*- Makefile -*-===## 2 | # 3 | # The vmkit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | LEVEL = ../../.. 10 | 11 | MODULE_WITH_GC = CommonThread 12 | 13 | include $(LEVEL)/Makefile.common 14 | 15 | -------------------------------------------------------------------------------- /lib/vmkit/Compiler/Makefile: -------------------------------------------------------------------------------- 1 | ##===- lib/vmkit/Runtime/Makefile ----------------------------*- Makefile -*-===## 2 | # 3 | # The vmkit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | LEVEL = ../../.. 10 | 11 | MODULE_WITH_GC = VmkitCompiler 12 | 13 | VMKIT_RUNTIME_IN=LLVMRuntime.ll 14 | VMKIT_RUNTIME_OUT=LLVMRuntime.inc 15 | 16 | include $(LEVEL)/Makefile.common 17 | -------------------------------------------------------------------------------- /lib/vmkit/JITGCPass/Makefile: -------------------------------------------------------------------------------- 1 | ##===- lib/vmkit/StaticGCPass/Makefile -----------------------*- Makefile -*-===## 2 | # 3 | # The VMKit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | 10 | LEVEL = ../../.. 11 | 12 | LIBRARY=JITGCPass 13 | 14 | include $(LEVEL)/Makefile.common 15 | 16 | -------------------------------------------------------------------------------- /lib/vmkit/MMTk/Makefile: -------------------------------------------------------------------------------- 1 | ##===- lib/vmkit/MMTk/Makefile -------------------------------*- Makefile -*-===## 2 | # 3 | # The vmkit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | LEVEL = ../../.. 10 | 11 | MODULE_WITH_GC = MMTk 12 | 13 | include $(LEVEL)/Makefile.common 14 | -------------------------------------------------------------------------------- /lib/vmkit/MMTk/MutatorThread.h: -------------------------------------------------------------------------------- 1 | //===--------- MutatorThread.h - Thread for GC ----------------------------===// 2 | // 3 | // The VMKit project 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | 11 | #ifndef VMKIT_MUTATOR_THREAD_H 12 | #define VMKIT_MUTATOR_THREAD_H 13 | 14 | #include "vmkit/Allocator.h" 15 | #include "vmkit/Thread.h" 16 | 17 | namespace vmkit { 18 | 19 | class MutatorThread : public vmkit::Thread { 20 | public: 21 | MutatorThread() : vmkit::Thread() { 22 | MutatorContext = 0; 23 | CollectionAttempts = 0; 24 | } 25 | vmkit::ThreadAllocator Allocator; 26 | word_t MutatorContext; 27 | 28 | /// realRoutine - The function to invoke when the thread starts. 29 | /// 30 | void (*realRoutine)(vmkit::Thread*); 31 | 32 | uint32_t CollectionAttempts; 33 | 34 | static void init(Thread* _th); 35 | 36 | static MutatorThread* get() { 37 | return (MutatorThread*)vmkit::Thread::get(); 38 | } 39 | 40 | virtual int start(void (*fct)(vmkit::Thread*)) { 41 | realRoutine = fct; 42 | routine = init; 43 | return Thread::start(init); 44 | } 45 | }; 46 | 47 | } 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /lib/vmkit/Makefile: -------------------------------------------------------------------------------- 1 | ##===- lib/vmkit/Makefile ------------------------------------*- Makefile -*-===## 2 | # 3 | # The vmkit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | LEVEL = ../.. 10 | 11 | DIRS = CommonThread MMTk Runtime Compiler JITGCPass 12 | 13 | include $(LEVEL)/Makefile.common 14 | -------------------------------------------------------------------------------- /lib/vmkit/Runtime/Makefile: -------------------------------------------------------------------------------- 1 | ##===- lib/vmkit/Runtime/Makefile ----------------------------*- Makefile -*-===## 2 | # 3 | # The vmkit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | LEVEL = ../../.. 10 | 11 | MODULE_WITH_GC = Vmkit 12 | 13 | include $(LEVEL)/Makefile.common 14 | -------------------------------------------------------------------------------- /mmtk/Makefile: -------------------------------------------------------------------------------- 1 | ##===- mmtk/Makefile ---------------------------------------*- Makefile -*-===## 2 | # 3 | # The vmkit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | LEVEL = .. 10 | 11 | DIRS = magic mmtk-j3 mmtk-alloc java 12 | 13 | include $(LEVEL)/Makefile.common 14 | 15 | -------------------------------------------------------------------------------- /mmtk/inline/InlineMethods.cpp: -------------------------------------------------------------------------------- 1 | //===-------- InlineMethods.cpp - Initialize the inline methods -----------===// 2 | // 3 | // The VMKit project 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | 18 | using namespace llvm; 19 | 20 | namespace mmtk { 21 | 22 | namespace mmtk_vt_malloc { 23 | #include "MMTkVTMallocInline.inc" 24 | } 25 | 26 | namespace mmtk_vmkit_malloc { 27 | #include "MMTkVMKitMallocInline.inc" 28 | } 29 | 30 | namespace mmtk_array_write { 31 | #include "MMTkArrayWriteInline.inc" 32 | } 33 | 34 | namespace mmtk_field_write { 35 | #include "MMTkFieldWriteInline.inc" 36 | } 37 | 38 | namespace mmtk_non_heap_write { 39 | #include "MMTkNonHeapWriteInline.inc" 40 | } 41 | 42 | } 43 | 44 | extern "C" void MMTk_InlineMethods(llvm::Module* module) { 45 | mmtk::mmtk_vt_malloc::makeLLVMFunction(module); 46 | mmtk::mmtk_vmkit_malloc::makeLLVMFunction(module); 47 | mmtk::mmtk_field_write::makeLLVMFunction(module); 48 | mmtk::mmtk_array_write::makeLLVMFunction(module); 49 | mmtk::mmtk_non_heap_write::makeLLVMFunction(module); 50 | } 51 | 52 | namespace vmkit { 53 | extern "C" void vmkit::makeLLVMFunctions_FinalMMTk(llvm::Module* module) { 54 | MMTk_InlineMethods(module); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /mmtk/java/Makefile: -------------------------------------------------------------------------------- 1 | ##===- mmtk/java/Makefile ----------------------------------*- Makefile -*-===## 2 | # 3 | # The vmkit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | LEVEL = ../.. 10 | 11 | GEN=mmtk-vmkit.bc 12 | MODULE=FinalMMTk 13 | MODULE_USE=MMTKAlloc MMTKRuntime 14 | NEED_GC=1 15 | EXTRACT_FUNCTIONS=VTgcmalloc fieldWriteBarrier arrayWriteBarrier nonHeapWriteBarrier 16 | 17 | include $(LEVEL)/Makefile.common 18 | 19 | $(BUILD_DIR)/%.bc: $(BUILD_DIR)/%-lower.bc $(LIB_DIR)/MMTKMagic$(SHLIBEXT) 20 | $(Echo) "Lowering magic '$(notdir $@)'" 21 | $(Verb) $(LOPT) -load=$(LIB_DIR)/MMTKMagic$(SHLIBEXT) -LowerJavaRT $(OPT_FLAGS) -f $< -o $@ 22 | 23 | $(BUILD_DIR)/%-lower.bc: $(BUILD_DIR)/%.jar $(VMJC) $(LIB_DIR)/MMTKRuntime$(SHLIBEXT) $(LIB_DIR)/MMTKMagic$(SHLIBEXT) 24 | $(Echo) "Compiling '$(notdir $<)'" 25 | $(Verb) $(VMJC) $(VMJCFLAGS) -load=$(LIB_DIR)/MMTKRuntime$(SHLIBEXT) -load=$(LIB_DIR)/MMTKMagic$(SHLIBEXT) \ 26 | -LowerMagic $< -disable-exceptions -disable-cooperativegc \ 27 | -with-clinit=org/mmtk/vm/VM,org/mmtk/utility/*,org/mmtk/policy/*,org/j3/config/* -Dmmtk.hostjvm=org.j3.mmtk.Factory \ 28 | -o $@ -Dmmtk.properties=$(PROJ_SRC_ROOT)/mmtk/java/vmkit.properties -disable-stubs -assume-compiled 29 | 30 | $(BUILD_DIR)/mmtk-vmkit.jar: $(PROJ_OBJ_ROOT)/mmtk/java/build.xml $(BUILD_DIR)/.dir #$(SELF) 31 | $(Verb) $(ANT) -buildfile $(PROJ_OBJ_ROOT)/mmtk/java/build.xml && mv $(notdir $@) $@ 32 | 33 | -------------------------------------------------------------------------------- /mmtk/java/build.xml.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /mmtk/java/src/org/j3/mmtk/Debug.java: -------------------------------------------------------------------------------- 1 | //===--------------------------- Debug.java -------------------------------===// 2 | // 3 | // The VMKit project 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | package org.j3.mmtk; 11 | 12 | import org.vmmagic.pragma.Uninterruptible; 13 | 14 | /** 15 | * Debugger support for the MMTk harness 16 | */ 17 | @Uninterruptible 18 | public final class Debug extends org.mmtk.vm.Debug { 19 | 20 | /** 21 | * Enable/disable MMTk debugger support 22 | */ 23 | @Override 24 | public boolean isEnabled() { 25 | return false; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /mmtk/java/src/org/j3/mmtk/Lock.java: -------------------------------------------------------------------------------- 1 | //===--------------------------- Lock.java --------------------------------===// 2 | // 3 | // The VMKit project 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | package org.j3.mmtk; 11 | 12 | import org.vmmagic.unboxed.*; 13 | import org.vmmagic.pragma.*; 14 | 15 | @Uninterruptible public class Lock extends org.mmtk.vm.Lock { 16 | 17 | private int state; 18 | private String name; // logical name of lock 19 | 20 | // Diagnosis Instance fields 21 | public Lock(String name) { 22 | this(); 23 | this.name = name; 24 | } 25 | 26 | public Lock() { 27 | state = 0; 28 | } 29 | 30 | public void setName(String str) { 31 | name = str; 32 | } 33 | 34 | public native void acquire(); 35 | 36 | public native void check(int w); 37 | 38 | public native void release(); 39 | } 40 | -------------------------------------------------------------------------------- /mmtk/java/src/org/j3/mmtk/MMTk_Events.java: -------------------------------------------------------------------------------- 1 | //===-------------------- --- MMTk_Events.java ----------------------------===// 2 | // 3 | // The VMKit project 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | package org.j3.mmtk; 11 | 12 | import org.mmtk.policy.Space; 13 | import org.vmmagic.pragma.Uninterruptible; 14 | import org.vmmagic.unboxed.Address; 15 | import org.vmmagic.unboxed.Extent; 16 | 17 | /** 18 | * Implementation of simple MMTK event generation hooks 19 | * to allow MMTk to generate TuningFork events. 20 | */ 21 | @Uninterruptible 22 | public class MMTk_Events extends org.mmtk.vm.MMTk_Events { 23 | 24 | public native void tracePageAcquired(Space space, Address startAddress, int numPages); 25 | 26 | public native void tracePageReleased(Space space, Address startAddress, int numPages); 27 | 28 | public native void heapSizeChanged(Extent heapSize); 29 | } 30 | -------------------------------------------------------------------------------- /mmtk/java/src/org/j3/mmtk/SynchronizedCounter.java: -------------------------------------------------------------------------------- 1 | //===---------- SynchronizedCounter.java - Atomic counter -----------------===// 2 | // 3 | // The VMKit project 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | package org.j3.mmtk; 11 | 12 | /** 13 | * A counter that supports atomic increment and reset. 14 | */ 15 | public final class SynchronizedCounter extends org.mmtk.vm.SynchronizedCounter { 16 | 17 | private int count = 0; 18 | 19 | public native int reset(); 20 | 21 | public native int increment(); 22 | 23 | public int peek() { 24 | return count; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/j3/runtime/VM.java: -------------------------------------------------------------------------------- 1 | //===---------------------------- VM.java ---------------------------------===// 2 | // 3 | // The VMKit project 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | 11 | package org.j3.runtime; 12 | 13 | import org.vmmagic.unboxed.Address; 14 | import org.vmmagic.unboxed.Extent; 15 | 16 | public final class VM { 17 | 18 | private native static boolean verifyAssertions(); 19 | private native static boolean buildForIA32(); 20 | private native static boolean buildFor64Addr(); 21 | 22 | public final static boolean NOT_REACHED = false; 23 | 24 | public final static boolean VerifyAssertions = verifyAssertions(); 25 | public final static boolean runningVM = false; 26 | public final static boolean BuildForIA32 = buildForIA32(); 27 | public final static boolean BuildFor64Addr = buildFor64Addr(); 28 | 29 | 30 | public native static void sysFail(String a); 31 | public native static void sysExit(int a); 32 | public native static void _assert(boolean cond); 33 | public native static void _assert(boolean cond, String msg); 34 | public native static void sysWriteln(String a); 35 | public native static void sysWriteln(); 36 | public native static void sysWrite(String a); 37 | public native static void sysWrite(int a); 38 | public native static void sysWrite(float a); 39 | public native static void sysWrite(Address a); 40 | public native static void sysWrite(Extent a); 41 | } 42 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/GCspyPlan.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan; 14 | 15 | import org.mmtk.policy.ImmortalSpace; 16 | import org.mmtk.utility.heap.VMRequest; 17 | 18 | /** 19 | * This interface provides an immortal allocation space for GCspy objects. 20 | */ 21 | public interface GCspyPlan { 22 | 23 | /** 24 | * Any GCspy objects allocated after booting are allocated 25 | * in a separate immortal space. 26 | */ 27 | ImmortalSpace gcspySpace = 28 | new ImmortalSpace("gcspy", Plan.DEFAULT_POLL_FREQUENCY, VMRequest.create()); 29 | 30 | /** The descriptor for the GCspy allocation space */ 31 | int GCSPY = gcspySpace.getDescriptor(); 32 | } 33 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/SimpleConstraints.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan; 14 | 15 | import org.vmmagic.pragma.*; 16 | 17 | /** 18 | * Constraints specific to simple collectors. 19 | */ 20 | @Uninterruptible 21 | public abstract class SimpleConstraints extends PlanConstraints { 22 | } 23 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/StopTheWorldConstraints.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan; 14 | 15 | import org.vmmagic.pragma.*; 16 | 17 | /** 18 | * Constraints specific to Stop-the-world collectors. 19 | */ 20 | @Uninterruptible 21 | public abstract class StopTheWorldConstraints extends SimpleConstraints { 22 | } 23 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/StopTheWorldMutator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan; 14 | 15 | import org.vmmagic.pragma.*; 16 | 17 | /** 18 | * This class (and its sub-classes) implement per-mutator thread 19 | * behavior and state. 20 | * 21 | * MMTk assumes that the VM instantiates instances of MutatorContext 22 | * in thread local storage (TLS) for each application thread. Accesses 23 | * to this state are therefore assumed to be low-cost during mutator 24 | * time.

25 | * 26 | * @see MutatorContext 27 | */ 28 | @Uninterruptible 29 | public abstract class StopTheWorldMutator extends SimpleMutator { 30 | } 31 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/copyms/CopyMSConstraints.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.copyms; 14 | 15 | import org.mmtk.plan.StopTheWorldConstraints; 16 | 17 | import org.mmtk.policy.CopySpace; 18 | import org.mmtk.policy.SegregatedFreeListSpace; 19 | 20 | import org.vmmagic.pragma.*; 21 | 22 | /** 23 | * This class and its subclasses communicate to the host VM/Runtime 24 | * any features of the selected plan that it needs to know. This is 25 | * separate from the main Plan/PlanLocal class in order to bypass any 26 | * issues with ordering of static initialization. 27 | */ 28 | @Uninterruptible 29 | public class CopyMSConstraints extends StopTheWorldConstraints { 30 | 31 | @Override 32 | public int gcHeaderBits() { return CopySpace.LOCAL_GC_BITS_REQUIRED; } 33 | @Override 34 | public int gcHeaderWords() { return CopySpace.GC_HEADER_WORDS_REQUIRED; } 35 | @Override 36 | public int numSpecializedScans() { return 1; } 37 | @Override 38 | public boolean movesObjects() { return true; } 39 | @Override 40 | public int maxNonLOSCopyBytes() { return SegregatedFreeListSpace.MAX_FREELIST_OBJECT_BYTES;} 41 | } 42 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/generational/copying/GenCopyConstraints.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.generational.copying; 14 | 15 | import org.mmtk.plan.generational.GenConstraints; 16 | import org.vmmagic.pragma.*; 17 | 18 | /** 19 | * GenCopy constants. 20 | */ 21 | @Uninterruptible public class GenCopyConstraints extends GenConstraints { 22 | } 23 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/generational/immix/GenImmixConstraints.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.generational.immix; 14 | 15 | import org.mmtk.plan.generational.GenConstraints; 16 | import static org.mmtk.policy.immix.ImmixConstants.MAX_IMMIX_OBJECT_BYTES; 17 | 18 | import org.vmmagic.pragma.*; 19 | 20 | /** 21 | * This class and its subclasses communicate to the host VM/Runtime 22 | * any features of the selected plan that it needs to know. This is 23 | * separate from the main Plan/PlanLocal class in order to bypass any 24 | * issues with ordering of static initialization. 25 | * 26 | */ 27 | @Uninterruptible 28 | public class GenImmixConstraints extends GenConstraints { 29 | /** @return The specialized scan methods required */ 30 | @Override 31 | public int numSpecializedScans() { return 3; } 32 | @Override 33 | public int maxNonLOSCopyBytes() { return MAX_IMMIX_OBJECT_BYTES;} 34 | } 35 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/generational/marksweep/GenMSConstraints.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.generational.marksweep; 14 | 15 | import org.mmtk.plan.generational.GenConstraints; 16 | import static org.mmtk.policy.SegregatedFreeListSpace.MAX_FREELIST_OBJECT_BYTES; 17 | 18 | import org.vmmagic.pragma.*; 19 | 20 | /** 21 | * This class and its subclasses communicate to the host VM/Runtime 22 | * any features of the selected plan that it needs to know. This is 23 | * separate from the main Plan/PlanLocal class in order to bypass any 24 | * issues with ordering of static initialization. 25 | */ 26 | @Uninterruptible 27 | public class GenMSConstraints extends GenConstraints { 28 | @Override 29 | public int maxNonLOSCopyBytes() { return MAX_FREELIST_OBJECT_BYTES;} 30 | } 31 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/marksweep/MSConstraints.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.marksweep; 14 | 15 | import org.mmtk.plan.StopTheWorldConstraints; 16 | 17 | import org.mmtk.policy.MarkSweepSpace; 18 | import org.mmtk.policy.SegregatedFreeListSpace; 19 | 20 | import org.vmmagic.pragma.*; 21 | 22 | /** 23 | * This class and its subclasses communicate to the host VM/Runtime 24 | * any features of the selected plan that it needs to know. This is 25 | * separate from the main Plan/PlanLocal class in order to bypass any 26 | * issues with ordering of static initialization. 27 | */ 28 | @Uninterruptible 29 | public class MSConstraints extends StopTheWorldConstraints { 30 | @Override 31 | public int gcHeaderBits() { return MarkSweepSpace.LOCAL_GC_BITS_REQUIRED; } 32 | @Override 33 | public int gcHeaderWords() { return MarkSweepSpace.GC_HEADER_WORDS_REQUIRED; } 34 | @Override 35 | public int maxNonLOSDefaultAllocBytes() { return SegregatedFreeListSpace.MAX_FREELIST_OBJECT_BYTES; } 36 | @Override 37 | public int numSpecializedScans() { return 1; } 38 | } 39 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/nogc/NoGCConstraints.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.nogc; 14 | 15 | import org.mmtk.plan.PlanConstraints; 16 | 17 | import org.vmmagic.pragma.*; 18 | 19 | /** 20 | * This class and its subclasses communicate to the host VM/Runtime 21 | * any features of the selected plan that it needs to know. This is 22 | * separate from the main Plan/PlanLocal class in order to bypass any 23 | * issues with ordering of static initialization. 24 | */ 25 | @Uninterruptible 26 | public class NoGCConstraints extends PlanConstraints { 27 | @Override 28 | public int gcHeaderBits() { return 0; } 29 | @Override 30 | public int gcHeaderWords() { return 0; } 31 | } 32 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/poisoned/PoisonedCollector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.poisoned; 14 | 15 | import org.mmtk.plan.marksweep.MSCollector; 16 | 17 | import org.vmmagic.pragma.Uninterruptible; 18 | 19 | /** 20 | * This class implements a poisoned collector, that is essentially a test 21 | * case for read and write barriers in the VM. 22 | */ 23 | @Uninterruptible 24 | public class PoisonedCollector extends MSCollector { 25 | } 26 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/poisoned/PoisonedConstraints.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.poisoned; 14 | 15 | import org.mmtk.plan.marksweep.MSConstraints; 16 | import org.vmmagic.pragma.*; 17 | 18 | /** 19 | * This class and its subclasses communicate to the host VM/Runtime 20 | * any features of the selected plan that it needs to know. This is 21 | * separate from the main Plan/PlanLocal class in order to bypass any 22 | * issues with ordering of static initialization. 23 | */ 24 | @Uninterruptible 25 | public class PoisonedConstraints extends MSConstraints { 26 | @Override 27 | public boolean needsObjectReferenceWriteBarrier() { return true; } 28 | @Override 29 | public boolean needsObjectReferenceReadBarrier() { return true; } 30 | @Override 31 | public boolean needsObjectReferenceNonHeapWriteBarrier() { return false; } 32 | @Override 33 | public boolean needsObjectReferenceNonHeapReadBarrier() { return false; } 34 | } 35 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/refcount/RCBaseConstraints.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.refcount; 14 | 15 | import static org.mmtk.policy.SegregatedFreeListSpace.MAX_FREELIST_OBJECT_BYTES; 16 | import org.mmtk.plan.StopTheWorldConstraints; 17 | 18 | import org.vmmagic.pragma.*; 19 | 20 | /** 21 | * This class and its subclasses communicate to the host VM/Runtime 22 | * any features of the selected plan that it needs to know. This is 23 | * separate from the main Plan/PlanLocal class in order to bypass any 24 | * issues with ordering of static initialization. 25 | */ 26 | @Uninterruptible 27 | public class RCBaseConstraints extends StopTheWorldConstraints { 28 | @Override 29 | public int gcHeaderBits() { return RCHeader.GLOBAL_GC_BITS_REQUIRED; } 30 | @Override 31 | public int gcHeaderWords() { return RCHeader.GC_HEADER_WORDS_REQUIRED; } 32 | @Override 33 | public boolean needsObjectReferenceWriteBarrier() { return true; } 34 | @Override 35 | public int maxNonLOSDefaultAllocBytes() { return MAX_FREELIST_OBJECT_BYTES; } 36 | } 37 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/refcount/RCDecBuffer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.refcount; 14 | 15 | import org.mmtk.utility.Constants; 16 | import org.mmtk.utility.deque.*; 17 | 18 | import org.vmmagic.pragma.*; 19 | import org.vmmagic.unboxed.*; 20 | 21 | /** 22 | * This class implements a dec-buffer for a reference counting collector 23 | * 24 | * @see org.mmtk.plan.TransitiveClosure 25 | */ 26 | @Uninterruptible 27 | public final class RCDecBuffer extends ObjectReferenceBuffer implements Constants { 28 | /**************************************************************************** 29 | * 30 | * Initialization 31 | */ 32 | 33 | /** 34 | * Constructor 35 | * 36 | * @param queue The shared deque that is used. 37 | */ 38 | public RCDecBuffer(SharedDeque queue) { 39 | super("dec", queue); 40 | } 41 | 42 | /** 43 | * This is the method that ensures 44 | * 45 | * @param object The object to process. 46 | */ 47 | @Inline 48 | protected void process(ObjectReference object) { 49 | if (RCBase.isRCObject(object)) { 50 | push(object); 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/refcount/RCZero.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.refcount; 14 | 15 | import org.mmtk.plan.TransitiveClosure; 16 | 17 | import org.vmmagic.pragma.*; 18 | import org.vmmagic.unboxed.*; 19 | 20 | /** 21 | * This class is the fundamental mechanism for performing a 22 | * transitive closure over an object graph.

23 | * 24 | * @see org.mmtk.plan.TraceLocal 25 | */ 26 | @Uninterruptible 27 | public final class RCZero extends TransitiveClosure { 28 | 29 | /** 30 | * Trace an edge during GC. 31 | * 32 | * @param source The source of the reference. 33 | * @param slot The location containing the object reference. 34 | */ 35 | @Inline 36 | public void processEdge(ObjectReference source, Address slot) { 37 | slot.store(ObjectReference.nullReference()); 38 | } 39 | } 40 | 41 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/refcount/backuptrace/BTFreeLargeObjectSweeper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.refcount.backuptrace; 14 | 15 | import org.mmtk.plan.refcount.RCHeader; 16 | import org.mmtk.policy.ExplicitLargeObjectSpace; 17 | 18 | import org.vmmagic.pragma.*; 19 | import org.vmmagic.unboxed.*; 20 | 21 | /** 22 | * This class implements the freeing of large objects during a backup trace. 23 | */ 24 | @Uninterruptible 25 | public final class BTFreeLargeObjectSweeper extends ExplicitLargeObjectSpace.Sweeper { 26 | 27 | public boolean sweepLargeObject(ObjectReference object) { 28 | if (!RCHeader.isMarked(object)) { 29 | // Free the object 30 | return true; 31 | } 32 | // Clear the mark-bit and retain the object. 33 | RCHeader.clearMarked(object); 34 | return false; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/refcount/backuptrace/BTScanLargeObjectSweeper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.refcount.backuptrace; 14 | 15 | import org.mmtk.plan.refcount.RCHeader; 16 | import org.mmtk.policy.ExplicitLargeObjectSpace; 17 | import org.mmtk.vm.VM; 18 | 19 | import org.vmmagic.pragma.*; 20 | import org.vmmagic.unboxed.*; 21 | 22 | /** 23 | * This class implements the scanning of dead large objects during a backup trace. 24 | */ 25 | @Uninterruptible 26 | public final class BTScanLargeObjectSweeper extends ExplicitLargeObjectSpace.Sweeper { 27 | 28 | private final BTDecMarked sdm = new BTDecMarked(); 29 | 30 | public boolean sweepLargeObject(ObjectReference object) { 31 | if (!RCHeader.isMarked(object)) { 32 | VM.scanning.scanObject(sdm, object); 33 | } 34 | // Do not free any objects at this time 35 | return false; 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/refcount/backuptrace/BTSweepImmortalScanner.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.refcount.backuptrace; 14 | 15 | import org.mmtk.plan.refcount.RCHeader; 16 | import org.mmtk.utility.alloc.LinearScan; 17 | import org.mmtk.vm.VM; 18 | 19 | import org.vmmagic.pragma.*; 20 | import org.vmmagic.unboxed.*; 21 | 22 | /** 23 | * This class is used in backup tracing to sweep and zero any dead 'immortal' objects. 24 | */ 25 | @Uninterruptible 26 | public final class BTSweepImmortalScanner extends LinearScan { 27 | 28 | private final BTDecMarkedAndZero sdmAZ = new BTDecMarkedAndZero(); 29 | 30 | /** 31 | * Scan an object during sweep. 32 | * 33 | * @param object The source of the reference. 34 | */ 35 | @Inline 36 | public void scan(ObjectReference object) { 37 | if (!RCHeader.isMarked(object)) { 38 | VM.scanning.scanObject(sdmAZ, object); 39 | } else { 40 | RCHeader.clearMarked(object); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/refcount/backuptrace/BTSweeper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.refcount.backuptrace; 14 | 15 | import org.mmtk.plan.refcount.RCHeader; 16 | import org.mmtk.policy.ExplicitFreeListSpace; 17 | import org.mmtk.vm.VM; 18 | 19 | import org.vmmagic.pragma.*; 20 | import org.vmmagic.unboxed.*; 21 | 22 | /** 23 | * This class implements the thread-local core functionality for a transitive 24 | * closure over the heap graph. 25 | */ 26 | @Uninterruptible 27 | public final class BTSweeper extends ExplicitFreeListSpace.Sweeper { 28 | 29 | private final BTDecMarked sdm = new BTDecMarked(); 30 | 31 | public boolean sweepCell(ObjectReference object) { 32 | if (!RCHeader.isMarked(object)) { 33 | VM.scanning.scanObject(sdm, object); 34 | return true; 35 | } else { 36 | RCHeader.clearMarked(object); 37 | } 38 | return false; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/refcount/fullheap/RC.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.refcount.fullheap; 14 | 15 | import org.mmtk.plan.refcount.RCBase; 16 | import org.vmmagic.pragma.*; 17 | 18 | /** 19 | * This class implements the global state of a a simple reference counting collector. 20 | */ 21 | @Uninterruptible 22 | public class RC extends RCBase { 23 | } 24 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/refcount/fullheap/RCConstraints.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.refcount.fullheap; 14 | 15 | import org.mmtk.plan.refcount.RCBaseConstraints; 16 | import org.vmmagic.pragma.*; 17 | 18 | /** 19 | * This class and its subclasses communicate to the host VM/Runtime 20 | * any features of the selected plan that it needs to know. This is 21 | * separate from the main Plan/PlanLocal class in order to bypass any 22 | * issues with ordering of static initialization. 23 | */ 24 | @Uninterruptible 25 | public class RCConstraints extends RCBaseConstraints { 26 | } 27 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/refcount/fullheap/RCModifiedProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.refcount.fullheap; 14 | 15 | import org.mmtk.plan.TransitiveClosure; 16 | import org.mmtk.plan.refcount.RCBase; 17 | import org.mmtk.plan.refcount.RCHeader; 18 | 19 | import org.vmmagic.pragma.*; 20 | import org.vmmagic.unboxed.*; 21 | 22 | /** 23 | * This class is the fundamental mechanism for performing a 24 | * transitive closure over an object graph.

25 | * 26 | * @see org.mmtk.plan.TraceLocal 27 | */ 28 | @Uninterruptible 29 | public final class RCModifiedProcessor extends TransitiveClosure { 30 | 31 | /** 32 | * Trace an edge during GC. 33 | * 34 | * @param source The source of the reference. 35 | * @param slot The location containing the object reference. 36 | */ 37 | @Inline 38 | public void processEdge(ObjectReference source, Address slot) { 39 | ObjectReference object = slot.loadObjectReference(); 40 | if (RCBase.isRCObject(object)) { 41 | RCHeader.incRC(object); 42 | } 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/refcount/fullheap/RCMutator.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.refcount.fullheap; 14 | 15 | import org.mmtk.plan.refcount.RCBaseMutator; 16 | import org.vmmagic.pragma.*; 17 | 18 | /** 19 | * This class implements the mutator context for a simple reference counting collector. 20 | */ 21 | @Uninterruptible 22 | public class RCMutator extends RCBaseMutator { 23 | } 24 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/refcount/generational/GenRCConstraints.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.refcount.generational; 14 | 15 | import static org.mmtk.policy.SegregatedFreeListSpace.MAX_FREELIST_OBJECT_BYTES; 16 | 17 | import org.mmtk.plan.refcount.RCBaseConstraints; 18 | import org.vmmagic.pragma.*; 19 | 20 | /** 21 | * This class and its subclasses communicate to the host VM/Runtime 22 | * any features of the selected plan that it needs to know. This is 23 | * separate from the main Plan/PlanLocal class in order to bypass any 24 | * issues with ordering of static initialization. 25 | */ 26 | @Uninterruptible 27 | public class GenRCConstraints extends RCBaseConstraints { 28 | @Override 29 | public boolean movesObjects() { return true; } 30 | @Override 31 | public int maxNonLOSCopyBytes() { return MAX_FREELIST_OBJECT_BYTES;} 32 | } 33 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/semispace/SSConstraints.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.semispace; 14 | 15 | import org.mmtk.plan.*; 16 | import org.mmtk.policy.CopySpace; 17 | import org.vmmagic.pragma.*; 18 | 19 | /** 20 | * SemiSpace common constants. 21 | */ 22 | @Uninterruptible 23 | public class SSConstraints extends StopTheWorldConstraints { 24 | @Override 25 | public boolean movesObjects() { return true; } 26 | @Override 27 | public int gcHeaderBits() { return CopySpace.LOCAL_GC_BITS_REQUIRED; } 28 | @Override 29 | public int gcHeaderWords() { return CopySpace.GC_HEADER_WORDS_REQUIRED; } 30 | @Override 31 | public int numSpecializedScans() { return 1; } 32 | } 33 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/semispace/gcspy/SSGCspyConstraints.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.semispace.gcspy; 14 | 15 | import org.mmtk.plan.semispace.SSConstraints; 16 | import org.vmmagic.pragma.*; 17 | 18 | /** 19 | * Semi space GCspy constants. 20 | */ 21 | @Uninterruptible 22 | public class SSGCspyConstraints extends SSConstraints { 23 | @Override 24 | public boolean needsLinearScan() { return true; } 25 | @Override 26 | public boolean withGCspy() { return true; } 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/semispace/gctrace/GCTraceConstraints.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.semispace.gctrace; 14 | 15 | import org.mmtk.plan.semispace.SSConstraints; 16 | 17 | import org.vmmagic.pragma.*; 18 | 19 | /** 20 | * GCTrace constants. 21 | */ 22 | @Uninterruptible 23 | public class GCTraceConstraints extends SSConstraints { 24 | @Override 25 | public boolean needsObjectReferenceWriteBarrier() { return true; } 26 | @Override 27 | public boolean generateGCTrace() { return true; } 28 | } 29 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriers.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.semispace.usePrimitiveWriteBarriers; 14 | 15 | import org.mmtk.plan.semispace.SS; 16 | 17 | import org.vmmagic.pragma.*; 18 | 19 | /** 20 | * This class exercises primitive write barriers The write barriers contain no 21 | * payloads but merely perform a write to the heap 22 | */ 23 | @Uninterruptible 24 | public class UsePrimitiveWriteBarriers extends SS { 25 | 26 | } 27 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersCollector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.plan.semispace.usePrimitiveWriteBarriers; 14 | 15 | import org.mmtk.plan.semispace.SSCollector; 16 | import org.vmmagic.pragma.*; 17 | 18 | /** 19 | * This class extends the {@link SSCollector} class as part of the 20 | * {@link UsePrimitiveWriteBarriers} collector. All implementation details 21 | * concerning GC are handled by {@link SSCollector} 22 | */ 23 | @Uninterruptible 24 | public class UsePrimitiveWriteBarriersCollector extends SSCollector { 25 | } 26 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/policy/CopyLocal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.policy; 14 | 15 | import org.mmtk.utility.alloc.BumpPointer; 16 | 17 | import org.vmmagic.pragma.*; 18 | 19 | /** 20 | * This class implements unsynchronized (local) elements of a 21 | * copying collector. Allocation is via the bump pointer 22 | * (@see BumpPointer). 23 | * 24 | * @see BumpPointer 25 | * @see CopySpace 26 | */ 27 | @Uninterruptible public final class CopyLocal extends BumpPointer { 28 | 29 | /** 30 | * Constructor 31 | * 32 | * @param space The space to bump point into. 33 | */ 34 | public CopyLocal(CopySpace space) { 35 | super(space, true); 36 | } 37 | 38 | /** 39 | * Constructor 40 | */ 41 | public CopyLocal() { 42 | super(null, true); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/policy/ImmortalLocal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.policy; 14 | 15 | import org.mmtk.utility.alloc.BumpPointer; 16 | 17 | import org.vmmagic.pragma.*; 18 | 19 | /** 20 | * This class implements unsynchronized (local) elements of an 21 | * immortal space. Allocation is via the bump pointer 22 | * (@see BumpPointer). 23 | * 24 | * @see BumpPointer 25 | * @see ImmortalSpace 26 | */ 27 | @Uninterruptible public final class ImmortalLocal extends BumpPointer { 28 | 29 | /** 30 | * Constructor 31 | * 32 | * @param space The space to bump point into. 33 | */ 34 | public ImmortalLocal(ImmortalSpace space) { 35 | super(space, true); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/policy/immix/MutatorLocal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.policy.immix; 14 | 15 | import org.mmtk.utility.alloc.ImmixAllocator; 16 | import org.mmtk.utility.Constants; 17 | 18 | import org.vmmagic.pragma.*; 19 | 20 | /** 21 | * 22 | */ 23 | @Uninterruptible 24 | public final class MutatorLocal extends ImmixAllocator 25 | implements Constants { 26 | /** 27 | * Constructor 28 | * 29 | * @param space The mark-sweep space to which this allocator 30 | * instances is bound. 31 | * @param hot TODO 32 | */ 33 | public MutatorLocal(ImmixSpace space, boolean hot) { 34 | super(space, hot, false); 35 | } 36 | 37 | /**************************************************************************** 38 | * 39 | * Collection 40 | */ 41 | 42 | /** 43 | * Prepare for a collection. If paranoid, perform a sanity check. 44 | */ 45 | public void prepare() { 46 | reset(); 47 | } 48 | 49 | /** 50 | * Finish up after a collection. 51 | */ 52 | public void release() { 53 | reset(); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/CallSite.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility; 14 | 15 | /* 16 | */ 17 | public class CallSite { 18 | } 19 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/CycleDetector.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility; 14 | 15 | import org.mmtk.utility.options.*; 16 | 17 | import org.vmmagic.unboxed.*; 18 | import org.vmmagic.pragma.*; 19 | 20 | /* 21 | */ 22 | @Uninterruptible abstract class CycleDetector { 23 | 24 | static { 25 | Options.cycleFilterThreshold = new CycleFilterThreshold(); 26 | Options.cycleMetaDataLimit = new CycleMetaDataLimit(); 27 | Options.cycleTriggerThreshold = new CycleTriggerThreshold(); 28 | } 29 | 30 | abstract boolean collectCycles(boolean primary, boolean time); 31 | abstract void possibleCycleRoot(ObjectReference object); 32 | } 33 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/Synchronize.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility; 14 | 15 | import org.vmmagic.pragma.*; 16 | 17 | /* 18 | */ 19 | @Uninterruptible public class Synchronize{ 20 | 21 | 22 | } 23 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/TracingConstants.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility; 14 | 15 | import org.vmmagic.unboxed.*; 16 | 17 | /** 18 | * The constants needed when storing events and then generating the trace. 19 | */ 20 | public interface TracingConstants { 21 | Word TRACE_EXACT_ALLOC = Word.zero(); 22 | Word TRACE_BOOT_ALLOC = Word.one().lsh(0); 23 | Word TRACE_ALLOC = Word.one().lsh(1); 24 | Word TRACE_DEATH = Word.one().lsh(2); 25 | Word TRACE_FIELD_SET = Word.one().lsh(3); 26 | Word TRACE_ARRAY_SET = Word.one().lsh(4); 27 | Word TRACE_TIB_SET = Word.one().lsh(5); 28 | Word TRACE_STATIC_SET = Word.one().lsh(6); 29 | Word TRACE_BOOTSTART = Word.one().lsh(7); 30 | Word TRACE_BOOTEND = Word.one().lsh(8); 31 | Word TRACE_GCSTART = Word.one().lsh(9); 32 | Word TRACE_GCEND = Word.one().lsh(10); 33 | Word TRACE_GCROOT = Word.one().lsh(11); 34 | Word TRACE_GCBAR = Word.one().lsh(12); 35 | Word TRACE_THREAD_SWITCH = Word.one().lsh(13); 36 | Word TRACE_STACKDELTA = Word.one().lsh(14); 37 | Word TRACE_ROOTPTR = Word.one().lsh(15); 38 | Word TRACE_EXACT_IMMORTAL_ALLOC = Word.one().lsh(16); 39 | Word TRACE_IMMORTAL_ALLOC = Word.one().lsh(17); 40 | } 41 | 42 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/alloc/DumpLinearScan.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.alloc; 14 | 15 | import org.mmtk.vm.VM; 16 | import org.mmtk.utility.Log; 17 | 18 | import org.vmmagic.unboxed.*; 19 | import org.vmmagic.pragma.*; 20 | 21 | /** 22 | * Simple linear scan to dump object information. 23 | */ 24 | @Uninterruptible 25 | public final class DumpLinearScan extends LinearScan { 26 | /** 27 | * Scan an object. 28 | * 29 | * @param object The object to scan 30 | */ 31 | @Inline 32 | public void scan(ObjectReference object) { 33 | Log.write("["); 34 | Log.write(object.toAddress()); 35 | Log.write("], SIZE = "); 36 | Log.writeln(VM.objectModel.getCurrentSize(object)); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/alloc/LinearScan.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.alloc; 14 | 15 | import org.vmmagic.unboxed.*; 16 | import org.vmmagic.pragma.*; 17 | 18 | /** 19 | * Callbacks from BumpPointer during a linear scan are dispatched through 20 | * a subclass of this object. 21 | */ 22 | @Uninterruptible 23 | public abstract class LinearScan { 24 | /** 25 | * Scan an object. 26 | * 27 | * @param object The object to scan 28 | */ 29 | public abstract void scan(ObjectReference object); 30 | } 31 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/deque/SortTODSharedDeque.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.deque; 14 | 15 | import org.mmtk.policy.RawPageSpace; 16 | import org.mmtk.vm.VM; 17 | 18 | import org.vmmagic.unboxed.*; 19 | import org.vmmagic.pragma.*; 20 | 21 | /** 22 | * This class specializes SortSharedQueue to sort objects according to 23 | * their time of death (TOD). 24 | */ 25 | @Uninterruptible 26 | public final class SortTODSharedDeque extends SortSharedDeque { 27 | 28 | /** 29 | * Constructor 30 | * 31 | * @param rps The space from which the instance should obtain buffers. 32 | * @param arity The arity of the data to be enqueued 33 | */ 34 | public SortTODSharedDeque(String name, RawPageSpace rps, int arity) { 35 | super(name, rps, arity); 36 | } 37 | 38 | /** 39 | * Return the sorting key for the object passed as a parameter. 40 | * 41 | * @param obj The address of the object whose key is wanted 42 | * @return The value of the sorting key for this object 43 | */ 44 | protected Word getKey(Address obj) { 45 | return VM.traceInterface.getDeathTime(obj.toObjectReference()); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/deque/WriteBuffer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.deque; 14 | 15 | import org.mmtk.utility.Constants; 16 | 17 | import org.vmmagic.unboxed.*; 18 | import org.vmmagic.pragma.*; 19 | 20 | /** 21 | * This supports unsynchronized insertion of write buffer values. 22 | */ 23 | @Uninterruptible public class WriteBuffer extends LocalSSB 24 | implements Constants { 25 | 26 | /**************************************************************************** 27 | * 28 | * Public instance methods 29 | */ 30 | 31 | /** 32 | * Constructor 33 | * 34 | * @param queue The shared queue to which this local ssb will append 35 | * its buffers (when full or flushed). 36 | */ 37 | public WriteBuffer(SharedDeque queue) { 38 | super(queue); 39 | } 40 | 41 | /** 42 | * Insert a value to be remembered into the write buffer. 43 | * 44 | * @param addr the value to be inserted into the write buffer 45 | */ 46 | @NoInline 47 | public final void insert(Address addr) { 48 | checkTailInsert(1); 49 | uncheckedTailInsert(addr); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/gcspy/LinearScan.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.gcspy; 14 | 15 | import org.mmtk.utility.gcspy.drivers.AbstractDriver; 16 | 17 | import org.vmmagic.unboxed.*; 18 | import org.vmmagic.pragma.*; 19 | 20 | /** 21 | * This class is only necessary because we cannot implement 22 | * org.mmtk.utility.alloc.LinearScan as an interface since the invokeinterface 23 | * bytecode is forbidden in uninterruptible code. 24 | */ 25 | @Uninterruptible public class LinearScan extends org.mmtk.utility.alloc.LinearScan { 26 | 27 | private final AbstractDriver driver; 28 | 29 | /** 30 | * Create a new scanner. 31 | * @param d The GCspy driver that provides the callback. 32 | */ 33 | public LinearScan(AbstractDriver d) { driver = d; } 34 | 35 | /** 36 | * Scan an object. The object reference is passed to the scan method of the 37 | * GCspy driver registered with this scanner. 38 | * @param obj The object to scan. 39 | */ 40 | public void scan(ObjectReference obj) { driver.scan(obj); } 41 | } 42 | 43 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/BoundedNursery.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | import org.mmtk.plan.Plan; 16 | 17 | /** 18 | * Provide an upper bound on nursery size. This option is not intended to 19 | * be created directly, but via NurserySize. 20 | */ 21 | public final class BoundedNursery extends org.vmutil.options.PagesOption { 22 | /** 23 | * Create the option. 24 | */ 25 | public BoundedNursery() { 26 | super(Options.set, "Bounded Nursery", 27 | "Bound the maximum size of the nursery to this value", 28 | Plan.DEFAULT_MAX_NURSERY); 29 | } 30 | 31 | /** 32 | * Nursery can not be empty. 33 | */ 34 | protected void validate() { 35 | failIf(value <= 0, "Can not have an empty nursery"); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/ConcurrentTrigger.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Concurrent trigger percentage 17 | */ 18 | public class ConcurrentTrigger extends org.vmutil.options.IntOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public ConcurrentTrigger() { 23 | super(Options.set, "Concurrent Trigger", 24 | "Concurrent trigger percentage", 25 | 50); 26 | } 27 | 28 | /** 29 | * Only accept values between 1 and 100 (inclusive) 30 | */ 31 | protected void validate() { 32 | failIf(this.value <= 0, "Trigger must be between 1 and 100"); 33 | failIf(this.value > 100, "Trigger must be between 1 and 100"); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/CycleFilterThreshold.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Trigger cycle buffer filtering if the space available falls below this threshold. 17 | */ 18 | public final class CycleFilterThreshold extends org.vmutil.options.PagesOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public CycleFilterThreshold() { 23 | super(Options.set, "Cycle Filter Threshold", 24 | "Trigger cycle buffer filtering if the space available falls below this threshold", 25 | 512); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/CycleMetaDataLimit.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Trigger cycle detection if the meta data volume grows to this limit. 17 | */ 18 | public final class CycleMetaDataLimit extends org.vmutil.options.PagesOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public CycleMetaDataLimit() { 23 | super(Options.set, "Cycle Meta Data Limit", 24 | "Trigger cycle detection if the meta data volume grows to this limit", 25 | 4096); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/CycleTriggerThreshold.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Trigger cycle detection if the space available falls below this threshold. 17 | */ 18 | public final class CycleTriggerThreshold extends org.vmutil.options.PagesOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public CycleTriggerThreshold() { 23 | super(Options.set, "Cycle Trigger Threshold", 24 | "Trigger cycle detection if the space available falls below this threshold", 25 | 512); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/DebugAddress.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | import org.vmmagic.unboxed.Address; 16 | 17 | /** 18 | * Allow an address to be specified on the command line for use in debugging. 19 | */ 20 | public final class DebugAddress extends org.vmutil.options.AddressOption { 21 | /** 22 | * Create the option 23 | */ 24 | public DebugAddress() { 25 | super(Options.set, "Debug Address", 26 | "Specify an address at runtime for use in debugging", 27 | Address.zero()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/DefragFreeHeadroom.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | import static org.mmtk.policy.immix.ImmixConstants.DEFAULT_DEFRAG_FREE_HEADROOM; 16 | 17 | public class DefragFreeHeadroom extends org.vmutil.options.PagesOption { 18 | /** 19 | * Create the option. 20 | */ 21 | public DefragFreeHeadroom() { 22 | super(Options.set, "Defrag Free Headroom", 23 | "Allow the defragmenter this amount of free headroom during defrag. For analysis purposes only!", 24 | DEFAULT_DEFRAG_FREE_HEADROOM); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/DefragFreeHeadroomFraction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | import static org.mmtk.policy.immix.ImmixConstants.DEFAULT_DEFRAG_FREE_HEADROOM_FRACTION; 16 | 17 | public class DefragFreeHeadroomFraction extends org.vmutil.options.FloatOption { 18 | /** 19 | * Create the option. 20 | */ 21 | public DefragFreeHeadroomFraction() { 22 | super(Options.set, "Defrag Free Headroom Fraction", 23 | "Allow the defragmenter this fraction of the heap size as free headroom during defrag. For analysis purposes only!", 24 | DEFAULT_DEFRAG_FREE_HEADROOM_FRACTION); 25 | } 26 | 27 | /** 28 | * Ensure the value is valid. 29 | */ 30 | protected void validate() { 31 | failIf((this.value < 0 || this.value > 1.0), "Ratio must be a float between 0 and 1"); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/DefragHeadroom.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | import static org.mmtk.policy.immix.ImmixConstants.DEFAULT_DEFRAG_HEADROOM; 16 | 17 | /** 18 | */ 19 | public class DefragHeadroom extends org.vmutil.options.PagesOption { 20 | /** 21 | * Create the option. 22 | */ 23 | public DefragHeadroom() { 24 | super(Options.set, "Defrag Headroom", 25 | "Allow the defragmenter this amount of headroom during defrag.", 26 | DEFAULT_DEFRAG_HEADROOM); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/DefragHeadroomFraction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | import static org.mmtk.policy.immix.ImmixConstants.DEFAULT_DEFRAG_HEADROOM_FRACTION; 16 | 17 | public class DefragHeadroomFraction extends org.vmutil.options.FloatOption { 18 | /** 19 | * Create the option. 20 | */ 21 | public DefragHeadroomFraction() { 22 | super(Options.set, "Defrag Headroom Fraction", 23 | "Allow the defrag this fraction of the heap as headroom during defrag.", 24 | DEFAULT_DEFRAG_HEADROOM_FRACTION); 25 | } 26 | 27 | /** 28 | * Ensure the value is valid. 29 | */ 30 | protected void validate() { 31 | failIf((this.value < 0 || this.value > 1.0), "Ratio must be a float between 0 and 1"); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/DefragLineReuseRatio.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | import static org.mmtk.policy.immix.ImmixConstants.DEFAULT_DEFRAG_LINE_REUSE_RATIO; 16 | 17 | public class DefragLineReuseRatio extends org.vmutil.options.FloatOption { 18 | /** 19 | * Create the option. 20 | */ 21 | public DefragLineReuseRatio() { 22 | super(Options.set, "Defrag Line Reuse Ratio", 23 | "Blocks with this fraction marked may be reused for defrag allocation", 24 | DEFAULT_DEFRAG_LINE_REUSE_RATIO); 25 | } 26 | 27 | /** 28 | * Ensure the value is valid. 29 | */ 30 | protected void validate() { 31 | failIf((this.value <= 0 || this.value > 1.0), "Ratio must be a float between 0 and 1"); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/DefragSimpleSpillThreshold.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | import static org.mmtk.policy.immix.ImmixConstants.DEFAULT_SIMPLE_SPILL_THRESHOLD; 16 | 17 | public class DefragSimpleSpillThreshold extends org.vmutil.options.FloatOption { 18 | /** 19 | * Create the option. 20 | */ 21 | public DefragSimpleSpillThreshold() { 22 | super(Options.set, "Defrag Simple Spill Threshold", 23 | "Blocks with this fraction spilled will be defrag sources", 24 | DEFAULT_SIMPLE_SPILL_THRESHOLD); 25 | } 26 | 27 | /** 28 | * Ensure the value is valid. 29 | */ 30 | protected void validate() { 31 | failIf((this.value <= 0 || this.value > 1.0), "Ratio must be a float between 0 and 1"); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/DefragStress.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Should we force degfrag every time the immix space is collected? 17 | */ 18 | public final class DefragStress extends org.vmutil.options.BooleanOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public DefragStress() { 23 | super(Options.set, "Defrag Stress", 24 | "Should we force degfrag every time the immix space is collected?", 25 | false); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/DummyEnum.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * A sample enumeration for testing. 17 | */ 18 | public final class DummyEnum extends org.vmutil.options.EnumOption { 19 | 20 | // enumeration values. 21 | public final int FOO = 0; 22 | public final int BAR = 1; 23 | 24 | /** 25 | * Create the option. 26 | */ 27 | public DummyEnum() { 28 | super(Options.set, "Dummy Enum", 29 | "This is a sample enumeration to test the options system", 30 | new String[] {"foo", "bar"}, 31 | "foo"); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/EagerCompleteSweep.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Should we eagerly finish sweeping at the start of a collection 17 | */ 18 | public final class EagerCompleteSweep extends org.vmutil.options.BooleanOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public EagerCompleteSweep() { 23 | super(Options.set, "Eager Complete Sweep", 24 | "Should we eagerly finish sweeping at the start of a collection", 25 | false); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/EagerMmapSpaces.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Should spaces be eagerly demand zero mmapped? 17 | */ 18 | public final class EagerMmapSpaces extends org.vmutil.options.BooleanOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public EagerMmapSpaces() { 23 | super(Options.set, "Eager Mmap Spaces", 24 | "If true, all spaces are eagerly demand zero mmapped at boot time", 25 | false); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/EchoOptions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Echo when options are set? 17 | */ 18 | public final class EchoOptions extends org.vmutil.options.BooleanOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public EchoOptions() { 23 | super(Options.set, "Echo Options", 24 | "Echo when options are set?", 25 | false); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/FixedNursery.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | import org.mmtk.plan.Plan; 16 | 17 | /** 18 | * Provide an lower and upper bound on nursery size. 19 | * 20 | * This option is not intended to be created directly, but via NurserySize. 21 | */ 22 | public final class FixedNursery extends org.vmutil.options.PagesOption { 23 | // values 24 | BoundedNursery boundedNursery; 25 | 26 | /** 27 | * Create the option 28 | */ 29 | public FixedNursery(BoundedNursery boundedNursery) { 30 | super(Options.set, "Fixed Nursery", 31 | "Fix the minimum and maximum size of the nursery to this value", 32 | Plan.DEFAULT_MIN_NURSERY); 33 | this.boundedNursery = boundedNursery; 34 | } 35 | 36 | /** 37 | * Nursery can not be empty. 38 | */ 39 | protected void validate() { 40 | failIf(value <= 0, "Can not have an empty nursery"); 41 | // Update upper bound. 42 | boundedNursery.setBytes(this.getBytes()); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/FragmentationStats.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Option to print fragmentation information for the free list. 17 | */ 18 | public final class FragmentationStats extends org.vmutil.options.BooleanOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public FragmentationStats() { 23 | super(Options.set, "Fragmentation Stats", 24 | "Should we print fragmentation statistics for the free list allocator?", 25 | false); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/FullHeapSystemGC.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Should a major GC be performed when a system GC is triggered? 17 | */ 18 | public final class FullHeapSystemGC extends org.vmutil.options.BooleanOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public FullHeapSystemGC() { 23 | super(Options.set, "Full Heap System GC", 24 | "Should a major GC be performed when a system GC is triggered?", 25 | false); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/GCTimeCap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Try to limit reference counting collections to this time cap. 17 | */ 18 | public final class GCTimeCap extends org.vmutil.options.MicrosecondsOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public GCTimeCap() { 23 | super(Options.set, "GC Time Cap", 24 | "Try to limit reference counting collections to this time cap", 25 | 1000000); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/GCspyPort.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Port number for GCSpy server to connect with visualiser. 17 | */ 18 | public final class GCspyPort extends org.vmutil.options.IntOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public GCspyPort() { 23 | super(Options.set, "GCSpy Port", 24 | "Port number for GCSpy server to connect with visualiser", 25 | 0); 26 | } 27 | 28 | /** 29 | * Ensure the port is valid. 30 | */ 31 | protected void validate() { 32 | failIf(this.value <= 0, "Unreasonable GCSpy port value"); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/GCspyTileSize.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * GCspy Tile Size. 17 | */ 18 | public final class GCspyTileSize extends org.vmutil.options.IntOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public GCspyTileSize() { 23 | super(Options.set, "GCspy Tile Size", 24 | "GCspy Tile Size", 25 | 131072); 26 | } 27 | 28 | /** 29 | * Ensure the tile size is positive 30 | */ 31 | protected void validate() { 32 | failIf(this.value <= 0, "Unreasonable gcspy tilesize"); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/GCspyWait.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Should the VM wait for the visualiser to connect? 17 | */ 18 | public final class GCspyWait extends org.vmutil.options.BooleanOption { 19 | /** 20 | * Create the option 21 | */ 22 | public GCspyWait() { 23 | super(Options.set, "GCSpy Wait", 24 | "Should the VM wait for the visualiser to connect?", 25 | false); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/GenCycleDetection.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Should we use a generational approach to cycle detection? 17 | */ 18 | public final class GenCycleDetection extends org.vmutil.options.BooleanOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public GenCycleDetection() { 23 | super(Options.set, "Gen Cycle Detection", 24 | "Should we use a generational approach to cycle detection?", 25 | false); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/HarnessAll.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Should we wrap the entire execution with a harnessBegin/harnessEnd? 17 | */ 18 | public final class HarnessAll extends org.vmutil.options.BooleanOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public HarnessAll() { 23 | super(Options.set, "Harness All", 24 | "Should we wrap the entire execution inside calls to harnessBegin and harnessEnd?", 25 | false); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/IgnoreSystemGC.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Should we ignore calls to java.lang.System.gc? 17 | */ 18 | public final class IgnoreSystemGC extends org.vmutil.options.BooleanOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public IgnoreSystemGC() { 23 | super(Options.set, "Ignore System GC", 24 | "Should we ignore calls to java.lang.System.gc?", 25 | false); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/LineReuseRatio.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | import static org.mmtk.policy.immix.ImmixConstants.DEFAULT_LINE_REUSE_RATIO; 16 | 17 | /** 18 | */ 19 | public class LineReuseRatio extends org.vmutil.options.FloatOption { 20 | /** 21 | * Create the option. 22 | */ 23 | public LineReuseRatio() { 24 | super(Options.set, "Line Reuse Ratio", 25 | "Blocks with this fraction marked may be reused for allocation", 26 | DEFAULT_LINE_REUSE_RATIO); 27 | } 28 | 29 | /** 30 | * Ensure the value is valid. 31 | */ 32 | protected void validate() { 33 | failIf((this.value <= 0 || this.value > 1.0), "Ratio must be a float between 0 and 1"); 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/MarkSweepMarkBits.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | import org.mmtk.policy.MarkSweepSpace; 16 | 17 | /** 18 | * Number of bits to use for the header cycle of mark sweep spaces. 19 | */ 20 | public final class MarkSweepMarkBits extends org.vmutil.options.IntOption { 21 | /** 22 | * Create the option. 23 | */ 24 | public MarkSweepMarkBits() { 25 | super(Options.set, "Mark Sweep Mark Bits", 26 | "Number of bits to use for the header cycle of mark sweep spaces", 27 | MarkSweepSpace.DEFAULT_MARKCOUNT_BITS); 28 | } 29 | 30 | /** 31 | * Ensure the value is valid. 32 | */ 33 | protected void validate() { 34 | failIf(this.value <= 0, "Must provide at least one bit"); 35 | failIf(this.value > MarkSweepSpace.MAX_MARKCOUNT_BITS , "Only "+MarkSweepSpace.MAX_MARKCOUNT_BITS+" bits are reserved in MarkSweepSpace"); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/MetaDataLimit.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Provide a bound on how much metadata is allowed before a GC is triggered. 17 | */ 18 | public final class MetaDataLimit extends org.vmutil.options.PagesOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public MetaDataLimit() { 23 | super(Options.set, "Meta Data Limit", 24 | "Trigger a GC if the meta data volume grows to this limit", 25 | 4096); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/NoFinalizer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Should finalization be disabled? 17 | */ 18 | public final class NoFinalizer extends org.vmutil.options.BooleanOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public NoFinalizer() { 23 | super(Options.set, "No Finalizer", 24 | "Should finalization be disabled?", 25 | false); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/NoReferenceTypes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Should reference type processing be disabled? 17 | */ 18 | public final class NoReferenceTypes extends org.vmutil.options.BooleanOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public NoReferenceTypes() { 23 | super(Options.set, "No Reference Types", 24 | "Should reference type processing be disabled?", 25 | false); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/NurserySize.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | import org.vmmagic.pragma.*; 16 | 17 | /** 18 | * A composite option that provides a min/max interface to MMTk, 19 | * and a fixed/bounded option interface to the VM/user. 20 | */ 21 | public final class NurserySize { 22 | // values 23 | private FixedNursery fixedNursery; 24 | private BoundedNursery boundedNursery; 25 | 26 | /** 27 | * Create the options. 28 | */ 29 | public NurserySize() { 30 | boundedNursery = new BoundedNursery(); 31 | fixedNursery = new FixedNursery(boundedNursery); 32 | } 33 | 34 | /** 35 | * Read the upper bound of the nursery size. 36 | * 37 | * @return maximum number of pages in the nursery. 38 | */ 39 | @Uninterruptible 40 | public int getMaxNursery() { 41 | return boundedNursery.getPages(); 42 | } 43 | 44 | /** 45 | * Read the lower bound of the nursery size. 46 | * 47 | * @return minimum number of pages in the nursery. 48 | */ 49 | @Uninterruptible 50 | public int getMinNursery() { 51 | return fixedNursery.getPages(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/PerfEvents.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Performance counter options. 17 | */ 18 | public class PerfEvents extends org.vmutil.options.StringOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public PerfEvents() { 23 | super(Options.set, "Perf Events", 24 | "Use this to specify a comma seperated list of performance events to measure", 25 | ""); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/PrintPhaseStats.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * When printing statistics, should statistics for each 17 | * gc-mutator phase be printed? 18 | */ 19 | public final class PrintPhaseStats extends org.vmutil.options.BooleanOption { 20 | /** 21 | * Create the option. 22 | */ 23 | public PrintPhaseStats() { 24 | super(Options.set, "Print Phase Stats", 25 | "When printing statistics, should statistics for each gc-mutator phase be printed?", 26 | false); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/ProtectOnRelease.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Should memory be protected on release? 17 | */ 18 | public final class ProtectOnRelease extends org.vmutil.options.BooleanOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public ProtectOnRelease() { 23 | super(Options.set, "Protect On Release", 24 | "Should memory be protected on release?", 25 | false); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/SanityCheck.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | 16 | /** 17 | * Should a major GC be performed when a system GC is triggered? 18 | */ 19 | public final class SanityCheck extends org.vmutil.options.BooleanOption { 20 | /** 21 | * Create the option. 22 | */ 23 | public SanityCheck() { 24 | super(Options.set, "Sanity Check", 25 | "Perform sanity checks before and after each collection?", 26 | false); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/StressFactor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | import org.mmtk.plan.Plan; 16 | import org.mmtk.utility.Constants; 17 | 18 | /** 19 | * Force frequent collections after amounts of allocation. 20 | */ 21 | public final class StressFactor extends org.vmutil.options.PagesOption { 22 | /** 23 | * Create the option, defaulting to the maximum possible value. 24 | */ 25 | public StressFactor() { 26 | super(Options.set, "Stress Factor", 27 | "Force a collection after this much allocation", 28 | Integer.MAX_VALUE >>> Constants.LOG_BYTES_IN_PAGE); 29 | } 30 | 31 | /** 32 | * Ensure that the value is sensible. 33 | */ 34 | public void validate() { 35 | failIf(this.value < Plan.DEFAULT_POLL_FREQUENCY, 36 | "Stress Factor must be at least equal to plan's poll frequency"); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/TraceRate.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | import org.vmmagic.pragma.*; 16 | 17 | /** 18 | * The granularity of the trace being produced. 19 | */ 20 | public final class TraceRate extends org.vmutil.options.IntOption 21 | implements org.mmtk.utility.Constants { 22 | /** 23 | * Create the option. 24 | */ 25 | public TraceRate() { 26 | super(Options.set, "Trace Rate", 27 | "The granularity of the trace being produced. By default, the trace has the maximum possible granularity.", 28 | Integer.MAX_VALUE); 29 | } 30 | 31 | /** 32 | * Return the appropriate value. 33 | * 34 | * @return the trace rate. 35 | */ 36 | @Uninterruptible 37 | public int getValue() { 38 | return (this.value < BYTES_IN_ADDRESS) ? 1 : (this.value >> LOG_BYTES_IN_ADDRESS); 39 | } 40 | 41 | /** 42 | * Trace rate must be positive. 43 | */ 44 | protected void validate() { 45 | failIf(value <= 0, "Can not have a negative trace rate"); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/VariableSizeHeap.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Should we shrink/grow the heap to adjust to application working set? 17 | */ 18 | public final class VariableSizeHeap extends org.vmutil.options.BooleanOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public VariableSizeHeap() { 23 | super(Options.set, "Variable Size Heap", 24 | "Should we shrink/grow the heap to adjust to application working set?", 25 | true); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/Verbose.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * GC verbosity level. 17 | */ 18 | public final class Verbose extends org.vmutil.options.IntOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public Verbose() { 23 | super(Options.set, "Verbose", 24 | "GC verbosity level", 25 | 0); 26 | } 27 | 28 | /** 29 | * Only accept non-negative values. 30 | */ 31 | protected void validate() { 32 | failIf(this.value < 0, "Unreasonable verbosity level"); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/VerboseFragmentationStats.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Should we print verbose fragmentation statistics for the free list allocator? 17 | */ 18 | public final class VerboseFragmentationStats extends org.vmutil.options.BooleanOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public VerboseFragmentationStats() { 23 | super(Options.set, "Verbose Fragmentation Stats", 24 | "Should we print verbose fragmentation statistics for the free list allocator?", 25 | false); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/VerboseTiming.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Should we display detailed breakdown of where GC time is spent? 17 | */ 18 | public final class VerboseTiming extends org.vmutil.options.BooleanOption { 19 | /** 20 | * Create the option. 21 | */ 22 | public VerboseTiming() { 23 | super(Options.set, "Verbose Timing", 24 | "Should we display detailed breakdown of where GC time is spent?", 25 | false); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/options/XmlStats.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.options; 14 | 15 | /** 16 | * Display statistics and options in XML rather than himan-readable 17 | * format. 18 | */ 19 | public final class XmlStats extends org.vmutil.options.BooleanOption { 20 | 21 | /** 22 | * Create the option. 23 | */ 24 | public XmlStats() { 25 | super(Options.set, "Xml Stats", "Print end-of-run statistics in XML format", false); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/utility/sanitychecker/SanityLinearScan.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.utility.sanitychecker; 14 | 15 | import org.mmtk.utility.alloc.LinearScan; 16 | 17 | import org.vmmagic.pragma.*; 18 | import org.vmmagic.unboxed.ObjectReference; 19 | 20 | /** 21 | * This class performs sanity checks for Simple collectors. 22 | */ 23 | @Uninterruptible 24 | final class SanityLinearScan extends LinearScan { 25 | 26 | private final SanityChecker sanityChecker; 27 | public SanityLinearScan(SanityChecker sanityChecker) { 28 | this.sanityChecker = sanityChecker; 29 | } 30 | 31 | public void scan(ObjectReference object) { 32 | sanityChecker.scanProcessObject(object); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/vm/Config.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.vm; 14 | 15 | import org.mmtk.utility.Log; 16 | import org.mmtk.utility.statistics.Xml; 17 | 18 | public class Config { 19 | /* The name of the active plan */ 20 | private final String ACTIVE_PLAN; 21 | 22 | /** Mark bit in the header or on the side ? */ 23 | public final boolean HEADER_MARK_BITS; 24 | 25 | Config(BuildTimeConfig config) { 26 | ACTIVE_PLAN = config.getPlanName(); 27 | HEADER_MARK_BITS = config.getBooleanProperty("mmtk.headerMarkBit",true); 28 | } 29 | 30 | public void printConfig() { 31 | Log.writeln("================ MMTk Configuration ================"); 32 | Log.write("plan = "); Log.writeln(ACTIVE_PLAN); 33 | Log.write("HEADER_MARK_BITS = "); Log.writeln(HEADER_MARK_BITS); 34 | Log.writeln("===================================================="); 35 | } 36 | 37 | public void printConfigXml() { 38 | Log.writeln(""); 39 | Xml.configItem("plan",ACTIVE_PLAN); 40 | Xml.configItem("header-mark-bit",HEADER_MARK_BITS); 41 | Log.writeln(""); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/vm/FinalizableProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.vm; 14 | 15 | import org.mmtk.plan.TraceLocal; 16 | import org.vmmagic.pragma.Uninterruptible; 17 | 18 | /** 19 | * This class manages finalizable objects. 20 | */ 21 | @Uninterruptible 22 | public abstract class FinalizableProcessor { 23 | 24 | /** 25 | * Clear the contents of the table. This is called when finalization is 26 | * disabled to make it easier for VMs to change this setting at runtime. 27 | */ 28 | public abstract void clear(); 29 | 30 | /** 31 | * Scan through the list of references. 32 | * 33 | * @param trace the thread local trace element. 34 | * @param nursery true if it is safe to only scan new references. 35 | */ 36 | public abstract void scan(TraceLocal trace, boolean nursery); 37 | 38 | /** 39 | * Iterate over and forward entries in the table. 40 | */ 41 | public abstract void forward(TraceLocal trace, boolean nursery); 42 | } 43 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/vm/Lock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.vm; 14 | 15 | import org.vmmagic.pragma.Uninterruptible; 16 | 17 | /** 18 | * Simple, fair locks with deadlock detection. 19 | */ 20 | @Uninterruptible public abstract class Lock { 21 | 22 | /** 23 | * Set the name of this lock instance 24 | * 25 | * @param str The name of the lock (for error output). 26 | */ 27 | public abstract void setName(String str); 28 | 29 | 30 | /** 31 | * Try to acquire a lock and spin-wait until acquired. 32 | */ 33 | public abstract void acquire(); 34 | 35 | /** 36 | * Perform sanity checks on the lock. For debugging. 37 | * 38 | * @param w Identifies the code location in the debugging output. 39 | */ 40 | public abstract void check(int w); 41 | 42 | /** 43 | * Release the lock by incrementing serving counter. 44 | */ 45 | public abstract void release(); 46 | 47 | } 48 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/vm/MMTk_Events.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | 14 | package org.mmtk.vm; 15 | 16 | import org.mmtk.policy.Space; 17 | import org.vmmagic.pragma.Uninterruptible; 18 | import org.vmmagic.unboxed.Address; 19 | import org.vmmagic.unboxed.Extent; 20 | 21 | /** 22 | * Event generation interface for MMTk. 23 | */ 24 | @Uninterruptible 25 | public abstract class MMTk_Events { 26 | public abstract void tracePageAcquired(Space space, Address startAddress, int numPages); 27 | 28 | public abstract void tracePageReleased(Space space, Address startAddress, int numPages); 29 | 30 | public abstract void heapSizeChanged(Extent heapSize); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/vm/ReferenceProcessor.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.vm; 14 | 15 | import org.mmtk.plan.TraceLocal; 16 | import org.vmmagic.pragma.Uninterruptible; 17 | 18 | /** 19 | * This class manages SoftReferences, WeakReferences, and 20 | * PhantomReferences. 21 | */ 22 | @Uninterruptible 23 | public abstract class ReferenceProcessor { 24 | 25 | public enum Semantics { SOFT, WEAK, PHANTOM } 26 | 27 | /** 28 | * Clear the contents of the table. This is called when reference types are 29 | * disabled to make it easier for VMs to change this setting at runtime. 30 | */ 31 | public abstract void clear(); 32 | 33 | /** 34 | * Scan through the list of references. 35 | * 36 | * @param trace the thread local trace element. 37 | * @param nursery true if it is safe to only scan new references. 38 | */ 39 | public abstract void scan(TraceLocal trace, boolean nursery); 40 | 41 | /** 42 | * Iterate over all references and forward. 43 | */ 44 | public abstract void forward(TraceLocal trace, boolean nursery); 45 | 46 | /** 47 | * @return the number of references objects on the queue 48 | */ 49 | public abstract int countWaitingReferences(); 50 | } 51 | -------------------------------------------------------------------------------- /mmtk/java/src/org/mmtk/vm/SynchronizedCounter.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Eclipse Public License (EPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/eclipse-1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.mmtk.vm; 14 | 15 | import org.vmmagic.pragma.Uninterruptible; 16 | 17 | 18 | /** 19 | * A counter that supports atomic increment and reset. 20 | */ 21 | @Uninterruptible public abstract class SynchronizedCounter { 22 | 23 | /** 24 | * Reset the counter to 0, returning its previous value. 25 | * 26 | * @return The value of the counter, prior to reset. 27 | */ 28 | public abstract int reset(); 29 | 30 | /** 31 | * Adds 1 to the counter. 32 | * 33 | * @return the value before the add 34 | */ 35 | public abstract int increment(); 36 | 37 | /** 38 | * Peek at the counter 39 | * 40 | * @return The current value of the counter. 41 | */ 42 | public abstract int peek(); 43 | } 44 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/pragma/BaselineNoRegisters.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.pragma; 14 | 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.Target; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.ElementType; 19 | import org.vmmagic.Pragma; 20 | 21 | /** 22 | * Some methods shouldn't use registers for locals and stack values. 23 | * E.g. CollectorThread can't relocate refs in registers of its own. 24 | */ 25 | @Retention(RetentionPolicy.RUNTIME) 26 | @Target(ElementType.METHOD) 27 | @Pragma 28 | public @interface BaselineNoRegisters { } 29 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/pragma/BaselineSaveLSRegisters.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.pragma; 14 | 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.Target; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.ElementType; 19 | import org.vmmagic.Pragma; 20 | 21 | /** 22 | * Methods with this pragma that are BaselineCompiled should save in its prologue, ALL registers that 23 | * can be used to store local and stack registers in any BaselineCompiled method. Used by OSR. 24 | */ 25 | @Retention(RetentionPolicy.RUNTIME) 26 | @Target(ElementType.METHOD) 27 | @Pragma 28 | public @interface BaselineSaveLSRegisters { } 29 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/pragma/DynamicBridge.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.pragma; 14 | 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.RetentionPolicy; 17 | import java.lang.annotation.Target; 18 | import java.lang.annotation.ElementType; 19 | import org.vmmagic.Pragma; 20 | 21 | /** 22 | * Methods of a class that implements this interface are treated specially 23 | * by the compilers. 24 | * 25 | *

Instead of saving just the non-volatile registers used by the method into 26 | * the register save area of the method's stackframe, the compiler generates 27 | * code to save *all* GPR and FPR registers except GPR0, FPR0, JTOC, and FP. 28 | * 29 | *

Methods of a class that implement this interface may not return. 30 | * (it is assumed that execution is resumed via a call to Magic.dynamicBridgeTo) 31 | * 32 | * @see org.jikesrvm.runtime.Magic#dynamicBridgeTo(org.jikesrvm.ArchitectureSpecific.CodeArray) 33 | */ 34 | @Retention(RetentionPolicy.RUNTIME) 35 | @Target(ElementType.TYPE) 36 | @Pragma 37 | public @interface DynamicBridge { } 38 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/pragma/Entrypoint.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.pragma; 14 | 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.RetentionPolicy; 17 | import java.lang.annotation.Target; 18 | import java.lang.annotation.ElementType; 19 | import org.vmmagic.Pragma; 20 | 21 | /** 22 | * The entrypoint annotation indicates that the method or field is 23 | * directly accessed by the compiler. We cache resolved values for 24 | * these elements in Entrypoints. 25 | */ 26 | @Retention(RetentionPolicy.RUNTIME) 27 | @Target({ElementType.METHOD, ElementType.FIELD}) 28 | @Pragma 29 | public @interface Entrypoint { } 30 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/pragma/NativeBridge.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.pragma; 14 | 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.RetentionPolicy; 17 | import java.lang.annotation.Target; 18 | import java.lang.annotation.ElementType; 19 | import org.vmmagic.Pragma; 20 | 21 | /** 22 | * Methods of a class that implements this interface are treated specially 23 | * by the compilers: 24 | * -They are only called from C or C++ program 25 | * -The compiler will generate the necessary prolog to insert a glue stack 26 | * frame to map from the native stack/register convention to RVM's convention 27 | * -It is an error to call these methods from Java 28 | */ 29 | @Retention(RetentionPolicy.RUNTIME) 30 | @Target(ElementType.TYPE) 31 | @Pragma 32 | public @interface NativeBridge { } 33 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/pragma/NoBoundsCheck.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.pragma; 14 | 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.Target; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.ElementType; 19 | import org.vmmagic.Pragma; 20 | 21 | /** 22 | * This pragma indicates that a particular method should never have bounds 23 | * checks generated. 24 | */ 25 | @Retention(RetentionPolicy.RUNTIME) 26 | @Target(ElementType.METHOD) 27 | @Pragma 28 | public @interface NoBoundsCheck { } 29 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/pragma/NoEscapes.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.pragma; 14 | 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.Target; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.ElementType; 19 | 20 | /** 21 | * Use this annotation to mark methods that won't cause their reference arguments 22 | * to escape. If we can convert the object referenced in to registers then the 23 | * method marked with this annotation will be removed. 24 | */ 25 | @Retention(RetentionPolicy.RUNTIME) 26 | @Target({ElementType.METHOD, ElementType.CONSTRUCTOR}) 27 | public @interface NoEscapes { } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/pragma/NoInline.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.pragma; 14 | 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.Target; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.ElementType; 19 | import org.vmmagic.Pragma; 20 | 21 | /** 22 | * This pragma indicates that a particular method should never be inlined 23 | * by the optimizing compiler. 24 | */ 25 | @Retention(RetentionPolicy.RUNTIME) 26 | @Target(ElementType.METHOD) 27 | @Pragma 28 | public @interface NoInline { } 29 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/pragma/NoNullCheck.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.pragma; 14 | 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.Target; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.ElementType; 19 | import org.vmmagic.Pragma; 20 | 21 | /** 22 | * This pragma indicates that a particular method should never have null checks 23 | * generated. 24 | */ 25 | @Retention(RetentionPolicy.RUNTIME) 26 | @Target(ElementType.METHOD) 27 | @Pragma 28 | public @interface NoNullCheck { } 29 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/pragma/NoOptCompile.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.pragma; 14 | 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.Target; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.ElementType; 19 | import org.vmmagic.Pragma; 20 | 21 | /** 22 | * This pragma indicates that a particular method should never be 23 | * compiled by the optimizing compiler. It also implies that the 24 | * method will never be inlined by the optimizing compiler. 25 | */ 26 | @Retention(RetentionPolicy.RUNTIME) 27 | @Target({ElementType.TYPE, ElementType.METHOD}) 28 | @Pragma 29 | public @interface NoOptCompile { } 30 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/pragma/NonMoving.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.pragma; 14 | 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.Target; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.ElementType; 19 | 20 | /** 21 | * Use this annotation to mark types that must never move. This is intended for 22 | * a very small set of VM internal types that are accessed without knowledge of the 23 | * memory manager. This includes code, that is CALLed and fields that are loaded 24 | * directly (such as Untraced fields). 25 | */ 26 | @Retention(RetentionPolicy.RUNTIME) 27 | @Target(ElementType.TYPE) 28 | public @interface NonMoving { } 29 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/pragma/NonMovingAllocation.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.pragma; 14 | 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.Target; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.ElementType; 19 | 20 | /** 21 | * Use this annotation to mark methods for which all allocation must never 22 | * move. This is intended for a very small set of VM internal methods that 23 | * specifically require these semantics. 24 | */ 25 | @Retention(RetentionPolicy.RUNTIME) 26 | @Target(ElementType.METHOD) 27 | public @interface NonMovingAllocation { } 28 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/pragma/Pure.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.pragma; 14 | 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.Target; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.ElementType; 19 | import org.vmmagic.Pragma; 20 | 21 | /** 22 | * This pragma is used to indicate a method has no side effects. Use this pragma 23 | * with care as it can cause compile time invocation of the method it is placed 24 | * on. This pragma is used to imply weak purity of a method, and as such cannot 25 | * remove calls to pure methods - as they may throw exceptions. 26 | * {@link RVM-503}. 27 | */ 28 | @Retention(RetentionPolicy.RUNTIME) 29 | @Target({ElementType.METHOD}) 30 | @Pragma 31 | public @interface Pure { /* annotation has no value */ } 32 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/pragma/RawStorage.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.pragma; 14 | 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.Target; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.ElementType; 19 | import org.vmmagic.Pragma; 20 | 21 | /** 22 | * When applied to class this annotation indicates that the data component 23 | * of this field consists of an intrisically managed chunk of raw memory of 24 | * the specified size. This is used as the basic building block for native 25 | * width types. 26 | * 27 | * To construct types larger than those possible with RawStorage, simply 28 | * construct an type with multiple (Unboxed) fields. 29 | */ 30 | @Retention(RetentionPolicy.RUNTIME) 31 | @Target({ElementType.TYPE}) 32 | @Pragma 33 | public @interface RawStorage { 34 | boolean lengthInWords(); 35 | int length(); 36 | } 37 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/pragma/RuntimeFinal.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.pragma; 14 | 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.Target; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.ElementType; 19 | import org.vmmagic.Pragma; 20 | 21 | /** 22 | * This pragma is used to indicate a field will be final in the running VM. We 23 | * can't indicate all fields are final as some are used in the boot strap 24 | * process. 25 | */ 26 | @Retention(RetentionPolicy.RUNTIME) 27 | @Target({ElementType.FIELD}) 28 | @Pragma 29 | public @interface RuntimeFinal { 30 | /** The value of the field. Currently only boolean values can be RuntimeFinal. */ 31 | boolean value(); 32 | } 33 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/pragma/RuntimePure.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.pragma; 14 | 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.Target; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.ElementType; 19 | import org.vmmagic.Pragma; 20 | 21 | /** 22 | * This pragma is a variant of Pure that is used to mark methods that have a 23 | * special behaviour at boot image writing time and are Pure at runtime 24 | */ 25 | @Retention(RetentionPolicy.RUNTIME) 26 | @Target({ElementType.METHOD}) 27 | @Pragma 28 | public @interface RuntimePure { 29 | /** Enumeration of the special boot image return values */ 30 | public enum ReturnValue { 31 | /** the return value is unavailable until runtime*/ 32 | Unavailable 33 | } 34 | /** What value should be returned */ 35 | ReturnValue value() default ReturnValue.Unavailable; 36 | } 37 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/pragma/SaveVolatile.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.pragma; 14 | 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.RetentionPolicy; 17 | import java.lang.annotation.Target; 18 | import java.lang.annotation.ElementType; 19 | import org.vmmagic.Pragma; 20 | 21 | /** 22 | * Methods of a class that implements this interface 23 | * are treated specially by the machine code compiler: 24 | * the method prologue saves all the volatile registers 25 | * and the method epilogue restores all the volatile registers 26 | */ 27 | @Retention(RetentionPolicy.RUNTIME) 28 | @Target(ElementType.TYPE) 29 | @Pragma 30 | public @interface SaveVolatile { } 31 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/pragma/SpecializedMethodInvoke.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.pragma; 14 | 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.Target; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.ElementType; 19 | import org.vmmagic.Pragma; 20 | 21 | /** 22 | * This pragma indicates that a particular method is a specialized 23 | * method invocation point, and could be optimized as such. 24 | * 25 | * All such methods must be static. 26 | */ 27 | @Retention(RetentionPolicy.RUNTIME) 28 | @Target(ElementType.METHOD) 29 | @Pragma 30 | public @interface SpecializedMethodInvoke { } 31 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/pragma/SynchronizedObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.pragma; 14 | 15 | import java.lang.annotation.ElementType; 16 | import java.lang.annotation.Retention; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.Target; 19 | import org.vmmagic.Pragma; 20 | 21 | /** 22 | * This interface designates an object which should always be allocated a 23 | * thin lock, since it is likely to be synchronized. 24 | */ 25 | @Retention(RetentionPolicy.RUNTIME) 26 | @Target(ElementType.TYPE) 27 | @Pragma 28 | public @interface SynchronizedObject { 29 | } 30 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/pragma/SysCallNative.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.pragma; 14 | 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.Target; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.ElementType; 19 | import org.vmmagic.Pragma; 20 | 21 | /** 22 | * An annotation for static native methods to show that they should be 23 | * compiled as system calls. A system call is a lightweight call to a 24 | * C function that doesn't set up the JNI environment and is therefore 25 | * cheaper than JNI. The first argument to the function is the address 26 | * of the C function to run. 27 | */ 28 | @Retention(RetentionPolicy.RUNTIME) 29 | @Target({ElementType.METHOD}) 30 | @Pragma 31 | public @interface SysCallNative { 32 | } 33 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/pragma/UninterruptibleNoWarn.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.pragma; 14 | 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.Target; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.ElementType; 19 | import org.vmmagic.Pragma; 20 | 21 | /** 22 | * A pragma that has the same direct effect as {@link Uninterruptible} 23 | * but also suppresses checking of uninterruptibility violations for 24 | * the method. This should be used with care and is only justified 25 | * for code only executed when creating the boot image. 26 | */ 27 | @Retention(RetentionPolicy.RUNTIME) 28 | @Target({ElementType.TYPE, ElementType.METHOD}) 29 | @Pragma 30 | public @interface UninterruptibleNoWarn { 31 | /** 32 | * @return Explanation of why uninterruptible warnings are disabled 33 | */ 34 | String value() default ""; 35 | } 36 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/pragma/UnpreemptibleNoWarn.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.pragma; 14 | 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.Target; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.ElementType; 19 | import org.vmmagic.Pragma; 20 | 21 | /** 22 | * A special case of {@link Unpreemptible} where the code may call out to other 23 | * interruptible routines. 24 | */ 25 | @Retention(RetentionPolicy.RUNTIME) 26 | @Target({ElementType.TYPE, ElementType.METHOD}) 27 | @Pragma 28 | public @interface UnpreemptibleNoWarn { 29 | /** 30 | * @return Explanation of why code needs to be unpreemptible 31 | */ 32 | String value() default ""; 33 | } 34 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/pragma/Untraced.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.pragma; 14 | 15 | import java.lang.annotation.Retention; 16 | import java.lang.annotation.Target; 17 | import java.lang.annotation.RetentionPolicy; 18 | import java.lang.annotation.ElementType; 19 | 20 | /** 21 | * Use this annotation to mark fields that are read without the knowledge of the 22 | * memory management system. This means that barriers are not triggered and 23 | * the reference is also not traced by the garbage collector. 24 | * 25 | * As annotations are loaded at class resolution time, fields marked with this 26 | * annotation must be private so that no unresolved accesses are compiled to them with 27 | * barriers. 28 | */ 29 | @Retention(RetentionPolicy.RUNTIME) 30 | @Target(ElementType.FIELD) 31 | public @interface Untraced { } 32 | -------------------------------------------------------------------------------- /mmtk/java/src/org/vmmagic/unboxed/AddressArray.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of the Jikes RVM project (http://jikesrvm.org). 3 | * 4 | * This file is licensed to You under the Common Public License (CPL); 5 | * You may not use this file except in compliance with the License. You 6 | * may obtain a copy of the License at 7 | * 8 | * http://www.opensource.org/licenses/cpl1.0.php 9 | * 10 | * See the COPYRIGHT.txt file distributed with this work for information 11 | * regarding copyright ownership. 12 | */ 13 | package org.vmmagic.unboxed; 14 | 15 | public final class AddressArray { 16 | 17 | private final Address[] data; 18 | 19 | private AddressArray(int size) { 20 | data = new Address[size]; 21 | Address zero = Address.zero(); 22 | for(int i=0; icurrent == NULL) { 21 | A->current = (vmkit::MutatorThread*)vmkit::Thread::get()->MyVM->mainThread; 22 | } else if (A->current->next() == vmkit::Thread::get()->MyVM->mainThread) { 23 | A->current = NULL; 24 | return NULL; 25 | } else { 26 | A->current = (vmkit::MutatorThread*)A->current->next(); 27 | } 28 | 29 | if (A->current->MutatorContext == 0) { 30 | return Java_org_j3_mmtk_ActivePlan_getNextMutator__(A); 31 | } 32 | return (MMTkObject*)A->current->MutatorContext; 33 | } 34 | 35 | extern "C" void Java_org_j3_mmtk_ActivePlan_resetMutatorIterator__(MMTkActivePlan* A) { 36 | A->current = NULL; 37 | } 38 | 39 | extern "C" int Java_org_j3_mmtk_ActivePlan_collectorCount__ (MMTkActivePlan* A) { 40 | // We do not support parallel GC yet. 41 | return 1; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /mmtk/mmtk-j3/Assert.cpp: -------------------------------------------------------------------------------- 1 | //===----------- Assert.cpp - Implementation of the Assert class ---------===// 2 | // 3 | // The VMKit project 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | #include "debug.h" 11 | #include "MMTkObject.h" 12 | 13 | namespace mmtk { 14 | 15 | extern "C" void Java_org_j3_mmtk_Assert_dumpStack__ (MMTkObject* self) { UNIMPLEMENTED(); } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /mmtk/mmtk-j3/FinalizableProcessor.cpp: -------------------------------------------------------------------------------- 1 | //===- FinalizableProcessor.cpp -------------------------------------------===// 2 | //===- Implementation of the FinalizableProcessor class ------------------===// 3 | // 4 | // The VMKit project 5 | // 6 | // This file is distributed under the University of Illinois Open Source 7 | // License. See LICENSE.TXT for details. 8 | // 9 | //===----------------------------------------------------------------------===// 10 | 11 | #include "debug.h" 12 | #include "vmkit/VirtualMachine.h" 13 | #include "MMTkObject.h" 14 | 15 | namespace mmtk { 16 | 17 | extern "C" void Java_org_j3_mmtk_FinalizableProcessor_clear__ (MMTkObject* P) { 18 | UNIMPLEMENTED(); 19 | } 20 | 21 | extern "C" void 22 | Java_org_j3_mmtk_FinalizableProcessor_forward__Lorg_mmtk_plan_TraceLocal_2Z (MMTkObject* P, word_t TL, uint8_t nursery) { 23 | UNIMPLEMENTED(); 24 | } 25 | 26 | extern "C" void 27 | Java_org_j3_mmtk_FinalizableProcessor_scan__Lorg_mmtk_plan_TraceLocal_2Z (MMTkObject* FP, MMTkObject* TL, uint8_t nursery) { 28 | vmkit::Thread* th = vmkit::Thread::get(); 29 | th->MyVM->scanFinalizationQueue(reinterpret_cast(TL)); 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /mmtk/mmtk-j3/Lock.cpp: -------------------------------------------------------------------------------- 1 | //===----------- Lock.cpp - Implementation of the Lock class -------------===// 2 | // 3 | // The VMKit project 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | #include "debug.h" 11 | 12 | #include "MMTkObject.h" 13 | 14 | namespace mmtk { 15 | 16 | extern "C" void Java_org_j3_mmtk_Lock_acquire__(MMTkLock* l) NO_INLINE; 17 | extern "C" void Java_org_j3_mmtk_Lock_acquire__(MMTkLock* l) { 18 | for (uint32 count = 0; count < 1000; ++count) { 19 | uint32 res = __sync_val_compare_and_swap(&(l->state), 0, 1); 20 | if (!res) return; 21 | } 22 | 23 | while (__sync_val_compare_and_swap(&(l->state), 0, 1)) { 24 | sched_yield(); 25 | } 26 | } 27 | 28 | extern "C" void Java_org_j3_mmtk_Lock_release__(MMTkLock* l) { 29 | l->state = 0; 30 | } 31 | 32 | 33 | extern "C" void Java_org_j3_mmtk_Lock_check__I (MMTkLock* l, int i) { 34 | UNIMPLEMENTED(); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /mmtk/mmtk-j3/MMTk_Events.cpp: -------------------------------------------------------------------------------- 1 | //===----- MMTk_Events.cpp - Implementation of the MMTk_Events class -----===// 2 | // 3 | // The VMKit project 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | #include "MMTkObject.h" 11 | 12 | namespace mmtk { 13 | 14 | extern "C" void Java_org_j3_mmtk_MMTk_1Events_tracePageAcquired__Lorg_mmtk_policy_Space_2Lorg_vmmagic_unboxed_Address_2I( 15 | MMTkObject* event, MMTkObject* space, word_t address, int numPages) { 16 | #if 0 17 | fprintf(stderr, "Pages acquired by thread %p from space %p at %x (%d)\n", (void*)vmkit::Thread::get(), (void*)space, address, numPages); 18 | #endif 19 | } 20 | 21 | extern "C" void Java_org_j3_mmtk_MMTk_1Events_tracePageReleased__Lorg_mmtk_policy_Space_2Lorg_vmmagic_unboxed_Address_2I( 22 | MMTkObject* event, MMTkObject* space, word_t address, int numPages) { 23 | #if 0 24 | fprintf(stderr, "Pages released by thread %p from space %p at %x (%d)\n", (void*)vmkit::Thread::get(), (void*)space, address, numPages); 25 | #endif 26 | } 27 | 28 | extern "C" void Java_org_j3_mmtk_MMTk_1Events_heapSizeChanged__Lorg_vmmagic_unboxed_Extent_2( 29 | MMTkObject* event, word_t heapSize) { 30 | #if 0 31 | fprintf(stderr, "New heap size : %d\n", (int)heapSize); 32 | #endif 33 | } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /mmtk/mmtk-j3/Makefile: -------------------------------------------------------------------------------- 1 | ##===- mmtk/mmtk-j3/Makefile -------------------------------*- Makefile -*-===## 2 | # 3 | # The vmkit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | 10 | LEVEL = ../.. 11 | 12 | LIBRARY=MMTKRuntime 13 | NEED_BC=1 14 | 15 | include $(LEVEL)/Makefile.common 16 | 17 | -------------------------------------------------------------------------------- /mmtk/mmtk-j3/ReferenceProcessor.cpp: -------------------------------------------------------------------------------- 1 | //===-------- ReferenceProcessor.cpp --------------------------------------===// 2 | //===-------- Implementation of the Selected class -----------------------===// 3 | // 4 | // The VMKit project 5 | // 6 | // This file is distributed under the University of Illinois Open Source 7 | // License. See LICENSE.TXT for details. 8 | // 9 | //===----------------------------------------------------------------------===// 10 | 11 | #include "debug.h" 12 | #include "vmkit/VirtualMachine.h" 13 | #include "MMTkObject.h" 14 | 15 | namespace mmtk { 16 | 17 | extern "C" void Java_org_j3_mmtk_ReferenceProcessor_scan__Lorg_mmtk_plan_TraceLocal_2Z (MMTkReferenceProcessor* RP, word_t TL, uint8_t nursery) { 18 | vmkit::Thread* th = vmkit::Thread::get(); 19 | uint32_t val = RP->ordinal; 20 | 21 | if (val == 0) { 22 | th->MyVM->scanSoftReferencesQueue(TL); 23 | } else if (val == 1) { 24 | th->MyVM->scanWeakReferencesQueue(TL); 25 | } else { 26 | assert(val == 2); 27 | th->MyVM->scanPhantomReferencesQueue(TL); 28 | } 29 | } 30 | 31 | extern "C" void Java_org_j3_mmtk_ReferenceProcessor_forward__Lorg_mmtk_plan_TraceLocal_2Z (MMTkReferenceProcessor* RP, word_t TL, uint8_t nursery) { UNIMPLEMENTED(); } 32 | extern "C" void Java_org_j3_mmtk_ReferenceProcessor_clear__ (MMTkReferenceProcessor* RP) { UNIMPLEMENTED(); } 33 | extern "C" void Java_org_j3_mmtk_ReferenceProcessor_countWaitingReferences__ (MMTkReferenceProcessor* RP) { UNIMPLEMENTED(); } 34 | 35 | } 36 | -------------------------------------------------------------------------------- /mmtk/mmtk-j3/Selected.cpp: -------------------------------------------------------------------------------- 1 | //===-------- Selected.cpp - Implementation of the Selected class --------===// 2 | // 3 | // The VMKit project 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | #include "MutatorThread.h" 11 | #include "MMTkObject.h" 12 | 13 | namespace mmtk { 14 | 15 | extern "C" MMTkObject* Java_org_j3_config_Selected_00024Mutator_get__() { 16 | return (MMTkObject*)vmkit::MutatorThread::get()->MutatorContext; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /mmtk/mmtk-j3/Statistics.cpp: -------------------------------------------------------------------------------- 1 | //===----- Statistics.cpp - Implementation of the Statistics class -------===// 2 | // 3 | // The VMKit project 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | #include "MMTkObject.h" 11 | 12 | #include 13 | #include 14 | 15 | namespace mmtk { 16 | 17 | extern "C" int64_t Java_org_j3_mmtk_Statistics_cycles__ (MMTkObject* S) { 18 | return 0; 19 | } 20 | 21 | extern "C" int64_t Java_org_j3_mmtk_Statistics_nanoTime__ (MMTkObject* S) { 22 | int64_t result; 23 | struct timeval tp; 24 | 25 | int res = gettimeofday (&tp, NULL); 26 | USE(res); 27 | assert(res != -1 && "failed gettimeofday."); 28 | 29 | result = (int64_t) tp.tv_sec; 30 | result *= (int64_t)1000000L; 31 | result += (int64_t)tp.tv_usec; 32 | result *= (int64_t)1000; 33 | 34 | return result; 35 | } 36 | 37 | 38 | extern "C" int32_t Java_org_j3_mmtk_Statistics_getCollectionCount__ (MMTkObject* S) { 39 | return 0; 40 | } 41 | 42 | extern "C" void Java_org_j3_mmtk_Statistics_perfEventInit__Ljava_lang_String_2(MMTkObject* S, MMTkObject* Str) { 43 | } 44 | 45 | extern "C" void Java_org_j3_mmtk_Statistics_perfEventRead__I_3J(MMTkObject* S, int id, int64_t* values) { 46 | } 47 | 48 | } // namespace mmtk 49 | -------------------------------------------------------------------------------- /mmtk/mmtk-j3/SynchronizedCounter.cpp: -------------------------------------------------------------------------------- 1 | //===-------- SynchronizedCounter.cpp -------------------------------------===// 2 | //===-------- Implementation of the SynchronizedCounter class ------------===// 3 | // 4 | // The VMKit project 5 | // 6 | // This file is distributed under the University of Illinois Open Source 7 | // License. See LICENSE.TXT for details. 8 | // 9 | //===----------------------------------------------------------------------===// 10 | 11 | #include "MMTkObject.h" 12 | #include "debug.h" 13 | 14 | namespace mmtk { 15 | 16 | extern "C" void Java_org_j3_mmtk_SynchronizedCounter_reset__ (MMTkObject* self) { UNIMPLEMENTED(); } 17 | extern "C" void Java_org_j3_mmtk_SynchronizedCounter_increment__ (MMTkObject* self) { UNIMPLEMENTED(); } 18 | 19 | } // end namespace mmtk 20 | -------------------------------------------------------------------------------- /patches/classpath-0.99.macos.patch: -------------------------------------------------------------------------------- 1 | diff -u -r test/classpath-0.99/native/jni/java-io/java_io_VMConsole.c classpath-0.99/native/jni/java-io/java_io_VMConsole.c 2 | --- test/classpath-0.99/native/jni/java-io/java_io_VMConsole.c 2012-01-08 13:35:53.000000000 +0100 3 | +++ classpath-0.99/native/jni/java-io/java_io_VMConsole.c 2012-12-03 16:25:36.000000000 +0100 4 | @@ -47,7 +47,11 @@ 5 | 6 | /*************************************************************************/ 7 | 8 | +#if defined(__APPLE__) 9 | +#define TERMIOS_ECHO_IFLAGS (IXON|IXOFF|IXANY) 10 | +#else 11 | #define TERMIOS_ECHO_IFLAGS (IUCLC|IXON|IXOFF|IXANY) 12 | +#endif 13 | #define TERMIOS_ECHO_LFLAGS (ECHO|ECHOE|ECHOK|ECHONL|TOSTOP) 14 | 15 | /* 16 | -------------------------------------------------------------------------------- /tests/AnnotationClassTest.java: -------------------------------------------------------------------------------- 1 | import java.lang.Deprecated; 2 | import java.lang.annotation.Annotation; 3 | import java.lang.reflect.Field; 4 | import java.lang.reflect.Method; 5 | 6 | 7 | public class AnnotationClassTest { 8 | 9 | @MyAnnotation (property = 13, property4 = System.class) 10 | static class Sample { 11 | @Deprecated 12 | @MyAnnotation (property=5, property4=String.class) 13 | public int x; 14 | 15 | @MyAnnotation (property=7, property4=String.class) 16 | public int y() { 17 | return x*x; 18 | } 19 | } 20 | 21 | public static void main(String[] args) throws Exception { 22 | Field f = Sample.class.getField("x"); 23 | Method m = Sample.class.getMethod("y"); 24 | Sample sample = new Sample(); 25 | sample.x = 14; 26 | 27 | Annotation [] fAnno = f.getDeclaredAnnotations(); 28 | Annotation [] mAnno = m.getAnnotations(); 29 | Annotation [] cAnno = Sample.class.getDeclaredAnnotations(); 30 | 31 | MyAnnotation xx = (MyAnnotation)f.getAnnotation(MyAnnotation.class); 32 | MyAnnotation yy = (MyAnnotation)m.getAnnotation(MyAnnotation.class); 33 | 34 | 35 | 36 | check(f.getInt(sample) == 14); 37 | f.setInt(sample, 17); 38 | check(f.getInt(sample) == 17); 39 | check(xx != null); 40 | check(yy != null); 41 | check(mAnno.length == 1); 42 | check(fAnno.length == 2); 43 | check(cAnno != null && cAnno.length == 1 && cAnno[0]!= null); 44 | //int s = yy.property(); 45 | //check(s == 5); 46 | 47 | } 48 | 49 | private static void check(boolean b) throws Exception { 50 | if (!b) throw new Exception("Test failed!!!"); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /tests/MyAnnotation.java: -------------------------------------------------------------------------------- 1 | import java.lang.annotation.*; 2 | @Retention(value=RetentionPolicy.RUNTIME) 3 | public @interface MyAnnotation { 4 | int property(); 5 | int[] primes() default {2, 3, 5, 7, 11, 13, 17, 19, 23, 29}; 6 | String property3() default "Default value"; 7 | Class property4(); 8 | } 9 | -------------------------------------------------------------------------------- /tools/Makefile: -------------------------------------------------------------------------------- 1 | ##===- tools/Makefile --------------------------------------*- Makefile -*-===## 2 | # 3 | # The vmkit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | LEVEL = .. 10 | 11 | DIRS=j3 vmjc llcj 12 | 13 | include $(LEVEL)/Makefile.common 14 | 15 | -------------------------------------------------------------------------------- /tools/j3/Main.cpp: -------------------------------------------------------------------------------- 1 | //===------------- Main.cpp - Simple execution of J3 ----------------------===// 2 | // 3 | // The VMKit project 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | #include "VmkitGC.h" 11 | #include "vmkit/JIT.h" 12 | #include "vmkit/MethodInfo.h" 13 | #include "vmkit/VirtualMachine.h" 14 | #include "vmkit/Thread.h" 15 | 16 | #include "j3/JavaJITCompiler.h" 17 | #include "../../lib/j3/VMCore/JnjvmClassLoader.h" 18 | #include "../../lib/j3/VMCore/Jnjvm.h" 19 | 20 | #include "llvm/Support/CommandLine.h" 21 | #include "llvm/Support/ManagedStatic.h" 22 | 23 | using namespace j3; 24 | using namespace vmkit; 25 | 26 | int main(int argc, char **argv, char **envp) { 27 | llvm::llvm_shutdown_obj X; 28 | 29 | // Initialize base components. 30 | VmkitModule::initialise(argc, argv); 31 | Collector::initialise(argc, argv); 32 | 33 | // Create the allocator that will allocate the bootstrap loader and the JVM. 34 | vmkit::BumpPtrAllocator Allocator; 35 | JavaJITCompiler* Comp = JavaJITCompiler::CreateCompiler("JITModule"); 36 | JnjvmBootstrapLoader* loader = new(Allocator, "Bootstrap loader") 37 | JnjvmBootstrapLoader(Allocator, Comp, true); 38 | Jnjvm* vm = new(Allocator, "VM") Jnjvm(Allocator, initialFrametables, loader); 39 | 40 | // Run the application. 41 | vm->runApplication(argc, argv); 42 | vm->waitForExit(); 43 | System::Exit(0); 44 | 45 | // Destroy everyone. 46 | // vm->~Jnjvm(); 47 | // loader->~JnjvmBootstrapLoader(); 48 | 49 | return 0; 50 | } 51 | -------------------------------------------------------------------------------- /tools/j3/Makefile: -------------------------------------------------------------------------------- 1 | ##===- tools/j3/Makefile -----------------------------------*- Makefile -*-===## 2 | # 3 | # The VMKit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | LEVEL = ../.. 10 | 11 | TOOL=j3 12 | LINK_USE=Classpath J3 J3Compiler Vmkit VmkitCompiler CommonThread FinalMMTk Precompiled 13 | 14 | include $(LEVEL)/Makefile.common 15 | -------------------------------------------------------------------------------- /tools/llcj/LinkPaths.h.in: -------------------------------------------------------------------------------- 1 | //===---- LinkPaths.h - Library paths for generating executables ----------===// 2 | // 3 | // VMKit 4 | // 5 | // This file is distributed under the University of Illinois Open Source 6 | // License. See LICENSE.TXT for details. 7 | // 8 | //===----------------------------------------------------------------------===// 9 | 10 | 11 | #define LLVMLibs "-L@LLVM_OBJ@/Release/lib" 12 | #define VMKITLibs1 "-L@abs_top_objdir@/Release/lib" 13 | #define VMKITLibs2 "-L@abs_top_srcdir@/Release/lib" 14 | #define VMKITLibs3 "-L@PROJ_INSTALL_ROOT@/lib" 15 | -------------------------------------------------------------------------------- /tools/llcj/Makefile: -------------------------------------------------------------------------------- 1 | ##===- tools/llcj/Makefile ---------------------------------*- Makefile -*-===## 2 | # 3 | # The vmkit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | LEVEL = ../.. 10 | 11 | TOOL=llcj 12 | 13 | include $(LEVEL)/Makefile.common 14 | -------------------------------------------------------------------------------- /tools/precompiler/Makefile: -------------------------------------------------------------------------------- 1 | ##===- tools/precompiler/Makefile --------------------------*- Makefile -*-===## 2 | # 3 | # The VMKit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | LEVEL = ../.. 10 | 11 | TOOL=precompiler 12 | LINK_USE=Classpath J3 J3Compiler Vmkit VmkitCompiler CommonThread FinalMMTk 13 | 14 | include $(LEVEL)/Makefile.common 15 | -------------------------------------------------------------------------------- /tools/trainer/HelloWorld.java: -------------------------------------------------------------------------------- 1 | class HelloWorld { 2 | 3 | public static final String str = "Hello World"; 4 | 5 | public static void main(String[] args) { 6 | System.out.println(str); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /tools/trainer/Makefile: -------------------------------------------------------------------------------- 1 | ##===- tools/precompiler/trainer/Makefile ------------------*- Makefile -*-===## 2 | # 3 | # The VMKit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | LEVEL = ../.. 10 | 11 | MODULE=Precompiled 12 | GEN=Precompiled.bc BootstrapClasses.bc 13 | NEED_GC=1 14 | 15 | LLC_FLAGS+= -disable-branch-fold 16 | #-disable-debug-info-print 17 | 18 | include $(LEVEL)/Makefile.common 19 | 20 | ifndef VERBOSE 21 | PRECOMPILER_OPT := > /dev/null 22 | endif 23 | 24 | $(BUILD_DIR)/Precompiled.bc: $(BUILD_DIR)/HelloWorld.class $(PRECOMPILER) 25 | $(Echo) "Pre-compiling bootstrap code" 26 | $(Verb) $(PRECOMPILER) -cp $(dir $<) $(basename $(notdir $<)) $(PRECOMPILER_OPT) && mv generated.bc $@ 27 | 28 | $(BUILD_DIR)/BootstrapClasses.bc: $(BUILD_DIR)/.dir 29 | $(Echo) "Building precompiled classes" 30 | $(Verb) $(PRECOMPILER) -emit-class-bytes $(PRECOMPILER_OPT) && mv classes.bc $@ 31 | 32 | $(BUILD_DIR)/HelloWorld.class: HelloWorld.java $(SELF) $(BUILD_DIR)/.dir 33 | $(Echo) "Compiling trainer '$<'" 34 | $(Verb) javac -source $(JAVAC_TARGET) -target $(JAVAC_TARGET) $< -d $(dir $@) 35 | -------------------------------------------------------------------------------- /tools/vmjc/Makefile: -------------------------------------------------------------------------------- 1 | ##===- tools/vmjc/Makefile ---------------------------------*- Makefile -*-===## 2 | # 3 | # The VMKit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | LEVEL = ../.. 10 | 11 | TOOL=vmjc 12 | LINK_USE=J3Compiler J3 Classpath Vmkit VmkitCompiler MMTk CommonThread 13 | 14 | include $(LEVEL)/Makefile.common 15 | -------------------------------------------------------------------------------- /tools/vmjc/libvmjc/Makefile: -------------------------------------------------------------------------------- 1 | ##===- tools/vmjc/libvmjc/Makefile -------------------------*- Makefile -*-===## 2 | # 3 | # The VMKit project 4 | # 5 | # This file is distributed under the University of Illinois Open Source 6 | # License. See LICENSE.TXT for details. 7 | # 8 | ##===----------------------------------------------------------------------===## 9 | LEVEL = ../../.. 10 | 11 | include $(LEVEL)/Makefile.config 12 | 13 | LIBRARY=libvmjc 14 | LOADABLE_MODULE = 1 15 | VMJC_ASSEMBLY = 1 16 | BUILT_SOURCES = glibj.zip.s 17 | 18 | SOURCES = glibj.zip.s 19 | 20 | include $(LEVEL)/Makefile.common 21 | -------------------------------------------------------------------------------- /www/content.css: -------------------------------------------------------------------------------- 1 | html { margin: 0px; } body { margin: 8px; } 2 | 3 | html, body { 4 | padding:0px; 5 | font-size:14px; font-family:"Lucida Grande", "Lucida Sans Unicode", Arial, Verdana, Helvetica, sans-serif; background-color: #fff; color: #222; 6 | line-height:1.5; 7 | } 8 | 9 | h1, h2, h3, tt { color: #000 } 10 | 11 | h1 { padding-top:0px; margin-top:0px;} 12 | h2 { color:#333333; padding-top:0.5em; } 13 | h3 { padding-top: 0.5em; margin-bottom: -0.25em; color:#2d58b7} 14 | li { padding-bottom: 0.5em; } 15 | ul { padding-left:1.5em; } 16 | 17 | /* Slides */ 18 | IMG.img_slide { 19 | display: block; 20 | margin-left: auto; 21 | margin-right: auto 22 | } 23 | 24 | .itemTitle { color:#2d58b7 } 25 | 26 | /* Tables */ 27 | tr { vertical-align:top } 28 | -------------------------------------------------------------------------------- /www/get_started.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llvm-mirror/vmkit/8a76c22d56f7b8434ad52b81436981d757ad671e/www/get_started.html -------------------------------------------------------------------------------- /www/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llvm-mirror/vmkit/8a76c22d56f7b8434ad52b81436981d757ad671e/www/index.html -------------------------------------------------------------------------------- /www/lip6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llvm-mirror/vmkit/8a76c22d56f7b8434ad52b81436981d757ad671e/www/lip6.png -------------------------------------------------------------------------------- /www/menu.css: -------------------------------------------------------------------------------- 1 | /***************/ 2 | /* page layout */ 3 | /***************/ 4 | 5 | html,body { 6 | padding:0px; 7 | font-size:14px; font-family:"Lucida Grande", "Lucida Sans Unicode", Arial, Verdana, Helvetica, sans-serif; background-color: #fff; color: #222; 8 | line-height:1.5; 9 | margin-left: 10px; 10 | } 11 | 12 | 13 | [id=menu] { 14 | position:fixed; 15 | width:25ex; 16 | } 17 | [id=content] { 18 | /* ***** EDIT THIS VALUE IF CONTENT OVERLAPS MENU ***** */ 19 | position:absolute; 20 | left:29ex; 21 | padding-right:4ex; 22 | } 23 | 24 | /**************/ 25 | /* menu style */ 26 | /**************/ 27 | 28 | #menu .submenu { 29 | padding-top:1em; 30 | display:block; 31 | } 32 | 33 | #menu label { 34 | display:block; 35 | font-weight: bold; 36 | text-align: center; 37 | background-color: rgb(192,192,192); 38 | } 39 | #menu a { 40 | padding:0 .2em; 41 | display:block; 42 | text-align: center; 43 | background-color: rgb(235,235,235); 44 | } 45 | #menu a:visited { 46 | color:rgb(100,50,100); 47 | } 48 | -------------------------------------------------------------------------------- /www/menu.html.incl: -------------------------------------------------------------------------------- 1 |

23 | -------------------------------------------------------------------------------- /www/tuto/VMKit_pres_eng.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llvm-mirror/vmkit/8a76c22d56f7b8434ad52b81436981d757ad671e/www/tuto/VMKit_pres_eng.pdf -------------------------------------------------------------------------------- /www/tuto/VMKit_pres_fr.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llvm-mirror/vmkit/8a76c22d56f7b8434ad52b81436981d757ad671e/www/tuto/VMKit_pres_fr.pdf -------------------------------------------------------------------------------- /www/tuto/VMKit_tutorial.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llvm-mirror/vmkit/8a76c22d56f7b8434ad52b81436981d757ad671e/www/tuto/VMKit_tutorial.pdf -------------------------------------------------------------------------------- /www/tuto/VMKit_tutorial.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llvm-mirror/vmkit/8a76c22d56f7b8434ad52b81436981d757ad671e/www/tuto/VMKit_tutorial.tar.gz -------------------------------------------------------------------------------- /www/tuto/VMKit_tutorial_eng.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llvm-mirror/vmkit/8a76c22d56f7b8434ad52b81436981d757ad671e/www/tuto/VMKit_tutorial_eng.pdf -------------------------------------------------------------------------------- /www/tuto/toy-vm-base.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/llvm-mirror/vmkit/8a76c22d56f7b8434ad52b81436981d757ad671e/www/tuto/toy-vm-base.tar.gz --------------------------------------------------------------------------------