[vmkit-commits] [vmkit] r111072 - in /vmkit/trunk/mmtk: config/marksweep/ java/src/org/j3/mmtk/ java/src/org/jikesrvm/ java/src/org/mmtk/plan/ java/src/org/mmtk/plan/generational/ java/src/org/mmtk/plan/generational/copying/ java/src/org/mmtk/plan/generational/immix/ java/src/org/mmtk/plan/generational/marksweep/ java/src/org/mmtk/plan/immix/ java/src/org/mmtk/plan/markcompact/ java/src/org/mmtk/plan/marksweep/ java/src/org/mmtk/plan/poisoned/ java/src/org/mmtk/plan/refcount/ java/src/org/mmtk/plan/refcount/generational...
Nicolas Geoffray
nicolas.geoffray at lip6.fr
Sat Aug 14 05:25:41 PDT 2010
Author: geoffray
Date: Sat Aug 14 07:25:41 2010
New Revision: 111072
URL: http://llvm.org/viewvc/llvm-project?rev=111072&view=rev
Log:
Update to MMTk 3.1.1.
Added:
vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/
vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriers.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersCollector.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersConstraints.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersMutator.java
vmkit/trunk/mmtk/java/src/org/mmtk/policy/MarkCompactCollector.java
vmkit/trunk/mmtk/java/src/org/mmtk/utility/ForwardingWord.java
vmkit/trunk/mmtk/java/src/org/mmtk/utility/HeaderByte.java
vmkit/trunk/mmtk/java/src/org/mmtk/utility/options/PerfEvents.java
vmkit/trunk/mmtk/java/src/org/mmtk/utility/statistics/PerfEvent.java
Removed:
vmkit/trunk/mmtk/java/src/org/mmtk/utility/options/PerfMetric.java
vmkit/trunk/mmtk/java/src/org/mmtk/utility/statistics/PerfCounter.java
Modified:
vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc
vmkit/trunk/mmtk/java/src/org/j3/mmtk/Barriers.java
vmkit/trunk/mmtk/java/src/org/j3/mmtk/Statistics.java
vmkit/trunk/mmtk/java/src/org/jikesrvm/Magic.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/MutatorContext.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/Plan.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/PlanConstraints.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/SimpleMutator.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/Gen.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenCollector.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenConstraints.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenMatureTraceLocal.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenMutator.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenNurseryTraceLocal.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/copying/GenCopyCollector.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/copying/GenCopyMutator.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/immix/GenImmixCollector.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/marksweep/GenMSCollector.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/immix/ImmixDefragTraceLocal.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/immix/ImmixTraceLocal.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/markcompact/MC.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/markcompact/MCCollector.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/markcompact/MCConstraints.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/markcompact/MCMutator.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/marksweep/MSTraceLocal.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/poisoned/PoisonedConstraints.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/poisoned/PoisonedMutator.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/refcount/RCBaseConstraints.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/refcount/RCBaseMutator.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/refcount/generational/GenRCCollector.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/SSCollector.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/gctrace/GCTraceConstraints.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/gctrace/GCTraceMutator.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyimmix/StickyImmixConstraints.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyimmix/StickyImmixMutator.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyimmix/StickyImmixNurseryTraceLocal.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyms/StickyMS.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyms/StickyMSConstraints.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyms/StickyMSMutator.java
vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyms/StickyMSNurseryTraceLocal.java
vmkit/trunk/mmtk/java/src/org/mmtk/policy/CopySpace.java
vmkit/trunk/mmtk/java/src/org/mmtk/policy/ImmortalSpace.java
vmkit/trunk/mmtk/java/src/org/mmtk/policy/LargeObjectSpace.java
vmkit/trunk/mmtk/java/src/org/mmtk/policy/MarkCompactLocal.java
vmkit/trunk/mmtk/java/src/org/mmtk/policy/MarkCompactSpace.java
vmkit/trunk/mmtk/java/src/org/mmtk/policy/MarkSweepSpace.java
vmkit/trunk/mmtk/java/src/org/mmtk/policy/SegregatedFreeListSpace.java
vmkit/trunk/mmtk/java/src/org/mmtk/policy/Space.java
vmkit/trunk/mmtk/java/src/org/mmtk/policy/immix/ImmixSpace.java
vmkit/trunk/mmtk/java/src/org/mmtk/policy/immix/Line.java
vmkit/trunk/mmtk/java/src/org/mmtk/policy/immix/ObjectHeader.java
vmkit/trunk/mmtk/java/src/org/mmtk/utility/Constants.java
vmkit/trunk/mmtk/java/src/org/mmtk/utility/alloc/BumpPointer.java
vmkit/trunk/mmtk/java/src/org/mmtk/utility/heap/FreeListPageResource.java
vmkit/trunk/mmtk/java/src/org/mmtk/utility/heap/Map.java
vmkit/trunk/mmtk/java/src/org/mmtk/utility/heap/Mmapper.java
vmkit/trunk/mmtk/java/src/org/mmtk/utility/options/Options.java
vmkit/trunk/mmtk/java/src/org/mmtk/utility/statistics/Counter.java
vmkit/trunk/mmtk/java/src/org/mmtk/utility/statistics/Stats.java
vmkit/trunk/mmtk/java/src/org/mmtk/vm/Barriers.java
vmkit/trunk/mmtk/java/src/org/mmtk/vm/Debug.java
vmkit/trunk/mmtk/java/src/org/mmtk/vm/Statistics.java
vmkit/trunk/mmtk/mmtk-j3/Statistics.cpp
vmkit/trunk/mmtk/mmtk-j3/VM.cpp
Modified: vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc (original)
+++ vmkit/trunk/mmtk/config/marksweep/MMTkInline.inc Sat Aug 14 07:25:41 2010
@@ -14,724 +14,61 @@
/*Params=*/FuncTy_1_args,
/*isVarArg=*/false);
-std::vector<const Type*>FuncTy_3_args;
-FuncTy_3_args.push_back(IntegerType::get(mod->getContext(), 32));
-FunctionType* FuncTy_3 = FunctionType::get(
- /*Result=*/PointerTy_0,
- /*Params=*/FuncTy_3_args,
- /*isVarArg=*/false);
-
-PointerType* PointerTy_2 = PointerType::get(FuncTy_3, 0);
-
-std::vector<const Type*>StructTy_struct_mvm__MutatorThread_fields;
-std::vector<const Type*>StructTy_struct_mvm__Thread_fields;
-std::vector<const Type*>StructTy_struct_mvm__CircularBase_fields;
-std::vector<const Type*>FuncTy_7_args;
-FunctionType* FuncTy_7 = FunctionType::get(
+std::vector<const Type*>StructTy_JavaObject_fields;
+std::vector<const Type*>FuncTy_5_args;
+FunctionType* FuncTy_5 = FunctionType::get(
/*Result=*/IntegerType::get(mod->getContext(), 32),
- /*Params=*/FuncTy_7_args,
+ /*Params=*/FuncTy_5_args,
/*isVarArg=*/true);
-PointerType* PointerTy_6 = PointerType::get(FuncTy_7, 0);
-
-PointerType* PointerTy_5 = PointerType::get(PointerTy_6, 0);
-
-StructTy_struct_mvm__CircularBase_fields.push_back(PointerTy_5);
-PATypeHolder StructTy_struct_mvm__CircularBase_fwd = OpaqueType::get(mod->getContext());
-PointerType* PointerTy_8 = PointerType::get(StructTy_struct_mvm__CircularBase_fwd, 0);
-
-StructTy_struct_mvm__CircularBase_fields.push_back(PointerTy_8);
-StructTy_struct_mvm__CircularBase_fields.push_back(PointerTy_8);
-StructType* StructTy_struct_mvm__CircularBase = StructType::get(mod->getContext(), StructTy_struct_mvm__CircularBase_fields, /*isPacked=*/false);
-mod->addTypeName("struct.mvm::CircularBase", StructTy_struct_mvm__CircularBase);
-cast<OpaqueType>(StructTy_struct_mvm__CircularBase_fwd.get())->refineAbstractTypeTo(StructTy_struct_mvm__CircularBase);
-StructTy_struct_mvm__CircularBase = cast<StructType>(StructTy_struct_mvm__CircularBase_fwd.get());
-
-
-StructTy_struct_mvm__Thread_fields.push_back(StructTy_struct_mvm__CircularBase);
-StructTy_struct_mvm__Thread_fields.push_back(IntegerType::get(mod->getContext(), 32));
-std::vector<const Type*>StructTy_struct_mvm__VirtualMachine_fields;
-StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_5);
-std::vector<const Type*>StructTy_struct_mvm__BumpPtrAllocator_fields;
-std::vector<const Type*>StructTy_struct_mvm__SpinLock_fields;
-StructTy_struct_mvm__SpinLock_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructType* StructTy_struct_mvm__SpinLock = StructType::get(mod->getContext(), StructTy_struct_mvm__SpinLock_fields, /*isPacked=*/false);
-mod->addTypeName("struct.mvm::SpinLock", StructTy_struct_mvm__SpinLock);
-
-StructTy_struct_mvm__BumpPtrAllocator_fields.push_back(StructTy_struct_mvm__SpinLock);
-std::vector<const Type*>StructTy_struct_llvm__BumpPtrAllocator_fields;
-StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(IntegerType::get(mod->getContext(), 32));
-std::vector<const Type*>StructTy_struct_gcRoot_fields;
-StructTy_struct_gcRoot_fields.push_back(PointerTy_5);
-StructType* StructTy_struct_gcRoot = StructType::get(mod->getContext(), StructTy_struct_gcRoot_fields, /*isPacked=*/false);
-mod->addTypeName("struct.gcRoot", StructTy_struct_gcRoot);
-
-PointerType* PointerTy_11 = PointerType::get(StructTy_struct_gcRoot, 0);
-
-StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(PointerTy_11);
-std::vector<const Type*>StructTy_struct_llvm__MemSlab_fields;
-StructTy_struct_llvm__MemSlab_fields.push_back(IntegerType::get(mod->getContext(), 32));
-PATypeHolder PointerTy_12_fwd = OpaqueType::get(mod->getContext());
-StructTy_struct_llvm__MemSlab_fields.push_back(PointerTy_12_fwd);
-StructType* StructTy_struct_llvm__MemSlab = StructType::get(mod->getContext(), StructTy_struct_llvm__MemSlab_fields, /*isPacked=*/false);
-mod->addTypeName("struct.llvm::MemSlab", StructTy_struct_llvm__MemSlab);
-
-PointerType* PointerTy_12 = PointerType::get(StructTy_struct_llvm__MemSlab, 0);
-cast<OpaqueType>(PointerTy_12_fwd.get())->refineAbstractTypeTo(PointerTy_12);
-PointerTy_12 = cast<PointerType>(PointerTy_12_fwd.get());
-
-
-StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(PointerTy_12);
-StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(PointerTy_0);
-StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(PointerTy_0);
-StructTy_struct_llvm__BumpPtrAllocator_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructType* StructTy_struct_llvm__BumpPtrAllocator = StructType::get(mod->getContext(), StructTy_struct_llvm__BumpPtrAllocator_fields, /*isPacked=*/false);
-mod->addTypeName("struct.llvm::BumpPtrAllocator", StructTy_struct_llvm__BumpPtrAllocator);
-
-StructTy_struct_mvm__BumpPtrAllocator_fields.push_back(StructTy_struct_llvm__BumpPtrAllocator);
-StructType* StructTy_struct_mvm__BumpPtrAllocator = StructType::get(mod->getContext(), StructTy_struct_mvm__BumpPtrAllocator_fields, /*isPacked=*/false);
-mod->addTypeName("struct.mvm::BumpPtrAllocator", StructTy_struct_mvm__BumpPtrAllocator);
-
-PointerType* PointerTy_10 = PointerType::get(StructTy_struct_mvm__BumpPtrAllocator, 0);
-
-StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_10);
-PATypeHolder StructTy_struct_mvm__Thread_fwd = OpaqueType::get(mod->getContext());
-PointerType* PointerTy_13 = PointerType::get(StructTy_struct_mvm__Thread_fwd, 0);
-
-StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_13);
-StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__SpinLock);
-std::vector<const Type*>StructTy_struct_mvm__ReferenceQueue_fields;
-std::vector<const Type*>StructTy_struct_gc_fields;
-StructTy_struct_gc_fields.push_back(StructTy_struct_gcRoot);
-StructType* StructTy_struct_gc = StructType::get(mod->getContext(), StructTy_struct_gc_fields, /*isPacked=*/false);
-mod->addTypeName("struct.gc", StructTy_struct_gc);
-
-PointerType* PointerTy_15 = PointerType::get(StructTy_struct_gc, 0);
-
-PointerType* PointerTy_14 = PointerType::get(PointerTy_15, 0);
-
-StructTy_struct_mvm__ReferenceQueue_fields.push_back(PointerTy_14);
-StructTy_struct_mvm__ReferenceQueue_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructTy_struct_mvm__ReferenceQueue_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructTy_struct_mvm__ReferenceQueue_fields.push_back(StructTy_struct_mvm__SpinLock);
-StructTy_struct_mvm__ReferenceQueue_fields.push_back(IntegerType::get(mod->getContext(), 8));
-StructType* StructTy_struct_mvm__ReferenceQueue = StructType::get(mod->getContext(), StructTy_struct_mvm__ReferenceQueue_fields, /*isPacked=*/false);
-mod->addTypeName("struct.mvm::ReferenceQueue", StructTy_struct_mvm__ReferenceQueue);
-
-StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__ReferenceQueue);
-StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__ReferenceQueue);
-StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__ReferenceQueue);
-StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__SpinLock);
-StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_14);
-StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_14);
-StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32));
-std::vector<const Type*>StructTy_struct_mvm__Cond_fields;
-std::vector<const Type*>StructTy_union_pthread_cond_t_fields;
-std::vector<const Type*>StructTy_struct__2__13_fields;
-StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 64));
-StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 64));
-StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 64));
-StructTy_struct__2__13_fields.push_back(PointerTy_0);
-StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructTy_struct__2__13_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructType* StructTy_struct__2__13 = StructType::get(mod->getContext(), StructTy_struct__2__13_fields, /*isPacked=*/false);
-mod->addTypeName("struct..2._13", StructTy_struct__2__13);
-
-StructTy_union_pthread_cond_t_fields.push_back(StructTy_struct__2__13);
-ArrayType* ArrayTy_16 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 1);
-
-StructTy_union_pthread_cond_t_fields.push_back(ArrayTy_16);
-StructType* StructTy_union_pthread_cond_t = StructType::get(mod->getContext(), StructTy_union_pthread_cond_t_fields, /*isPacked=*/false);
-mod->addTypeName("union.pthread_cond_t", StructTy_union_pthread_cond_t);
-
-StructTy_struct_mvm__Cond_fields.push_back(StructTy_union_pthread_cond_t);
-StructType* StructTy_struct_mvm__Cond = StructType::get(mod->getContext(), StructTy_struct_mvm__Cond_fields, /*isPacked=*/false);
-mod->addTypeName("struct.mvm::Cond", StructTy_struct_mvm__Cond);
-
-StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__Cond);
-std::vector<const Type*>StructTy_struct_mvm__LockNormal_fields;
-std::vector<const Type*>StructTy_struct_mvm__Lock_fields;
-StructTy_struct_mvm__Lock_fields.push_back(PointerTy_5);
-StructTy_struct_mvm__Lock_fields.push_back(PointerTy_13);
-std::vector<const Type*>StructTy_union_pthread_mutex_t_fields;
-std::vector<const Type*>StructTy_struct__1__pthread_mutex_s_fields;
-StructTy_struct__1__pthread_mutex_s_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructTy_struct__1__pthread_mutex_s_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructTy_struct__1__pthread_mutex_s_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructTy_struct__1__pthread_mutex_s_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructTy_struct__1__pthread_mutex_s_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructTy_struct__1__pthread_mutex_s_fields.push_back(StructTy_struct_mvm__SpinLock);
-StructType* StructTy_struct__1__pthread_mutex_s = StructType::get(mod->getContext(), StructTy_struct__1__pthread_mutex_s_fields, /*isPacked=*/false);
-mod->addTypeName("struct..1__pthread_mutex_s", StructTy_struct__1__pthread_mutex_s);
-
-StructTy_union_pthread_mutex_t_fields.push_back(StructTy_struct__1__pthread_mutex_s);
-StructType* StructTy_union_pthread_mutex_t = StructType::get(mod->getContext(), StructTy_union_pthread_mutex_t_fields, /*isPacked=*/false);
-mod->addTypeName("union.pthread_mutex_t", StructTy_union_pthread_mutex_t);
-
-StructTy_struct_mvm__Lock_fields.push_back(StructTy_union_pthread_mutex_t);
-StructType* StructTy_struct_mvm__Lock = StructType::get(mod->getContext(), StructTy_struct_mvm__Lock_fields, /*isPacked=*/false);
-mod->addTypeName("struct.mvm::Lock", StructTy_struct_mvm__Lock);
-
-StructTy_struct_mvm__LockNormal_fields.push_back(StructTy_struct_mvm__Lock);
-StructType* StructTy_struct_mvm__LockNormal = StructType::get(mod->getContext(), StructTy_struct_mvm__LockNormal_fields, /*isPacked=*/false);
-mod->addTypeName("struct.mvm::LockNormal", StructTy_struct_mvm__LockNormal);
-
-StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__LockNormal);
-StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_14);
-StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructTy_struct_mvm__VirtualMachine_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__LockNormal);
-StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__Cond);
-StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__SpinLock);
-StructTy_struct_mvm__VirtualMachine_fields.push_back(PointerTy_11);
-std::vector<const Type*>StructTy_struct_mvm__CollectionRV_fields;
-StructTy_struct_mvm__CollectionRV_fields.push_back(StructTy_struct_mvm__LockNormal);
-StructTy_struct_mvm__CollectionRV_fields.push_back(StructTy_struct_mvm__Cond);
-StructTy_struct_mvm__CollectionRV_fields.push_back(StructTy_struct_mvm__Cond);
-StructTy_struct_mvm__CollectionRV_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructTy_struct_mvm__CollectionRV_fields.push_back(IntegerType::get(mod->getContext(), 8));
-StructTy_struct_mvm__CollectionRV_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructType* StructTy_struct_mvm__CollectionRV = StructType::get(mod->getContext(), StructTy_struct_mvm__CollectionRV_fields, /*isPacked=*/false);
-mod->addTypeName("struct.mvm::CollectionRV", StructTy_struct_mvm__CollectionRV);
-
-StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__CollectionRV);
-std::vector<const Type*>StructTy_struct_mvm__StartEndFunctionMap_fields;
-std::vector<const Type*>StructTy_struct_mvm__FunctionMap_fields;
-std::vector<const Type*>StructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields;
-std::vector<const Type*>StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields;
-std::vector<const Type*>StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false__fields;
-std::vector<const Type*>StructTy_struct___gnu_cxx__new_allocator_gc___fields;
-StructTy_struct___gnu_cxx__new_allocator_gc___fields.push_back(IntegerType::get(mod->getContext(), 8));
-StructType* StructTy_struct___gnu_cxx__new_allocator_gc__ = StructType::get(mod->getContext(), StructTy_struct___gnu_cxx__new_allocator_gc___fields, /*isPacked=*/true);
-mod->addTypeName("struct.__gnu_cxx::new_allocator<gc*>", StructTy_struct___gnu_cxx__new_allocator_gc__);
-
-StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false__fields.push_back(StructTy_struct___gnu_cxx__new_allocator_gc__);
-std::vector<const Type*>StructTy_struct_std___Rb_tree_node_base_fields;
-StructTy_struct_std___Rb_tree_node_base_fields.push_back(IntegerType::get(mod->getContext(), 32));
-PATypeHolder StructTy_struct_std___Rb_tree_node_base_fwd = OpaqueType::get(mod->getContext());
-PointerType* PointerTy_17 = PointerType::get(StructTy_struct_std___Rb_tree_node_base_fwd, 0);
-
-StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_17);
-StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_17);
-StructTy_struct_std___Rb_tree_node_base_fields.push_back(PointerTy_17);
-StructType* StructTy_struct_std___Rb_tree_node_base = StructType::get(mod->getContext(), StructTy_struct_std___Rb_tree_node_base_fields, /*isPacked=*/false);
-mod->addTypeName("struct.std::_Rb_tree_node_base", StructTy_struct_std___Rb_tree_node_base);
-cast<OpaqueType>(StructTy_struct_std___Rb_tree_node_base_fwd.get())->refineAbstractTypeTo(StructTy_struct_std___Rb_tree_node_base);
-StructTy_struct_std___Rb_tree_node_base = cast<StructType>(StructTy_struct_std___Rb_tree_node_base_fwd.get());
-
-
-StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false__fields.push_back(StructTy_struct_std___Rb_tree_node_base);
-StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false__fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructType* StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false_ = StructType::get(mod->getContext(), StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false__fields, /*isPacked=*/false);
-mod->addTypeName("struct.std::_Rb_tree<const char,std::pair<const char, j3::ClassPrimitive*>,std::_Select1st<std::pair<const char, j3::ClassPrimitive*> >,std::less<const char>,std::allocator<std::pair<const char, j3::ClassPrimitive*> > >::_Rb_tree_impl<std::less<const char>,false>", StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false_);
-
-StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields.push_back(StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_________Rb_tree_impl_std__less_const_char__false_);
-StructType* StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______ = StructType::get(mod->getContext(), StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields, /*isPacked=*/false);
-mod->addTypeName("struct.std::_Rb_tree<const char,std::pair<const char, j3::ClassPrimitive*>,std::_Select1st<std::pair<const char, j3::ClassPrimitive*> >,std::less<const char>,std::allocator<std::pair<const char, j3::ClassPrimitive*> > >", StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______);
-
-StructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields.push_back(StructTy_struct_std___Rb_tree_const_char_std__pair_const_char__j3__ClassPrimitive___std___Select1st_std__pair_const_char__j3__ClassPrimitive_____std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______);
-StructType* StructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______ = StructType::get(mod->getContext(), StructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive_______fields, /*isPacked=*/false);
-mod->addTypeName("struct.std::map<const char,j3::ClassPrimitive*,std::less<const char>,std::allocator<std::pair<const char, j3::ClassPrimitive*> > >", StructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______);
-
-StructTy_struct_mvm__FunctionMap_fields.push_back(StructTy_struct_std__map_const_char_j3__ClassPrimitive__std__less_const_char__std__allocator_std__pair_const_char__j3__ClassPrimitive______);
-StructTy_struct_mvm__FunctionMap_fields.push_back(StructTy_struct_mvm__SpinLock);
-StructType* StructTy_struct_mvm__FunctionMap = StructType::get(mod->getContext(), StructTy_struct_mvm__FunctionMap_fields, /*isPacked=*/false);
-mod->addTypeName("struct.mvm::FunctionMap", StructTy_struct_mvm__FunctionMap);
-
-StructTy_struct_mvm__StartEndFunctionMap_fields.push_back(StructTy_struct_mvm__FunctionMap);
-StructType* StructTy_struct_mvm__StartEndFunctionMap = StructType::get(mod->getContext(), StructTy_struct_mvm__StartEndFunctionMap_fields, /*isPacked=*/false);
-mod->addTypeName("struct.mvm::StartEndFunctionMap", StructTy_struct_mvm__StartEndFunctionMap);
-
-StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__StartEndFunctionMap);
-StructTy_struct_mvm__VirtualMachine_fields.push_back(StructTy_struct_mvm__StartEndFunctionMap);
-StructType* StructTy_struct_mvm__VirtualMachine = StructType::get(mod->getContext(), StructTy_struct_mvm__VirtualMachine_fields, /*isPacked=*/false);
-mod->addTypeName("struct.mvm::VirtualMachine", StructTy_struct_mvm__VirtualMachine);
-
-PointerType* PointerTy_9 = PointerType::get(StructTy_struct_mvm__VirtualMachine, 0);
-
-StructTy_struct_mvm__Thread_fields.push_back(PointerTy_9);
-StructTy_struct_mvm__Thread_fields.push_back(PointerTy_0);
-StructTy_struct_mvm__Thread_fields.push_back(IntegerType::get(mod->getContext(), 8));
-StructTy_struct_mvm__Thread_fields.push_back(IntegerType::get(mod->getContext(), 8));
-StructTy_struct_mvm__Thread_fields.push_back(IntegerType::get(mod->getContext(), 8));
-StructTy_struct_mvm__Thread_fields.push_back(PointerTy_0);
-StructTy_struct_mvm__Thread_fields.push_back(PointerTy_0);
-std::vector<const Type*>FuncTy_19_args;
-FuncTy_19_args.push_back(PointerTy_13);
-FunctionType* FuncTy_19 = FunctionType::get(
- /*Result=*/Type::getVoidTy(mod->getContext()),
- /*Params=*/FuncTy_19_args,
- /*isVarArg=*/false);
-
-PointerType* PointerTy_18 = PointerType::get(FuncTy_19, 0);
-
-StructTy_struct_mvm__Thread_fields.push_back(PointerTy_18);
-std::vector<const Type*>StructTy_struct_mvm__KnownFrame_fields;
-PATypeHolder PointerTy_20_fwd = OpaqueType::get(mod->getContext());
-StructTy_struct_mvm__KnownFrame_fields.push_back(PointerTy_20_fwd);
-StructTy_struct_mvm__KnownFrame_fields.push_back(PointerTy_0);
-StructType* StructTy_struct_mvm__KnownFrame = StructType::get(mod->getContext(), StructTy_struct_mvm__KnownFrame_fields, /*isPacked=*/false);
-mod->addTypeName("struct.mvm::KnownFrame", StructTy_struct_mvm__KnownFrame);
-
-PointerType* PointerTy_20 = PointerType::get(StructTy_struct_mvm__KnownFrame, 0);
-cast<OpaqueType>(PointerTy_20_fwd.get())->refineAbstractTypeTo(PointerTy_20);
-PointerTy_20 = cast<PointerType>(PointerTy_20_fwd.get());
-
-
-StructTy_struct_mvm__Thread_fields.push_back(PointerTy_20);
-std::vector<const Type*>StructTy_struct_mvm__ExceptionBuffer_fields;
-PATypeHolder PointerTy_21_fwd = OpaqueType::get(mod->getContext());
-StructTy_struct_mvm__ExceptionBuffer_fields.push_back(PointerTy_21_fwd);
-std::vector<const Type*>StructTy_struct___jmp_buf_tag_fields;
-ArrayType* ArrayTy_23 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 6);
+PointerType* PointerTy_4 = PointerType::get(FuncTy_5, 0);
-StructTy_struct___jmp_buf_tag_fields.push_back(ArrayTy_23);
-StructTy_struct___jmp_buf_tag_fields.push_back(IntegerType::get(mod->getContext(), 32));
-std::vector<const Type*>StructTy_struct___sigset_t_fields;
-ArrayType* ArrayTy_24 = ArrayType::get(IntegerType::get(mod->getContext(), 32), 32);
-
-StructTy_struct___sigset_t_fields.push_back(ArrayTy_24);
-StructType* StructTy_struct___sigset_t = StructType::get(mod->getContext(), StructTy_struct___sigset_t_fields, /*isPacked=*/false);
-mod->addTypeName("struct.__sigset_t", StructTy_struct___sigset_t);
-
-StructTy_struct___jmp_buf_tag_fields.push_back(StructTy_struct___sigset_t);
-StructType* StructTy_struct___jmp_buf_tag = StructType::get(mod->getContext(), StructTy_struct___jmp_buf_tag_fields, /*isPacked=*/false);
-mod->addTypeName("struct.__jmp_buf_tag", StructTy_struct___jmp_buf_tag);
-
-ArrayType* ArrayTy_22 = ArrayType::get(StructTy_struct___jmp_buf_tag, 1);
-
-StructTy_struct_mvm__ExceptionBuffer_fields.push_back(ArrayTy_22);
-StructType* StructTy_struct_mvm__ExceptionBuffer = StructType::get(mod->getContext(), StructTy_struct_mvm__ExceptionBuffer_fields, /*isPacked=*/false);
-mod->addTypeName("struct.mvm::ExceptionBuffer", StructTy_struct_mvm__ExceptionBuffer);
-
-PointerType* PointerTy_21 = PointerType::get(StructTy_struct_mvm__ExceptionBuffer, 0);
-cast<OpaqueType>(PointerTy_21_fwd.get())->refineAbstractTypeTo(PointerTy_21);
-PointerTy_21 = cast<PointerType>(PointerTy_21_fwd.get());
-
-
-StructTy_struct_mvm__Thread_fields.push_back(PointerTy_21);
-StructType* StructTy_struct_mvm__Thread = StructType::get(mod->getContext(), StructTy_struct_mvm__Thread_fields, /*isPacked=*/false);
-mod->addTypeName("struct.mvm::Thread", StructTy_struct_mvm__Thread);
-cast<OpaqueType>(StructTy_struct_mvm__Thread_fwd.get())->refineAbstractTypeTo(StructTy_struct_mvm__Thread);
-StructTy_struct_mvm__Thread = cast<StructType>(StructTy_struct_mvm__Thread_fwd.get());
-
-
-StructTy_struct_mvm__MutatorThread_fields.push_back(StructTy_struct_mvm__Thread);
-StructTy_struct_mvm__MutatorThread_fields.push_back(StructTy_struct_mvm__BumpPtrAllocator);
-StructTy_struct_mvm__MutatorThread_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructTy_struct_mvm__MutatorThread_fields.push_back(PointerTy_18);
-StructType* StructTy_struct_mvm__MutatorThread = StructType::get(mod->getContext(), StructTy_struct_mvm__MutatorThread_fields, /*isPacked=*/false);
-mod->addTypeName("struct.mvm::MutatorThread", StructTy_struct_mvm__MutatorThread);
-
-PointerType* PointerTy_4 = PointerType::get(StructTy_struct_mvm__MutatorThread, 0);
-
-PointerType* PointerTy_25 = PointerType::get(IntegerType::get(mod->getContext(), 32), 0);
-
-std::vector<const Type*>StructTy_struct_j3__JavaObject_fields;
-StructTy_struct_j3__JavaObject_fields.push_back(StructTy_struct_gc);
-StructTy_struct_j3__JavaObject_fields.push_back(StructTy_struct_mvm__SpinLock);
-StructType* StructTy_struct_j3__JavaObject = StructType::get(mod->getContext(), StructTy_struct_j3__JavaObject_fields, /*isPacked=*/false);
-mod->addTypeName("struct.j3::JavaObject", StructTy_struct_j3__JavaObject);
-
-PointerType* PointerTy_26 = PointerType::get(StructTy_struct_j3__JavaObject, 0);
-
-std::vector<const Type*>FuncTy_28_args;
-FunctionType* FuncTy_28 = FunctionType::get(
- /*Result=*/Type::getVoidTy(mod->getContext()),
- /*Params=*/FuncTy_28_args,
- /*isVarArg=*/false);
-
-PointerType* PointerTy_27 = PointerType::get(FuncTy_28, 0);
-
-std::vector<const Type*>StructTy_JavaObject_fields;
-ArrayType* ArrayTy_VT = ArrayType::get(PointerTy_6, 0);
+ArrayType* ArrayTy_VT = ArrayType::get(PointerTy_4, 0);
mod->addTypeName("VT", ArrayTy_VT);
-PointerType* PointerTy_31 = PointerType::get(ArrayTy_VT, 0);
+PointerType* PointerTy_3 = PointerType::get(ArrayTy_VT, 0);
-StructTy_JavaObject_fields.push_back(PointerTy_31);
+StructTy_JavaObject_fields.push_back(PointerTy_3);
StructTy_JavaObject_fields.push_back(PointerTy_0);
StructType* StructTy_JavaObject = StructType::get(mod->getContext(), StructTy_JavaObject_fields, /*isPacked=*/false);
mod->addTypeName("JavaObject", StructTy_JavaObject);
-PointerType* PointerTy_30 = PointerType::get(StructTy_JavaObject, 0);
-
-PointerType* PointerTy_29 = PointerType::get(PointerTy_30, 0);
-
-PointerType* PointerTy_32 = PointerType::get(PointerTy_0, 0);
-
-std::vector<const Type*>FuncTy_34_args;
-FuncTy_34_args.push_back(PointerTy_30);
-FuncTy_34_args.push_back(IntegerType::get(mod->getContext(), 32));
-FuncTy_34_args.push_back(IntegerType::get(mod->getContext(), 32));
-FuncTy_34_args.push_back(IntegerType::get(mod->getContext(), 32));
-FunctionType* FuncTy_34 = FunctionType::get(
- /*Result=*/PointerTy_30,
- /*Params=*/FuncTy_34_args,
- /*isVarArg=*/false);
-
-PointerType* PointerTy_33 = PointerType::get(FuncTy_34, 0);
-
-PointerType* PointerTy_35 = PointerType::get(PointerTy_31, 0);
-
-std::vector<const Type*>FuncTy_37_args;
-FuncTy_37_args.push_back(PointerTy_30);
-FuncTy_37_args.push_back(PointerTy_30);
-FuncTy_37_args.push_back(PointerTy_30);
-FuncTy_37_args.push_back(IntegerType::get(mod->getContext(), 32));
-FuncTy_37_args.push_back(IntegerType::get(mod->getContext(), 32));
-FunctionType* FuncTy_37 = FunctionType::get(
- /*Result=*/PointerTy_30,
- /*Params=*/FuncTy_37_args,
- /*isVarArg=*/false);
-
-PointerType* PointerTy_36 = PointerType::get(FuncTy_37, 0);
+PointerType* PointerTy_2 = PointerType::get(StructTy_JavaObject, 0);
-PointerType* PointerTy_38 = PointerType::get(StructTy_struct_mvm__SpinLock, 0);
-
-std::vector<const Type*>StructTy_40_fields;
-std::vector<const Type*>StructTy_41_fields;
-std::vector<const Type*>StructTy_42_fields;
-StructTy_42_fields.push_back(StructTy_JavaObject);
-StructTy_42_fields.push_back(PointerTy_30);
-StructTy_42_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructTy_42_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructTy_42_fields.push_back(IntegerType::get(mod->getContext(), 32));
-StructTy_42_fields.push_back(PointerTy_30);
-StructTy_42_fields.push_back(IntegerType::get(mod->getContext(), 8));
-StructTy_42_fields.push_back(IntegerType::get(mod->getContext(), 8));
-StructTy_42_fields.push_back(IntegerType::get(mod->getContext(), 8));
-StructTy_42_fields.push_back(PointerTy_30);
-StructTy_42_fields.push_back(PointerTy_30);
-StructTy_42_fields.push_back(PointerTy_30);
-StructTy_42_fields.push_back(PointerTy_30);
-StructTy_42_fields.push_back(IntegerType::get(mod->getContext(), 8));
-StructType* StructTy_42 = StructType::get(mod->getContext(), StructTy_42_fields, /*isPacked=*/false);
-
-StructTy_41_fields.push_back(StructTy_42);
-StructTy_41_fields.push_back(PointerTy_30);
-StructTy_41_fields.push_back(PointerTy_30);
-StructTy_41_fields.push_back(PointerTy_30);
-StructTy_41_fields.push_back(PointerTy_30);
-StructTy_41_fields.push_back(PointerTy_30);
-StructTy_41_fields.push_back(PointerTy_30);
-StructTy_41_fields.push_back(PointerTy_30);
-StructType* StructTy_41 = StructType::get(mod->getContext(), StructTy_41_fields, /*isPacked=*/false);
-
-StructTy_40_fields.push_back(StructTy_41);
-StructTy_40_fields.push_back(PointerTy_30);
-StructTy_40_fields.push_back(PointerTy_30);
-StructTy_40_fields.push_back(IntegerType::get(mod->getContext(), 8));
-StructTy_40_fields.push_back(IntegerType::get(mod->getContext(), 8));
-StructType* StructTy_40 = StructType::get(mod->getContext(), StructTy_40_fields, /*isPacked=*/false);
-
-PointerType* PointerTy_39 = PointerType::get(StructTy_40, 0);
-
-std::vector<const Type*>StructTy_44_fields;
-StructTy_44_fields.push_back(StructTy_42);
-StructTy_44_fields.push_back(PointerTy_30);
-StructType* StructTy_44 = StructType::get(mod->getContext(), StructTy_44_fields, /*isPacked=*/false);
-
-PointerType* PointerTy_43 = PointerType::get(StructTy_44, 0);
-
-std::vector<const Type*>StructTy_46_fields;
-std::vector<const Type*>StructTy_47_fields;
-StructTy_47_fields.push_back(StructTy_42);
-StructType* StructTy_47 = StructType::get(mod->getContext(), StructTy_47_fields, /*isPacked=*/false);
-
-StructTy_46_fields.push_back(StructTy_47);
-StructTy_46_fields.push_back(PointerTy_30);
-StructTy_46_fields.push_back(IntegerType::get(mod->getContext(), 8));
-StructTy_46_fields.push_back(PointerTy_30);
-StructType* StructTy_46 = StructType::get(mod->getContext(), StructTy_46_fields, /*isPacked=*/false);
-
-PointerType* PointerTy_45 = PointerType::get(StructTy_46, 0);
-
-std::vector<const Type*>StructTy_49_fields;
-StructTy_49_fields.push_back(PointerTy_30);
-StructTy_49_fields.push_back(PointerTy_30);
-StructTy_49_fields.push_back(PointerTy_30);
-StructTy_49_fields.push_back(PointerTy_30);
-StructType* StructTy_49 = StructType::get(mod->getContext(), StructTy_49_fields, /*isPacked=*/false);
-
-PointerType* PointerTy_48 = PointerType::get(StructTy_49, 0);
-
-std::vector<const Type*>FuncTy_51_args;
-FuncTy_51_args.push_back(IntegerType::get(mod->getContext(), 1));
-FuncTy_51_args.push_back(IntegerType::get(mod->getContext(), 1));
-FuncTy_51_args.push_back(IntegerType::get(mod->getContext(), 1));
-FuncTy_51_args.push_back(IntegerType::get(mod->getContext(), 1));
-FuncTy_51_args.push_back(IntegerType::get(mod->getContext(), 1));
-FunctionType* FuncTy_51 = FunctionType::get(
- /*Result=*/Type::getVoidTy(mod->getContext()),
- /*Params=*/FuncTy_51_args,
- /*isVarArg=*/false);
-
-PointerType* PointerTy_50 = PointerType::get(FuncTy_51, 0);
-
-std::vector<const Type*>FuncTy_53_args;
-FuncTy_53_args.push_back(PointerTy_25);
-FuncTy_53_args.push_back(IntegerType::get(mod->getContext(), 32));
-FuncTy_53_args.push_back(IntegerType::get(mod->getContext(), 32));
-FunctionType* FuncTy_53 = FunctionType::get(
- /*Result=*/IntegerType::get(mod->getContext(), 32),
- /*Params=*/FuncTy_53_args,
+std::vector<const Type*>FuncTy_7_args;
+FuncTy_7_args.push_back(IntegerType::get(mod->getContext(), 32));
+FuncTy_7_args.push_back(PointerTy_2);
+FunctionType* FuncTy_7 = FunctionType::get(
+ /*Result=*/PointerTy_2,
+ /*Params=*/FuncTy_7_args,
/*isVarArg=*/false);
-PointerType* PointerTy_52 = PointerType::get(FuncTy_53, 0);
+PointerType* PointerTy_6 = PointerType::get(FuncTy_7, 0);
// Function Declarations
-Function* func_llvm_frameaddress = Function::Create(
- /*Type=*/FuncTy_3,
+Function* func_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2 = Function::Create(
+ /*Type=*/FuncTy_7,
/*Linkage=*/GlobalValue::ExternalLinkage,
- /*Name=*/"llvm.frameaddress", mod); // (external, no body)
-func_llvm_frameaddress->setCallingConv(CallingConv::C);
-AttrListPtr func_llvm_frameaddress_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind | Attribute::ReadNone;
- Attrs.push_back(PAWI);
- func_llvm_frameaddress_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-func_llvm_frameaddress->setAttributes(func_llvm_frameaddress_PAL);
-
-Function* func_abort = Function::Create(
- /*Type=*/FuncTy_28,
- /*Linkage=*/GlobalValue::ExternalLinkage,
- /*Name=*/"abort", mod); // (external, no body)
-func_abort->setCallingConv(CallingConv::C);
-AttrListPtr func_abort_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoReturn | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- func_abort_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-func_abort->setAttributes(func_abort_PAL);
-
-Function* func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III = Function::Create(
- /*Type=*/FuncTy_34,
- /*Linkage=*/GlobalValue::ExternalLinkage,
- /*Name=*/"JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III", mod);
-func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III->setCallingConv(CallingConv::C);
-AttrListPtr func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III_PAL;
+ /*Name=*/"JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2", mod);
+func_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2->setCallingConv(CallingConv::C);
+AttrListPtr func_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_PAL;
{
SmallVector<AttributeWithIndex, 4> Attrs;
AttributeWithIndex PAWI;
PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoInline;
Attrs.push_back(PAWI);
- func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
+ func_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
}
-func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III->setAttributes(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III_PAL);
-
-Function* func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II = Function::Create(
- /*Type=*/FuncTy_37,
- /*Linkage=*/GlobalValue::ExternalLinkage,
- /*Name=*/"JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II", mod);
-func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II->setCallingConv(CallingConv::C);
-AttrListPtr func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoInline;
- Attrs.push_back(PAWI);
- func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II->setAttributes(func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II_PAL);
-
-Function* func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III = Function::Create(
- /*Type=*/FuncTy_34,
- /*Linkage=*/GlobalValue::ExternalLinkage,
- /*Name=*/"JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III", mod);
-func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III->setCallingConv(CallingConv::C);
-AttrListPtr func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoInline;
- Attrs.push_back(PAWI);
- func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III->setAttributes(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III_PAL);
-
-Function* func_llvm_memory_barrier = Function::Create(
- /*Type=*/FuncTy_51,
- /*Linkage=*/GlobalValue::ExternalLinkage,
- /*Name=*/"llvm.memory.barrier", mod); // (external, no body)
-func_llvm_memory_barrier->setCallingConv(CallingConv::C);
-AttrListPtr func_llvm_memory_barrier_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- func_llvm_memory_barrier_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-func_llvm_memory_barrier->setAttributes(func_llvm_memory_barrier_PAL);
-
-Function* func_llvm_atomic_cmp_swap_i32_p0i32 = Function::Create(
- /*Type=*/FuncTy_53,
- /*Linkage=*/GlobalValue::ExternalLinkage,
- /*Name=*/"llvm.atomic.cmp.swap.i32.p0i32", mod); // (external, no body)
-func_llvm_atomic_cmp_swap_i32_p0i32->setCallingConv(CallingConv::C);
-AttrListPtr func_llvm_atomic_cmp_swap_i32_p0i32_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 1U; PAWI.Attrs = 0 | Attribute::NoCapture;
- Attrs.push_back(PAWI);
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- func_llvm_atomic_cmp_swap_i32_p0i32_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-func_llvm_atomic_cmp_swap_i32_p0i32->setAttributes(func_llvm_atomic_cmp_swap_i32_p0i32_PAL);
-
-Function* func__ZN3mvm6Thread5yieldEv = Function::Create(
- /*Type=*/FuncTy_28,
- /*Linkage=*/GlobalValue::ExternalLinkage,
- /*Name=*/"_ZN3mvm6Thread5yieldEv", mod); // (external, no body)
-func__ZN3mvm6Thread5yieldEv->setCallingConv(CallingConv::C);
-AttrListPtr func__ZN3mvm6Thread5yieldEv_PAL;
-func__ZN3mvm6Thread5yieldEv->setAttributes(func__ZN3mvm6Thread5yieldEv_PAL);
+func_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2->setAttributes(func_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_PAL);
// Global Variable Declarations
-GlobalVariable* gvar_struct_finalObject67 = new GlobalVariable(/*Module=*/*mod,
-/*Type=*/StructTy_40,
-/*isConstant=*/false,
-/*Linkage=*/GlobalValue::ExternalLinkage,
-/*Initializer=*/0, // has initializer, specified below
-/*Name=*/"finalObject67");
-
-GlobalVariable* gvar_struct_finalObject2 = new GlobalVariable(/*Module=*/*mod,
-/*Type=*/StructTy_44,
-/*isConstant=*/false,
-/*Linkage=*/GlobalValue::ExternalLinkage,
-/*Initializer=*/0, // has initializer, specified below
-/*Name=*/"finalObject2");
-
-GlobalVariable* gvar_struct_finalObject32 = new GlobalVariable(/*Module=*/*mod,
-/*Type=*/StructTy_46,
-/*isConstant=*/false,
-/*Linkage=*/GlobalValue::ExternalLinkage,
-/*Initializer=*/0, // has initializer, specified below
-/*Name=*/"finalObject32");
-
-GlobalVariable* gvar_struct_org_mmtk_utility_DoublyLinkedList_static = new GlobalVariable(/*Module=*/*mod,
-/*Type=*/StructTy_49,
-/*isConstant=*/false,
-/*Linkage=*/GlobalValue::ExternalLinkage,
-/*Initializer=*/0, // has initializer, specified below
-/*Name=*/"org_mmtk_utility_DoublyLinkedList_static");
-
-GlobalVariable* gvar_struct_finalObject85 = new GlobalVariable(/*Module=*/*mod,
-/*Type=*/StructTy_40,
-/*isConstant=*/false,
-/*Linkage=*/GlobalValue::ExternalLinkage,
-/*Initializer=*/0, // has initializer, specified below
-/*Name=*/"finalObject85");
-
-GlobalVariable* gvar_struct_finalObject101 = new GlobalVariable(/*Module=*/*mod,
-/*Type=*/StructTy_46,
-/*isConstant=*/false,
-/*Linkage=*/GlobalValue::ExternalLinkage,
-/*Initializer=*/0, // has initializer, specified below
-/*Name=*/"finalObject101");
-
-GlobalVariable* gvar_struct_finalObject122 = new GlobalVariable(/*Module=*/*mod,
-/*Type=*/StructTy_40,
-/*isConstant=*/false,
-/*Linkage=*/GlobalValue::ExternalLinkage,
-/*Initializer=*/0, // has initializer, specified below
-/*Name=*/"finalObject122");
-
// Constant Definitions
-ConstantInt* const_int32_54 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("3"), 10));
-ConstantInt* const_int32_55 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-4"), 10));
-ConstantInt* const_int32_56 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("0"), 10));
-ConstantInt* const_int32_57 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2146435072"), 10));
-ConstantInt* const_int32_58 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2"), 10));
-ConstantInt* const_int32_59 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("8193"), 10));
-ConstantInt* const_int32_60 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("4"), 10));
-ConstantInt* const_int32_61 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("7"), 10));
-ConstantInt* const_int32_62 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("8"), 10));
-ConstantInt* const_int32_63 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-1"), 10));
-ConstantInt* const_int32_64 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("63"), 10));
-ConstantInt* const_int32_65 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("127"), 10));
-ConstantInt* const_int32_66 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("255"), 10));
-ConstantInt* const_int32_67 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("511"), 10));
-ConstantInt* const_int32_68 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("2047"), 10));
-ConstantInt* const_int32_69 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("10"), 10));
-ConstantInt* const_int32_70 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("32"), 10));
-ConstantInt* const_int32_71 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("12"), 10));
-ConstantInt* const_int32_72 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("5"), 10));
-ConstantInt* const_int32_73 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("16"), 10));
-ConstantInt* const_int32_74 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("6"), 10));
-ConstantInt* const_int32_75 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("20"), 10));
-ConstantInt* const_int32_76 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("26"), 10));
-ConstantInt* const_int32_77 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1"), 10));
-ConstantPointerNull* const_ptr_78 = ConstantPointerNull::get(PointerTy_31);
-ConstantInt* const_int32_79 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-16"), 10));
-std::vector<Constant*> const_ptr_80_indices;
-const_ptr_80_indices.push_back(const_int32_56);
-const_ptr_80_indices.push_back(const_int32_58);
-Constant* const_ptr_80 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject67, &const_ptr_80_indices[0], const_ptr_80_indices.size());
-ConstantInt* const_int32_81 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-2"), 10));
-std::vector<Constant*> const_ptr_82_indices;
-const_ptr_82_indices.push_back(const_int32_56);
-const_ptr_82_indices.push_back(const_int32_77);
-Constant* const_ptr_82 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject2, &const_ptr_82_indices[0], const_ptr_82_indices.size());
-std::vector<Constant*> const_ptr_83_indices;
-const_ptr_83_indices.push_back(const_int32_56);
-const_ptr_83_indices.push_back(const_int32_77);
-Constant* const_ptr_83 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject32, &const_ptr_83_indices[0], const_ptr_83_indices.size());
-std::vector<Constant*> const_ptr_84_indices;
-const_ptr_84_indices.push_back(const_int32_56);
-const_ptr_84_indices.push_back(const_int32_54);
-Constant* const_ptr_84 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject32, &const_ptr_84_indices[0], const_ptr_84_indices.size());
-ConstantInt* const_int32_85 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-32"), 10));
-ConstantPointerNull* const_ptr_86 = ConstantPointerNull::get(PointerTy_0);
-std::vector<Constant*> const_ptr_87_indices;
-const_ptr_87_indices.push_back(const_int32_56);
-const_ptr_87_indices.push_back(const_int32_58);
-Constant* const_ptr_87 = ConstantExpr::getGetElementPtr(gvar_struct_org_mmtk_utility_DoublyLinkedList_static, &const_ptr_87_indices[0], const_ptr_87_indices.size());
-ConstantPointerNull* const_ptr_88 = ConstantPointerNull::get(PointerTy_30);
-ConstantInt* const_int32_89 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("1000"), 10));
-ConstantInt* const_int1_90 = ConstantInt::get(mod->getContext(), APInt(1, StringRef("-1"), 10));
-std::vector<Constant*> const_ptr_91_indices;
-const_ptr_91_indices.push_back(const_int32_56);
-const_ptr_91_indices.push_back(const_int32_58);
-Constant* const_ptr_91 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject85, &const_ptr_91_indices[0], const_ptr_91_indices.size());
-std::vector<Constant*> const_ptr_92_indices;
-const_ptr_92_indices.push_back(const_int32_56);
-const_ptr_92_indices.push_back(const_int32_77);
-Constant* const_ptr_92 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject101, &const_ptr_92_indices[0], const_ptr_92_indices.size());
-std::vector<Constant*> const_ptr_93_indices;
-const_ptr_93_indices.push_back(const_int32_56);
-const_ptr_93_indices.push_back(const_int32_54);
-Constant* const_ptr_93 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject101, &const_ptr_93_indices[0], const_ptr_93_indices.size());
-std::vector<Constant*> const_ptr_94_indices;
-const_ptr_94_indices.push_back(const_int32_56);
-const_ptr_94_indices.push_back(const_int32_58);
-Constant* const_ptr_94 = ConstantExpr::getGetElementPtr(gvar_struct_finalObject122, &const_ptr_94_indices[0], const_ptr_94_indices.size());
+ConstantInt* const_int32_8 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("3"), 10));
+ConstantInt* const_int32_9 = ConstantInt::get(mod->getContext(), APInt(32, StringRef("-4"), 10));
// Global Variable Definitions
@@ -757,1155 +94,29 @@
ptr_VT->setName("VT");
BasicBlock* label_entry = BasicBlock::Create(mod->getContext(), "entry",func_gcmalloc,0);
-BasicBlock* label_tableswitch_i_i1_i = BasicBlock::Create(mod->getContext(), "tableswitch.i.i1.i",func_gcmalloc,0);
-BasicBlock* label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_GOTO_or_IF_4_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*4.i.i.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_GOTO_or_IF_6_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*6.i.i.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_GOTO_or_IF_7_i_i1_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*7.i.i1.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_GOTO_or_IF_8_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*8.i.i.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_GOTO_or_IF_9_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*9.i.i.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_false_IF_ICMPGT16_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT16.i.i.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_false_IF_ICMPGT17_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT17.i.i.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_false_IF_ICMPGT18_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT18.i.i.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_false_IF_ICMPGT19_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT19.i.i.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_false_IF_ICMPGT20_i_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT20.i.i.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_GOTO_or_IF__i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_false_IFNE_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IFNE.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II.exit.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2.exit.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_false_IFEQ_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IFEQ.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_tableswitch3_i_i4_i = BasicBlock::Create(mod->getContext(), "tableswitch3.i.i4.i",func_gcmalloc,0);
-BasicBlock* label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i5.i.i.i",func_gcmalloc,0);
-BasicBlock* label_GOTO_or_IF_4_i_i_i6_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*4.i.i.i6.i.i.i",func_gcmalloc,0);
-BasicBlock* label_GOTO_or_IF_6_i_i_i7_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*6.i.i.i7.i.i.i",func_gcmalloc,0);
-BasicBlock* label_GOTO_or_IF_7_i_i1_i8_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*7.i.i1.i8.i.i.i",func_gcmalloc,0);
-BasicBlock* label_GOTO_or_IF_8_i_i_i9_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*8.i.i.i9.i.i.i",func_gcmalloc,0);
-BasicBlock* label_GOTO_or_IF_9_i_i_i10_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*9.i.i.i10.i.i.i",func_gcmalloc,0);
-BasicBlock* label_false_IF_ICMPGT16_i_i_i11_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT16.i.i.i11.i.i.i",func_gcmalloc,0);
-BasicBlock* label_false_IF_ICMPGT17_i_i_i12_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT17.i.i.i12.i.i.i",func_gcmalloc,0);
-BasicBlock* label_false_IF_ICMPGT18_i_i_i13_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT18.i.i.i13.i.i.i",func_gcmalloc,0);
-BasicBlock* label_false_IF_ICMPGT19_i_i_i14_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT19.i.i.i14.i.i.i",func_gcmalloc,0);
-BasicBlock* label_false_IF_ICMPGT20_i_i_i15_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT20.i.i.i15.i.i.i",func_gcmalloc,0);
-BasicBlock* label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i16.i.i.i",func_gcmalloc,0);
-BasicBlock* label_GOTO_or_IF__i17_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*.i17.i.i.i",func_gcmalloc,0);
-BasicBlock* label_false_IFNE_i21_i_i_i = BasicBlock::Create(mod->getContext(), "false IFNE.i21.i.i.i",func_gcmalloc,0);
-BasicBlock* label_tableswitch5_i_i6_i = BasicBlock::Create(mod->getContext(), "tableswitch5.i.i6.i",func_gcmalloc,0);
-BasicBlock* label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i.i.i",func_gcmalloc,0);
-BasicBlock* label_GOTO_or_IF_4_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*4.i.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_GOTO_or_IF_6_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*6.i.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_GOTO_or_IF_7_i_i1_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*7.i.i1.i.i.i",func_gcmalloc,0);
-BasicBlock* label_GOTO_or_IF_8_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*8.i.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_GOTO_or_IF_9_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*9.i.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_false_IF_ICMPGT16_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT16.i.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_false_IF_ICMPGT17_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT17.i.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_false_IF_ICMPGT18_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT18.i.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_false_IF_ICMPGT19_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT19.i.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_false_IF_ICMPGT20_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IF_ICMPGT20.i.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i.i.i",func_gcmalloc,0);
-BasicBlock* label_GOTO_or_IF__i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*.i.i.i",func_gcmalloc,0);
-BasicBlock* label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III.exit.i.i",func_gcmalloc,0);
-BasicBlock* label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i = BasicBlock::Create(mod->getContext(), "JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.i",func_gcmalloc,0);
-BasicBlock* label_tableswitch_i_i_i = BasicBlock::Create(mod->getContext(), "tableswitch.i.i.i",func_gcmalloc,0);
-BasicBlock* label_tableswitch1_i_i_i = BasicBlock::Create(mod->getContext(), "tableswitch1.i.i.i",func_gcmalloc,0);
-BasicBlock* label_tableswitch2_i_i_i = BasicBlock::Create(mod->getContext(), "tableswitch2.i.i.i",func_gcmalloc,0);
-BasicBlock* label_tableswitch3_i_i_i = BasicBlock::Create(mod->getContext(), "tableswitch3.i.i.i",func_gcmalloc,0);
-BasicBlock* label_true_IF_NULL_i1_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "true IF*NULL.i1.i.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_GOTO_or_IF_1_i3_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*1.i3.i.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_true_IFNULL_i5_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "true IFNULL.i5.i.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_bb_i_i34_i = BasicBlock::Create(mod->getContext(), "bb.i.i34.i",func_gcmalloc,0);
-BasicBlock* label_bb1_i_i35_i = BasicBlock::Create(mod->getContext(), "bb1.i.i35.i",func_gcmalloc,0);
-BasicBlock* label_bb2_i_i36_i = BasicBlock::Create(mod->getContext(), "bb2.i.i36.i",func_gcmalloc,0);
-BasicBlock* label_bb4_preheader_i_i37_i = BasicBlock::Create(mod->getContext(), "bb4.preheader.i.i37.i",func_gcmalloc,0);
-BasicBlock* label_bb3_i_i38_i = BasicBlock::Create(mod->getContext(), "bb3.i.i38.i",func_gcmalloc,0);
-BasicBlock* label_false_IFNE_i7_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "false IFNE.i7.i.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_true_IFNULL3_i8_i_i_i_i_i = BasicBlock::Create(mod->getContext(), "true IFNULL3.i8.i.i.i.i.i",func_gcmalloc,0);
-BasicBlock* label_tableswitch4_i_i_i = BasicBlock::Create(mod->getContext(), "tableswitch4.i.i.i",func_gcmalloc,0);
-BasicBlock* label_tableswitch5_i_i_i = BasicBlock::Create(mod->getContext(), "tableswitch5.i.i.i",func_gcmalloc,0);
-BasicBlock* label_true_IF_NULL_i1_i_i3_i_i_i = BasicBlock::Create(mod->getContext(), "true IF*NULL.i1.i.i3.i.i.i",func_gcmalloc,0);
-BasicBlock* label_GOTO_or_IF_1_i3_i_i5_i_i_i = BasicBlock::Create(mod->getContext(), "GOTO or IF*1.i3.i.i5.i.i.i",func_gcmalloc,0);
-BasicBlock* label_true_IFNULL_i5_i_i6_i_i_i = BasicBlock::Create(mod->getContext(), "true IFNULL.i5.i.i6.i.i.i",func_gcmalloc,0);
-BasicBlock* label_bb_i_i_i = BasicBlock::Create(mod->getContext(), "bb.i.i.i",func_gcmalloc,0);
-BasicBlock* label_bb1_i_i_i = BasicBlock::Create(mod->getContext(), "bb1.i.i.i",func_gcmalloc,0);
-BasicBlock* label_bb2_i_i_i = BasicBlock::Create(mod->getContext(), "bb2.i.i.i",func_gcmalloc,0);
-BasicBlock* label_bb4_preheader_i_i_i = BasicBlock::Create(mod->getContext(), "bb4.preheader.i.i.i",func_gcmalloc,0);
-BasicBlock* label_bb3_i_i_i = BasicBlock::Create(mod->getContext(), "bb3.i.i.i",func_gcmalloc,0);
-BasicBlock* label_false_IFNE_i7_i_i8_i_i_i = BasicBlock::Create(mod->getContext(), "false IFNE.i7.i.i8.i.i.i",func_gcmalloc,0);
-BasicBlock* label_true_IFNULL3_i8_i_i9_i_i_i = BasicBlock::Create(mod->getContext(), "true IFNULL3.i8.i.i9.i.i.i",func_gcmalloc,0);
-BasicBlock* label_false_IFNE_i_i = BasicBlock::Create(mod->getContext(), "false IFNE.i.i",func_gcmalloc,0);
-BasicBlock* label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit = BasicBlock::Create(mod->getContext(), "JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2.exit",func_gcmalloc,0);
// Block entry (label_entry)
-BinaryOperator* int32_95 = BinaryOperator::Create(Instruction::Add, int32_sz, const_int32_54, "", label_entry);
-BinaryOperator* int32_96 = BinaryOperator::Create(Instruction::And, int32_95, const_int32_55, "", label_entry);
-CallInst* ptr_97 = CallInst::Create(func_llvm_frameaddress, const_int32_56, "", label_entry);
-ptr_97->setCallingConv(CallingConv::C);
-ptr_97->setTailCall(true);
-AttrListPtr ptr_97_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- ptr_97_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-ptr_97->setAttributes(ptr_97_PAL);
-
-CastInst* int32_98 = new PtrToIntInst(ptr_97, IntegerType::get(mod->getContext(), 32), "", label_entry);
-BinaryOperator* int32_99 = BinaryOperator::Create(Instruction::And, int32_98, const_int32_57, "", label_entry);
-CastInst* ptr_100 = new IntToPtrInst(int32_99, PointerTy_4, "", label_entry);
-std::vector<Value*> ptr_101_indices;
-ptr_101_indices.push_back(const_int32_56);
-ptr_101_indices.push_back(const_int32_58);
-Instruction* ptr_101 = GetElementPtrInst::Create(ptr_100, ptr_101_indices.begin(), ptr_101_indices.end(), "", label_entry);
-LoadInst* int32_102 = new LoadInst(ptr_101, "", false, label_entry);
-CastInst* ptr_103 = new IntToPtrInst(int32_102, PointerTy_26, "", label_entry);
-ICmpInst* int1_104 = new ICmpInst(*label_entry, ICmpInst::ICMP_SLT, int32_96, const_int32_59, "");
-SelectInst* int32_storemerge_i_i = SelectInst::Create(int1_104, const_int32_56, const_int32_60, "storemerge.i.i", label_entry);
-SwitchInst* void_105 = SwitchInst::Create(int32_storemerge_i_i, label_tableswitch_i_i1_i, 7, label_entry);
-void_105->addCase(const_int32_56, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i);
-void_105->addCase(const_int32_58, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i);
-void_105->addCase(const_int32_54, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i);
-void_105->addCase(const_int32_60, label_tableswitch3_i_i4_i);
-void_105->addCase(const_int32_61, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i);
-void_105->addCase(const_int32_62, label_tableswitch5_i_i6_i);
-
-
-// Block tableswitch.i.i1.i (label_tableswitch_i_i1_i)
-CallInst* void_106 = CallInst::Create(func_abort, "", label_tableswitch_i_i1_i);
-void_106->setCallingConv(CallingConv::C);
-void_106->setTailCall(true);
-AttrListPtr void_106_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoReturn | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- void_106_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-void_106->setAttributes(void_106_PAL);
-
-new UnreachableInst(mod->getContext(), label_tableswitch_i_i1_i);
-
-// Block JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i)
-GetElementPtrInst* ptr_108 = GetElementPtrInst::Create(ptr_103, const_int32_60, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i);
-CastInst* ptr_109 = new BitCastInst(ptr_108, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i);
-LoadInst* ptr_110 = new LoadInst(ptr_109, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i);
-BinaryOperator* int32_111 = BinaryOperator::Create(Instruction::Add, int32_96, const_int32_63, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i);
-ICmpInst* int1_112 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i, ICmpInst::ICMP_SGT, int32_111, const_int32_64, "");
-BranchInst::Create(label_GOTO_or_IF_4_i_i_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i_i, int1_112, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i_i);
-
-// Block GOTO or IF*4.i.i.i.i.i.i (label_GOTO_or_IF_4_i_i_i_i_i_i)
-ICmpInst* int1_114 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_111, const_int32_65, "");
-BranchInst::Create(label_GOTO_or_IF_6_i_i_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i_i, int1_114, label_GOTO_or_IF_4_i_i_i_i_i_i);
-
-// Block GOTO or IF*6.i.i.i.i.i.i (label_GOTO_or_IF_6_i_i_i_i_i_i)
-ICmpInst* int1_116 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_111, const_int32_66, "");
-BranchInst::Create(label_GOTO_or_IF_7_i_i1_i_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i_i, int1_116, label_GOTO_or_IF_6_i_i_i_i_i_i);
-
-// Block GOTO or IF*7.i.i1.i.i.i.i (label_GOTO_or_IF_7_i_i1_i_i_i_i)
-ICmpInst* int1_118 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i_i_i_i, ICmpInst::ICMP_SGT, int32_111, const_int32_67, "");
-BranchInst::Create(label_GOTO_or_IF_8_i_i_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i_i, int1_118, label_GOTO_or_IF_7_i_i1_i_i_i_i);
-
-// Block GOTO or IF*8.i.i.i.i.i.i (label_GOTO_or_IF_8_i_i_i_i_i_i)
-ICmpInst* int1_120 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_111, const_int32_68, "");
-BranchInst::Create(label_GOTO_or_IF_9_i_i_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i_i, int1_120, label_GOTO_or_IF_8_i_i_i_i_i_i);
-
-// Block GOTO or IF*9.i.i.i.i.i.i (label_GOTO_or_IF_9_i_i_i_i_i_i)
-BinaryOperator* int32_122 = BinaryOperator::Create(Instruction::AShr, int32_111, const_int32_69, "", label_GOTO_or_IF_9_i_i_i_i_i_i);
-BinaryOperator* int32_123 = BinaryOperator::Create(Instruction::Add, int32_122, const_int32_70, "", label_GOTO_or_IF_9_i_i_i_i_i_i);
-BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_GOTO_or_IF_9_i_i_i_i_i_i);
-
-// Block false IF_ICMPGT16.i.i.i.i.i.i (label_false_IF_ICMPGT16_i_i_i_i_i_i)
-BinaryOperator* int32_125 = BinaryOperator::Create(Instruction::AShr, int32_111, const_int32_58, "", label_false_IF_ICMPGT16_i_i_i_i_i_i);
-BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i_i);
-
-// Block false IF_ICMPGT17.i.i.i.i.i.i (label_false_IF_ICMPGT17_i_i_i_i_i_i)
-BinaryOperator* int32_127 = BinaryOperator::Create(Instruction::AShr, int32_111, const_int32_60, "", label_false_IF_ICMPGT17_i_i_i_i_i_i);
-BinaryOperator* int32_128 = BinaryOperator::Create(Instruction::Add, int32_127, const_int32_71, "", label_false_IF_ICMPGT17_i_i_i_i_i_i);
-BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i_i);
-
-// Block false IF_ICMPGT18.i.i.i.i.i.i (label_false_IF_ICMPGT18_i_i_i_i_i_i)
-BinaryOperator* int32_130 = BinaryOperator::Create(Instruction::AShr, int32_111, const_int32_72, "", label_false_IF_ICMPGT18_i_i_i_i_i_i);
-BinaryOperator* int32_131 = BinaryOperator::Create(Instruction::Add, int32_130, const_int32_73, "", label_false_IF_ICMPGT18_i_i_i_i_i_i);
-BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i_i);
-
-// Block false IF_ICMPGT19.i.i.i.i.i.i (label_false_IF_ICMPGT19_i_i_i_i_i_i)
-BinaryOperator* int32_133 = BinaryOperator::Create(Instruction::AShr, int32_111, const_int32_74, "", label_false_IF_ICMPGT19_i_i_i_i_i_i);
-BinaryOperator* int32_134 = BinaryOperator::Create(Instruction::Add, int32_133, const_int32_75, "", label_false_IF_ICMPGT19_i_i_i_i_i_i);
-BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i_i);
-
-// Block false IF_ICMPGT20.i.i.i.i.i.i (label_false_IF_ICMPGT20_i_i_i_i_i_i)
-BinaryOperator* int32_136 = BinaryOperator::Create(Instruction::AShr, int32_111, const_int32_62, "", label_false_IF_ICMPGT20_i_i_i_i_i_i);
-BinaryOperator* int32_137 = BinaryOperator::Create(Instruction::Add, int32_136, const_int32_76, "", label_false_IF_ICMPGT20_i_i_i_i_i_i);
-BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i_i);
-
-// Block JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i.i.i.i (label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i)
-PHINode* int32_139 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i);
-int32_139->reserveOperandSpace(6);
-int32_139->addIncoming(int32_125, label_false_IF_ICMPGT16_i_i_i_i_i_i);
-int32_139->addIncoming(int32_128, label_false_IF_ICMPGT17_i_i_i_i_i_i);
-int32_139->addIncoming(int32_131, label_false_IF_ICMPGT18_i_i_i_i_i_i);
-int32_139->addIncoming(int32_134, label_false_IF_ICMPGT19_i_i_i_i_i_i);
-int32_139->addIncoming(int32_137, label_false_IF_ICMPGT20_i_i_i_i_i_i);
-int32_139->addIncoming(int32_123, label_GOTO_or_IF_9_i_i_i_i_i_i);
-
-std::vector<Value*> ptr_140_indices;
-ptr_140_indices.push_back(const_int32_77);
-ptr_140_indices.push_back(const_int32_77);
-Instruction* ptr_140 = GetElementPtrInst::Create(ptr_110, ptr_140_indices.begin(), ptr_140_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i);
-LoadInst* ptr_141 = new LoadInst(ptr_140, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i);
-BinaryOperator* int32_142 = BinaryOperator::Create(Instruction::Add, int32_139, const_int32_77, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i);
-CastInst* ptr_143 = new BitCastInst(ptr_141, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i);
-GetElementPtrInst* ptr_144 = GetElementPtrInst::Create(ptr_143, int32_142, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i);
-LoadInst* int32_145 = new LoadInst(ptr_144, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i);
-CastInst* ptr_146 = new IntToPtrInst(int32_145, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i);
-ICmpInst* int1_147 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i, ICmpInst::ICMP_EQ, int32_145, const_int32_56, "");
-BranchInst::Create(label_GOTO_or_IF__i_i_i_i, label_false_IFNE_i_i_i_i, int1_147, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i_i);
-
-// Block GOTO or IF*.i.i.i.i (label_GOTO_or_IF__i_i_i_i)
-std::vector<Value*> ptr_149_params;
-ptr_149_params.push_back(ptr_110);
-ptr_149_params.push_back(int32_96);
-ptr_149_params.push_back(const_int32_56);
-ptr_149_params.push_back(const_int32_56);
-CallInst* ptr_149 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_149_params.begin(), ptr_149_params.end(), "", label_GOTO_or_IF__i_i_i_i);
-ptr_149->setCallingConv(CallingConv::C);
-ptr_149->setTailCall(true);
-AttrListPtr ptr_149_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- ptr_149_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-ptr_149->setAttributes(ptr_149_PAL);
-
-BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_GOTO_or_IF__i_i_i_i);
-
-// Block false IFNE.i.i.i.i (label_false_IFNE_i_i_i_i)
-CastInst* ptr_151 = new IntToPtrInst(int32_145, PointerTy_29, "", label_false_IFNE_i_i_i_i);
-LoadInst* ptr_152 = new LoadInst(ptr_151, "", false, label_false_IFNE_i_i_i_i);
-CastInst* int32_153 = new PtrToIntInst(ptr_152, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i_i_i_i);
- new StoreInst(int32_153, ptr_144, false, label_false_IFNE_i_i_i_i);
-std::vector<Value*> ptr_155_indices;
-ptr_155_indices.push_back(const_int32_56);
-ptr_155_indices.push_back(const_int32_56);
-Instruction* ptr_155 = GetElementPtrInst::Create(ptr_146, ptr_155_indices.begin(), ptr_155_indices.end(), "", label_false_IFNE_i_i_i_i);
- new StoreInst(const_ptr_78, ptr_155, false, label_false_IFNE_i_i_i_i);
-BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_false_IFNE_i_i_i_i);
-
-// Block JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II.exit.i.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i)
-GetElementPtrInst* ptr_158 = GetElementPtrInst::Create(ptr_103, const_int32_58, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i);
-CastInst* ptr_159 = new BitCastInst(ptr_158, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i);
-LoadInst* ptr_160 = new LoadInst(ptr_159, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i);
-GetElementPtrInst* ptr_161 = GetElementPtrInst::Create(ptr_160, const_int32_77, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i);
-CastInst* ptr_162 = new BitCastInst(ptr_161, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i);
-LoadInst* ptr_163 = new LoadInst(ptr_162, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i);
-CastInst* int32_164 = new PtrToIntInst(ptr_163, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i);
-BinaryOperator* int32_165 = BinaryOperator::Create(Instruction::Add, int32_164, int32_96, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i);
-CastInst* ptr_166 = new IntToPtrInst(int32_165, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i);
-std::vector<Value*> ptr_167_indices;
-ptr_167_indices.push_back(const_int32_77);
-ptr_167_indices.push_back(const_int32_77);
-Instruction* ptr_167 = GetElementPtrInst::Create(ptr_160, ptr_167_indices.begin(), ptr_167_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i);
-LoadInst* ptr_168 = new LoadInst(ptr_167, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i);
-CastInst* ptr_169 = new BitCastInst(ptr_168, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i);
-ICmpInst* int1_170 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i, ICmpInst::ICMP_UGT, ptr_166, ptr_169, "");
-BranchInst::Create(label_false_IFEQ_i_i_i_i, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i, int1_170, label_JnJVM_org_mmtk_utility_alloc_Allocator_alignAllocationNoFill__Lorg_vmmagic_unboxed_Address_2II_exit_i_i_i_i);
-
-// Block JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2.exit.i.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i)
-std::vector<Value*> ptr_172_indices;
-ptr_172_indices.push_back(const_int32_77);
-ptr_172_indices.push_back(const_int32_56);
-Instruction* ptr_172 = GetElementPtrInst::Create(ptr_160, ptr_172_indices.begin(), ptr_172_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i);
-CastInst* ptr__c_i_i_i_i = new IntToPtrInst(int32_165, PointerTy_31, ".c.i.i.i.i", label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i);
- new StoreInst(ptr__c_i_i_i_i, ptr_172, false, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i);
-BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i);
-
-// Block false IFEQ.i.i.i.i (label_false_IFEQ_i_i_i_i)
-std::vector<Value*> ptr_175_params;
-ptr_175_params.push_back(ptr_160);
-ptr_175_params.push_back(ptr_163);
-ptr_175_params.push_back(ptr_166);
-ptr_175_params.push_back(const_int32_56);
-ptr_175_params.push_back(const_int32_56);
-CallInst* ptr_175 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_BumpPointer_allocSlow__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2II, ptr_175_params.begin(), ptr_175_params.end(), "", label_false_IFEQ_i_i_i_i);
-ptr_175->setCallingConv(CallingConv::C);
-ptr_175->setTailCall(true);
-AttrListPtr ptr_175_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- ptr_175_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-ptr_175->setAttributes(ptr_175_PAL);
-
-BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_false_IFEQ_i_i_i_i);
-
-// Block tableswitch3.i.i4.i (label_tableswitch3_i_i4_i)
-std::vector<Value*> ptr_177_indices;
-ptr_177_indices.push_back(const_int32_58);
-ptr_177_indices.push_back(const_int32_77);
-Instruction* ptr_177 = GetElementPtrInst::Create(ptr_103, ptr_177_indices.begin(), ptr_177_indices.end(), "", label_tableswitch3_i_i4_i);
-CastInst* ptr_178 = new BitCastInst(ptr_177, PointerTy_32, "", label_tableswitch3_i_i4_i);
-LoadInst* ptr_179 = new LoadInst(ptr_178, "", false, label_tableswitch3_i_i4_i);
-CastInst* ptr_180 = new BitCastInst(ptr_179, PointerTy_30, "", label_tableswitch3_i_i4_i);
-std::vector<Value*> ptr_181_params;
-ptr_181_params.push_back(ptr_180);
-ptr_181_params.push_back(int32_96);
-ptr_181_params.push_back(const_int32_56);
-ptr_181_params.push_back(const_int32_56);
-CallInst* ptr_181 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III, ptr_181_params.begin(), ptr_181_params.end(), "", label_tableswitch3_i_i4_i);
-ptr_181->setCallingConv(CallingConv::C);
-ptr_181->setTailCall(true);
-AttrListPtr ptr_181_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- ptr_181_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-ptr_181->setAttributes(ptr_181_PAL);
-
-BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_tableswitch3_i_i4_i);
-
-// Block JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i5.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i)
-GetElementPtrInst* ptr_183 = GetElementPtrInst::Create(ptr_103, const_int32_54, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i);
-CastInst* ptr_184 = new BitCastInst(ptr_183, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i);
-LoadInst* ptr_185 = new LoadInst(ptr_184, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i);
-BinaryOperator* int32_186 = BinaryOperator::Create(Instruction::Add, int32_96, const_int32_63, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i);
-ICmpInst* int1_187 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i, ICmpInst::ICMP_SGT, int32_186, const_int32_64, "");
-BranchInst::Create(label_GOTO_or_IF_4_i_i_i6_i_i_i, label_false_IF_ICMPGT16_i_i_i11_i_i_i, int1_187, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i5_i_i_i);
-
-// Block GOTO or IF*4.i.i.i6.i.i.i (label_GOTO_or_IF_4_i_i_i6_i_i_i)
-ICmpInst* int1_189 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i6_i_i_i, ICmpInst::ICMP_SGT, int32_186, const_int32_65, "");
-BranchInst::Create(label_GOTO_or_IF_6_i_i_i7_i_i_i, label_false_IF_ICMPGT17_i_i_i12_i_i_i, int1_189, label_GOTO_or_IF_4_i_i_i6_i_i_i);
-
-// Block GOTO or IF*6.i.i.i7.i.i.i (label_GOTO_or_IF_6_i_i_i7_i_i_i)
-ICmpInst* int1_191 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i7_i_i_i, ICmpInst::ICMP_SGT, int32_186, const_int32_66, "");
-BranchInst::Create(label_GOTO_or_IF_7_i_i1_i8_i_i_i, label_false_IF_ICMPGT18_i_i_i13_i_i_i, int1_191, label_GOTO_or_IF_6_i_i_i7_i_i_i);
-
-// Block GOTO or IF*7.i.i1.i8.i.i.i (label_GOTO_or_IF_7_i_i1_i8_i_i_i)
-ICmpInst* int1_193 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i8_i_i_i, ICmpInst::ICMP_SGT, int32_186, const_int32_67, "");
-BranchInst::Create(label_GOTO_or_IF_8_i_i_i9_i_i_i, label_false_IF_ICMPGT19_i_i_i14_i_i_i, int1_193, label_GOTO_or_IF_7_i_i1_i8_i_i_i);
-
-// Block GOTO or IF*8.i.i.i9.i.i.i (label_GOTO_or_IF_8_i_i_i9_i_i_i)
-ICmpInst* int1_195 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i9_i_i_i, ICmpInst::ICMP_SGT, int32_186, const_int32_68, "");
-BranchInst::Create(label_GOTO_or_IF_9_i_i_i10_i_i_i, label_false_IF_ICMPGT20_i_i_i15_i_i_i, int1_195, label_GOTO_or_IF_8_i_i_i9_i_i_i);
-
-// Block GOTO or IF*9.i.i.i10.i.i.i (label_GOTO_or_IF_9_i_i_i10_i_i_i)
-BinaryOperator* int32_197 = BinaryOperator::Create(Instruction::AShr, int32_186, const_int32_69, "", label_GOTO_or_IF_9_i_i_i10_i_i_i);
-BinaryOperator* int32_198 = BinaryOperator::Create(Instruction::Add, int32_197, const_int32_70, "", label_GOTO_or_IF_9_i_i_i10_i_i_i);
-BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_GOTO_or_IF_9_i_i_i10_i_i_i);
-
-// Block false IF_ICMPGT16.i.i.i11.i.i.i (label_false_IF_ICMPGT16_i_i_i11_i_i_i)
-BinaryOperator* int32_200 = BinaryOperator::Create(Instruction::AShr, int32_186, const_int32_58, "", label_false_IF_ICMPGT16_i_i_i11_i_i_i);
-BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT16_i_i_i11_i_i_i);
-
-// Block false IF_ICMPGT17.i.i.i12.i.i.i (label_false_IF_ICMPGT17_i_i_i12_i_i_i)
-BinaryOperator* int32_202 = BinaryOperator::Create(Instruction::AShr, int32_186, const_int32_60, "", label_false_IF_ICMPGT17_i_i_i12_i_i_i);
-BinaryOperator* int32_203 = BinaryOperator::Create(Instruction::Add, int32_202, const_int32_71, "", label_false_IF_ICMPGT17_i_i_i12_i_i_i);
-BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT17_i_i_i12_i_i_i);
-
-// Block false IF_ICMPGT18.i.i.i13.i.i.i (label_false_IF_ICMPGT18_i_i_i13_i_i_i)
-BinaryOperator* int32_205 = BinaryOperator::Create(Instruction::AShr, int32_186, const_int32_72, "", label_false_IF_ICMPGT18_i_i_i13_i_i_i);
-BinaryOperator* int32_206 = BinaryOperator::Create(Instruction::Add, int32_205, const_int32_73, "", label_false_IF_ICMPGT18_i_i_i13_i_i_i);
-BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT18_i_i_i13_i_i_i);
-
-// Block false IF_ICMPGT19.i.i.i14.i.i.i (label_false_IF_ICMPGT19_i_i_i14_i_i_i)
-BinaryOperator* int32_208 = BinaryOperator::Create(Instruction::AShr, int32_186, const_int32_74, "", label_false_IF_ICMPGT19_i_i_i14_i_i_i);
-BinaryOperator* int32_209 = BinaryOperator::Create(Instruction::Add, int32_208, const_int32_75, "", label_false_IF_ICMPGT19_i_i_i14_i_i_i);
-BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT19_i_i_i14_i_i_i);
-
-// Block false IF_ICMPGT20.i.i.i15.i.i.i (label_false_IF_ICMPGT20_i_i_i15_i_i_i)
-BinaryOperator* int32_211 = BinaryOperator::Create(Instruction::AShr, int32_186, const_int32_62, "", label_false_IF_ICMPGT20_i_i_i15_i_i_i);
-BinaryOperator* int32_212 = BinaryOperator::Create(Instruction::Add, int32_211, const_int32_76, "", label_false_IF_ICMPGT20_i_i_i15_i_i_i);
-BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, label_false_IF_ICMPGT20_i_i_i15_i_i_i);
-
-// Block JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i16.i.i.i (label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i)
-PHINode* int32_214 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i);
-int32_214->reserveOperandSpace(6);
-int32_214->addIncoming(int32_200, label_false_IF_ICMPGT16_i_i_i11_i_i_i);
-int32_214->addIncoming(int32_203, label_false_IF_ICMPGT17_i_i_i12_i_i_i);
-int32_214->addIncoming(int32_206, label_false_IF_ICMPGT18_i_i_i13_i_i_i);
-int32_214->addIncoming(int32_209, label_false_IF_ICMPGT19_i_i_i14_i_i_i);
-int32_214->addIncoming(int32_212, label_false_IF_ICMPGT20_i_i_i15_i_i_i);
-int32_214->addIncoming(int32_198, label_GOTO_or_IF_9_i_i_i10_i_i_i);
-
-std::vector<Value*> ptr_215_indices;
-ptr_215_indices.push_back(const_int32_77);
-ptr_215_indices.push_back(const_int32_77);
-Instruction* ptr_215 = GetElementPtrInst::Create(ptr_185, ptr_215_indices.begin(), ptr_215_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i);
-LoadInst* ptr_216 = new LoadInst(ptr_215, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i);
-BinaryOperator* int32_217 = BinaryOperator::Create(Instruction::Add, int32_214, const_int32_77, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i);
-CastInst* ptr_218 = new BitCastInst(ptr_216, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i);
-GetElementPtrInst* ptr_219 = GetElementPtrInst::Create(ptr_218, int32_217, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i);
-LoadInst* int32_220 = new LoadInst(ptr_219, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i);
-CastInst* ptr_221 = new IntToPtrInst(int32_220, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i);
-ICmpInst* int1_222 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i, ICmpInst::ICMP_EQ, int32_220, const_int32_56, "");
-BranchInst::Create(label_GOTO_or_IF__i17_i_i_i, label_false_IFNE_i21_i_i_i, int1_222, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i16_i_i_i);
-
-// Block GOTO or IF*.i17.i.i.i (label_GOTO_or_IF__i17_i_i_i)
-std::vector<Value*> ptr_224_params;
-ptr_224_params.push_back(ptr_185);
-ptr_224_params.push_back(int32_96);
-ptr_224_params.push_back(const_int32_56);
-ptr_224_params.push_back(const_int32_56);
-CallInst* ptr_224 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_224_params.begin(), ptr_224_params.end(), "", label_GOTO_or_IF__i17_i_i_i);
-ptr_224->setCallingConv(CallingConv::C);
-ptr_224->setTailCall(true);
-AttrListPtr ptr_224_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- ptr_224_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-ptr_224->setAttributes(ptr_224_PAL);
-
-BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_GOTO_or_IF__i17_i_i_i);
-
-// Block false IFNE.i21.i.i.i (label_false_IFNE_i21_i_i_i)
-CastInst* ptr_226 = new IntToPtrInst(int32_220, PointerTy_29, "", label_false_IFNE_i21_i_i_i);
-LoadInst* ptr_227 = new LoadInst(ptr_226, "", false, label_false_IFNE_i21_i_i_i);
-CastInst* int32_228 = new PtrToIntInst(ptr_227, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i21_i_i_i);
- new StoreInst(int32_228, ptr_219, false, label_false_IFNE_i21_i_i_i);
-std::vector<Value*> ptr_230_indices;
-ptr_230_indices.push_back(const_int32_56);
-ptr_230_indices.push_back(const_int32_56);
-Instruction* ptr_230 = GetElementPtrInst::Create(ptr_221, ptr_230_indices.begin(), ptr_230_indices.end(), "", label_false_IFNE_i21_i_i_i);
- new StoreInst(const_ptr_78, ptr_230, false, label_false_IFNE_i21_i_i_i);
-BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_false_IFNE_i21_i_i_i);
-
-// Block tableswitch5.i.i6.i (label_tableswitch5_i_i6_i)
-std::vector<Value*> ptr_233_indices;
-ptr_233_indices.push_back(const_int32_54);
-ptr_233_indices.push_back(const_int32_77);
-Instruction* ptr_233 = GetElementPtrInst::Create(ptr_103, ptr_233_indices.begin(), ptr_233_indices.end(), "", label_tableswitch5_i_i6_i);
-CastInst* ptr_234 = new BitCastInst(ptr_233, PointerTy_32, "", label_tableswitch5_i_i6_i);
-LoadInst* ptr_235 = new LoadInst(ptr_234, "", false, label_tableswitch5_i_i6_i);
-CastInst* ptr_236 = new BitCastInst(ptr_235, PointerTy_30, "", label_tableswitch5_i_i6_i);
-std::vector<Value*> ptr_237_params;
-ptr_237_params.push_back(ptr_236);
-ptr_237_params.push_back(int32_96);
-ptr_237_params.push_back(const_int32_56);
-ptr_237_params.push_back(const_int32_56);
-CallInst* ptr_237 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_LargeObjectAllocator_alloc__III, ptr_237_params.begin(), ptr_237_params.end(), "", label_tableswitch5_i_i6_i);
-ptr_237->setCallingConv(CallingConv::C);
-ptr_237->setTailCall(true);
-AttrListPtr ptr_237_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- ptr_237_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-ptr_237->setAttributes(ptr_237_PAL);
-
-BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_tableswitch5_i_i6_i);
-
-// Block JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II.exit.i.i.i (label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i)
-std::vector<Value*> ptr_239_indices;
-ptr_239_indices.push_back(const_int32_60);
-ptr_239_indices.push_back(const_int32_77);
-Instruction* ptr_239 = GetElementPtrInst::Create(ptr_103, ptr_239_indices.begin(), ptr_239_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i);
-CastInst* ptr_240 = new BitCastInst(ptr_239, PointerTy_32, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i);
-LoadInst* ptr_241 = new LoadInst(ptr_240, "", false, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i);
-CastInst* ptr_242 = new BitCastInst(ptr_241, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i);
-BinaryOperator* int32_243 = BinaryOperator::Create(Instruction::Add, int32_96, const_int32_63, "", label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i);
-ICmpInst* int1_244 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i, ICmpInst::ICMP_SGT, int32_243, const_int32_64, "");
-BranchInst::Create(label_GOTO_or_IF_4_i_i_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i, int1_244, label_JnJVM_org_mmtk_utility_alloc_Allocator_getMaximumAlignedSize__II_exit_i_i_i);
-
-// Block GOTO or IF*4.i.i.i.i.i (label_GOTO_or_IF_4_i_i_i_i_i)
-ICmpInst* int1_246 = new ICmpInst(*label_GOTO_or_IF_4_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_243, const_int32_65, "");
-BranchInst::Create(label_GOTO_or_IF_6_i_i_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i, int1_246, label_GOTO_or_IF_4_i_i_i_i_i);
-
-// Block GOTO or IF*6.i.i.i.i.i (label_GOTO_or_IF_6_i_i_i_i_i)
-ICmpInst* int1_248 = new ICmpInst(*label_GOTO_or_IF_6_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_243, const_int32_66, "");
-BranchInst::Create(label_GOTO_or_IF_7_i_i1_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i, int1_248, label_GOTO_or_IF_6_i_i_i_i_i);
-
-// Block GOTO or IF*7.i.i1.i.i.i (label_GOTO_or_IF_7_i_i1_i_i_i)
-ICmpInst* int1_250 = new ICmpInst(*label_GOTO_or_IF_7_i_i1_i_i_i, ICmpInst::ICMP_SGT, int32_243, const_int32_67, "");
-BranchInst::Create(label_GOTO_or_IF_8_i_i_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i, int1_250, label_GOTO_or_IF_7_i_i1_i_i_i);
-
-// Block GOTO or IF*8.i.i.i.i.i (label_GOTO_or_IF_8_i_i_i_i_i)
-ICmpInst* int1_252 = new ICmpInst(*label_GOTO_or_IF_8_i_i_i_i_i, ICmpInst::ICMP_SGT, int32_243, const_int32_68, "");
-BranchInst::Create(label_GOTO_or_IF_9_i_i_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i, int1_252, label_GOTO_or_IF_8_i_i_i_i_i);
-
-// Block GOTO or IF*9.i.i.i.i.i (label_GOTO_or_IF_9_i_i_i_i_i)
-BinaryOperator* int32_254 = BinaryOperator::Create(Instruction::AShr, int32_243, const_int32_69, "", label_GOTO_or_IF_9_i_i_i_i_i);
-BinaryOperator* int32_255 = BinaryOperator::Create(Instruction::Add, int32_254, const_int32_70, "", label_GOTO_or_IF_9_i_i_i_i_i);
-BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, label_GOTO_or_IF_9_i_i_i_i_i);
-
-// Block false IF_ICMPGT16.i.i.i.i.i (label_false_IF_ICMPGT16_i_i_i_i_i)
-BinaryOperator* int32_257 = BinaryOperator::Create(Instruction::AShr, int32_243, const_int32_58, "", label_false_IF_ICMPGT16_i_i_i_i_i);
-BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, label_false_IF_ICMPGT16_i_i_i_i_i);
-
-// Block false IF_ICMPGT17.i.i.i.i.i (label_false_IF_ICMPGT17_i_i_i_i_i)
-BinaryOperator* int32_259 = BinaryOperator::Create(Instruction::AShr, int32_243, const_int32_60, "", label_false_IF_ICMPGT17_i_i_i_i_i);
-BinaryOperator* int32_260 = BinaryOperator::Create(Instruction::Add, int32_259, const_int32_71, "", label_false_IF_ICMPGT17_i_i_i_i_i);
-BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, label_false_IF_ICMPGT17_i_i_i_i_i);
-
-// Block false IF_ICMPGT18.i.i.i.i.i (label_false_IF_ICMPGT18_i_i_i_i_i)
-BinaryOperator* int32_262 = BinaryOperator::Create(Instruction::AShr, int32_243, const_int32_72, "", label_false_IF_ICMPGT18_i_i_i_i_i);
-BinaryOperator* int32_263 = BinaryOperator::Create(Instruction::Add, int32_262, const_int32_73, "", label_false_IF_ICMPGT18_i_i_i_i_i);
-BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, label_false_IF_ICMPGT18_i_i_i_i_i);
-
-// Block false IF_ICMPGT19.i.i.i.i.i (label_false_IF_ICMPGT19_i_i_i_i_i)
-BinaryOperator* int32_265 = BinaryOperator::Create(Instruction::AShr, int32_243, const_int32_74, "", label_false_IF_ICMPGT19_i_i_i_i_i);
-BinaryOperator* int32_266 = BinaryOperator::Create(Instruction::Add, int32_265, const_int32_75, "", label_false_IF_ICMPGT19_i_i_i_i_i);
-BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, label_false_IF_ICMPGT19_i_i_i_i_i);
-
-// Block false IF_ICMPGT20.i.i.i.i.i (label_false_IF_ICMPGT20_i_i_i_i_i)
-BinaryOperator* int32_268 = BinaryOperator::Create(Instruction::AShr, int32_243, const_int32_62, "", label_false_IF_ICMPGT20_i_i_i_i_i);
-BinaryOperator* int32_269 = BinaryOperator::Create(Instruction::Add, int32_268, const_int32_76, "", label_false_IF_ICMPGT20_i_i_i_i_i);
-BranchInst::Create(label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, label_false_IF_ICMPGT20_i_i_i_i_i);
-
-// Block JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I.exit.i.i.i (label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i)
-PHINode* int32_271 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i);
-int32_271->reserveOperandSpace(6);
-int32_271->addIncoming(int32_257, label_false_IF_ICMPGT16_i_i_i_i_i);
-int32_271->addIncoming(int32_260, label_false_IF_ICMPGT17_i_i_i_i_i);
-int32_271->addIncoming(int32_263, label_false_IF_ICMPGT18_i_i_i_i_i);
-int32_271->addIncoming(int32_266, label_false_IF_ICMPGT19_i_i_i_i_i);
-int32_271->addIncoming(int32_269, label_false_IF_ICMPGT20_i_i_i_i_i);
-int32_271->addIncoming(int32_255, label_GOTO_or_IF_9_i_i_i_i_i);
-
-GetElementPtrInst* ptr_272 = GetElementPtrInst::Create(ptr_241, const_int32_71, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i);
-CastInst* ptr_273 = new BitCastInst(ptr_272, PointerTy_32, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i);
-LoadInst* ptr_274 = new LoadInst(ptr_273, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i);
-BinaryOperator* int32_275 = BinaryOperator::Create(Instruction::Add, int32_271, const_int32_77, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i);
-CastInst* ptr_276 = new BitCastInst(ptr_274, PointerTy_25, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i);
-GetElementPtrInst* ptr_277 = GetElementPtrInst::Create(ptr_276, int32_275, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i);
-LoadInst* int32_278 = new LoadInst(ptr_277, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i);
-CastInst* ptr_279 = new IntToPtrInst(int32_278, PointerTy_30, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i);
-ICmpInst* int1_280 = new ICmpInst(*label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i, ICmpInst::ICMP_EQ, int32_278, const_int32_56, "");
-BranchInst::Create(label_GOTO_or_IF__i_i_i, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i, int1_280, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_getSizeClass__I_exit_i_i_i);
-
-// Block GOTO or IF*.i.i.i (label_GOTO_or_IF__i_i_i)
-std::vector<Value*> ptr_282_params;
-ptr_282_params.push_back(ptr_242);
-ptr_282_params.push_back(int32_96);
-ptr_282_params.push_back(const_int32_56);
-ptr_282_params.push_back(const_int32_56);
-CallInst* ptr_282 = CallInst::Create(func_JnJVM_org_mmtk_utility_alloc_Allocator_allocSlow__III, ptr_282_params.begin(), ptr_282_params.end(), "", label_GOTO_or_IF__i_i_i);
-ptr_282->setCallingConv(CallingConv::C);
-ptr_282->setTailCall(true);
-AttrListPtr ptr_282_PAL;
+BinaryOperator* int32_10 = BinaryOperator::Create(Instruction::Add, int32_sz, const_int32_8, "", label_entry);
+BinaryOperator* int32_11 = BinaryOperator::Create(Instruction::And, int32_10, const_int32_9, "", label_entry);
+CastInst* ptr_tmp = new BitCastInst(ptr_VT, PointerTy_2, "tmp", label_entry);
+std::vector<Value*> ptr_12_params;
+ptr_12_params.push_back(int32_11);
+ptr_12_params.push_back(ptr_tmp);
+CallInst* ptr_12 = CallInst::Create(func_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2, ptr_12_params.begin(), ptr_12_params.end(), "", label_entry);
+ptr_12->setCallingConv(CallingConv::C);
+ptr_12->setTailCall(true);
+AttrListPtr ptr_12_PAL;
{
SmallVector<AttributeWithIndex, 4> Attrs;
AttributeWithIndex PAWI;
PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
Attrs.push_back(PAWI);
- ptr_282_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
+ ptr_12_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
}
-ptr_282->setAttributes(ptr_282_PAL);
-
-BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_GOTO_or_IF__i_i_i);
-
-// Block JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III.exit.i.i (label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i)
-CastInst* ptr_284 = new IntToPtrInst(int32_278, PointerTy_29, "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i);
-LoadInst* ptr_285 = new LoadInst(ptr_284, "", false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i);
-CastInst* int32_286 = new PtrToIntInst(ptr_285, IntegerType::get(mod->getContext(), 32), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i);
- new StoreInst(int32_286, ptr_277, false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i);
-std::vector<Value*> ptr_288_indices;
-ptr_288_indices.push_back(const_int32_56);
-ptr_288_indices.push_back(const_int32_56);
-Instruction* ptr_288 = GetElementPtrInst::Create(ptr_279, ptr_288_indices.begin(), ptr_288_indices.end(), "", label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i);
- new StoreInst(const_ptr_78, ptr_288, false, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i);
-BranchInst::Create(label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i);
-
-// Block JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII.exit.i (label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i)
-PHINode* ptr_291 = PHINode::Create(PointerTy_30, "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i);
-ptr_291->reserveOperandSpace(10);
-ptr_291->addIncoming(ptr_237, label_tableswitch5_i_i6_i);
-ptr_291->addIncoming(ptr_224, label_GOTO_or_IF__i17_i_i_i);
-ptr_291->addIncoming(ptr_181, label_tableswitch3_i_i4_i);
-ptr_291->addIncoming(ptr_163, label_JnJVM_org_mmtk_utility_alloc_Allocator_fillAlignmentGap__Lorg_vmmagic_unboxed_Address_2Lorg_vmmagic_unboxed_Address_2_exit_i_i_i_i);
-ptr_291->addIncoming(ptr_175, label_false_IFEQ_i_i_i_i);
-ptr_291->addIncoming(ptr_149, label_GOTO_or_IF__i_i_i_i);
-ptr_291->addIncoming(ptr_279, label_JnJVM_org_mmtk_utility_alloc_SegregatedFreeList_alloc__III_exit_i_i);
-ptr_291->addIncoming(ptr_282, label_GOTO_or_IF__i_i_i);
-ptr_291->addIncoming(ptr_146, label_false_IFNE_i_i_i_i);
-ptr_291->addIncoming(ptr_221, label_false_IFNE_i21_i_i_i);
-
-std::vector<Value*> ptr_292_indices;
-ptr_292_indices.push_back(const_int32_56);
-ptr_292_indices.push_back(const_int32_56);
-Instruction* ptr_292 = GetElementPtrInst::Create(ptr_291, ptr_292_indices.begin(), ptr_292_indices.end(), "", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i);
-CastInst* ptr__c_i = new BitCastInst(ptr_VT, PointerTy_31, ".c.i", label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i);
- new StoreInst(ptr__c_i, ptr_292, false, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i);
-SwitchInst* void_294 = SwitchInst::Create(int32_storemerge_i_i, label_tableswitch_i_i_i, 7, label_JnJVM_org_mmtk_plan_marksweep_MSMutator_alloc__IIIII_exit_i);
-void_294->addCase(const_int32_56, label_false_IFNE_i_i);
-void_294->addCase(const_int32_58, label_tableswitch1_i_i_i);
-void_294->addCase(const_int32_54, label_tableswitch2_i_i_i);
-void_294->addCase(const_int32_60, label_tableswitch3_i_i_i);
-void_294->addCase(const_int32_61, label_tableswitch4_i_i_i);
-void_294->addCase(const_int32_62, label_tableswitch5_i_i_i);
-
-
-// Block tableswitch.i.i.i (label_tableswitch_i_i_i)
-CallInst* void_295 = CallInst::Create(func_abort, "", label_tableswitch_i_i_i);
-void_295->setCallingConv(CallingConv::C);
-void_295->setTailCall(true);
-AttrListPtr void_295_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoReturn | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- void_295_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-void_295->setAttributes(void_295_PAL);
-
-new UnreachableInst(mod->getContext(), label_tableswitch_i_i_i);
-
-// Block tableswitch1.i.i.i (label_tableswitch1_i_i_i)
-std::vector<Value*> ptr_297_indices;
-ptr_297_indices.push_back(const_int32_56);
-ptr_297_indices.push_back(const_int32_77);
-Instruction* ptr_297 = GetElementPtrInst::Create(ptr_291, ptr_297_indices.begin(), ptr_297_indices.end(), "", label_tableswitch1_i_i_i);
-CastInst* ptr_298 = new BitCastInst(ptr_297, PointerTy_25, "", label_tableswitch1_i_i_i);
-LoadInst* int32_299 = new LoadInst(ptr_298, "", false, label_tableswitch1_i_i_i);
-BinaryOperator* int32_300 = BinaryOperator::Create(Instruction::And, int32_299, const_int32_79, "", label_tableswitch1_i_i_i);
-LoadInst* ptr_301 = new LoadInst(const_ptr_80, "", false, label_tableswitch1_i_i_i);
-CastInst* int32_302 = new PtrToIntInst(ptr_301, IntegerType::get(mod->getContext(), 32), "", label_tableswitch1_i_i_i);
-BinaryOperator* int32_303 = BinaryOperator::Create(Instruction::Or, int32_302, int32_300, "", label_tableswitch1_i_i_i);
-CastInst* ptr__c5 = new IntToPtrInst(int32_303, PointerTy_0, ".c5", label_tableswitch1_i_i_i);
- new StoreInst(ptr__c5, ptr_297, false, label_tableswitch1_i_i_i);
-BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_tableswitch1_i_i_i);
-
-// Block tableswitch2.i.i.i (label_tableswitch2_i_i_i)
-std::vector<Value*> ptr_306_indices;
-ptr_306_indices.push_back(const_int32_56);
-ptr_306_indices.push_back(const_int32_77);
-Instruction* ptr_306 = GetElementPtrInst::Create(ptr_291, ptr_306_indices.begin(), ptr_306_indices.end(), "", label_tableswitch2_i_i_i);
-CastInst* ptr_307 = new BitCastInst(ptr_306, PointerTy_25, "", label_tableswitch2_i_i_i);
-LoadInst* int32_308 = new LoadInst(ptr_307, "", false, label_tableswitch2_i_i_i);
-BinaryOperator* int32_309 = BinaryOperator::Create(Instruction::And, int32_308, const_int32_81, "", label_tableswitch2_i_i_i);
-LoadInst* ptr_310 = new LoadInst(const_ptr_82, "", false, label_tableswitch2_i_i_i);
-CastInst* int32_311 = new PtrToIntInst(ptr_310, IntegerType::get(mod->getContext(), 32), "", label_tableswitch2_i_i_i);
-BinaryOperator* int32_312 = BinaryOperator::Create(Instruction::Or, int32_311, int32_309, "", label_tableswitch2_i_i_i);
-CastInst* ptr__c4 = new IntToPtrInst(int32_312, PointerTy_0, ".c4", label_tableswitch2_i_i_i);
- new StoreInst(ptr__c4, ptr_306, false, label_tableswitch2_i_i_i);
-BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_tableswitch2_i_i_i);
-
-// Block tableswitch3.i.i.i (label_tableswitch3_i_i_i)
-std::vector<Value*> ptr_315_indices;
-ptr_315_indices.push_back(const_int32_56);
-ptr_315_indices.push_back(const_int32_77);
-Instruction* ptr_315 = GetElementPtrInst::Create(ptr_291, ptr_315_indices.begin(), ptr_315_indices.end(), "", label_tableswitch3_i_i_i);
-CastInst* ptr_316 = new BitCastInst(ptr_315, PointerTy_25, "", label_tableswitch3_i_i_i);
-LoadInst* int32_317 = new LoadInst(ptr_316, "", false, label_tableswitch3_i_i_i);
-BinaryOperator* int32_318 = BinaryOperator::Create(Instruction::And, int32_317, const_int32_55, "", label_tableswitch3_i_i_i);
-LoadInst* ptr_319 = new LoadInst(const_ptr_83, "", false, label_tableswitch3_i_i_i);
-CastInst* int32_320 = new PtrToIntInst(ptr_319, IntegerType::get(mod->getContext(), 32), "", label_tableswitch3_i_i_i);
-BinaryOperator* int32_321 = BinaryOperator::Create(Instruction::Or, int32_318, const_int32_58, "", label_tableswitch3_i_i_i);
-BinaryOperator* int32_322 = BinaryOperator::Create(Instruction::Or, int32_321, int32_320, "", label_tableswitch3_i_i_i);
-CastInst* ptr__c3 = new IntToPtrInst(int32_322, PointerTy_0, ".c3", label_tableswitch3_i_i_i);
- new StoreInst(ptr__c3, ptr_315, false, label_tableswitch3_i_i_i);
-LoadInst* ptr_324 = new LoadInst(const_ptr_84, "", false, label_tableswitch3_i_i_i);
-CastInst* int32_325 = new PtrToIntInst(ptr_291, IntegerType::get(mod->getContext(), 32), "", label_tableswitch3_i_i_i);
-BinaryOperator* int32_326 = BinaryOperator::Create(Instruction::And, int32_325, const_int32_85, "", label_tableswitch3_i_i_i);
-CastInst* ptr_327 = new IntToPtrInst(int32_326, PointerTy_30, "", label_tableswitch3_i_i_i);
-std::vector<Value*> ptr_328_indices;
-ptr_328_indices.push_back(const_int32_58);
-ptr_328_indices.push_back(const_int32_77);
-Instruction* ptr_328 = GetElementPtrInst::Create(ptr_324, ptr_328_indices.begin(), ptr_328_indices.end(), "", label_tableswitch3_i_i_i);
-LoadInst* ptr_329 = new LoadInst(ptr_328, "", false, label_tableswitch3_i_i_i);
-GetElementPtrInst* ptr_330 = GetElementPtrInst::Create(ptr_329, const_int32_71, "", label_tableswitch3_i_i_i);
-CastInst* ptr_331 = new BitCastInst(ptr_330, PointerTy_32, "", label_tableswitch3_i_i_i);
-LoadInst* ptr_332 = new LoadInst(ptr_331, "", false, label_tableswitch3_i_i_i);
-ICmpInst* int1_333 = new ICmpInst(*label_tableswitch3_i_i_i, ICmpInst::ICMP_EQ, ptr_332, const_ptr_86, "");
-BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_true_IFNULL_i5_i_i_i_i_i, int1_333, label_tableswitch3_i_i_i);
-
-// Block true IF*NULL.i1.i.i.i.i.i (label_true_IF_NULL_i1_i_i_i_i_i)
-std::vector<Value*> ptr_335_indices;
-ptr_335_indices.push_back(const_int32_56);
-ptr_335_indices.push_back(const_int32_56);
-Instruction* ptr_335 = GetElementPtrInst::Create(ptr_327, ptr_335_indices.begin(), ptr_335_indices.end(), "", label_true_IF_NULL_i1_i_i_i_i_i);
- new StoreInst(const_ptr_78, ptr_335, false, label_true_IF_NULL_i1_i_i_i_i_i);
-GetElementPtrInst* ptr_337 = GetElementPtrInst::Create(ptr_329, const_int32_62, "", label_true_IF_NULL_i1_i_i_i_i_i);
-CastInst* ptr_338 = new BitCastInst(ptr_337, PointerTy_29, "", label_true_IF_NULL_i1_i_i_i_i_i);
-LoadInst* ptr_339 = new LoadInst(ptr_338, "", false, label_true_IF_NULL_i1_i_i_i_i_i);
-LoadInst* ptr_340 = new LoadInst(const_ptr_87, "", false, label_true_IF_NULL_i1_i_i_i_i_i);
-CastInst* int32_341 = new PtrToIntInst(ptr_340, IntegerType::get(mod->getContext(), 32), "", label_true_IF_NULL_i1_i_i_i_i_i);
-BinaryOperator* int32_342 = BinaryOperator::Create(Instruction::Add, int32_341, int32_326, "", label_true_IF_NULL_i1_i_i_i_i_i);
-CastInst* ptr_343 = new IntToPtrInst(int32_342, PointerTy_29, "", label_true_IF_NULL_i1_i_i_i_i_i);
- new StoreInst(ptr_339, ptr_343, false, label_true_IF_NULL_i1_i_i_i_i_i);
-LoadInst* ptr_345 = new LoadInst(ptr_338, "", false, label_true_IF_NULL_i1_i_i_i_i_i);
-ICmpInst* int1_346 = new ICmpInst(*label_true_IF_NULL_i1_i_i_i_i_i, ICmpInst::ICMP_EQ, ptr_345, const_ptr_88, "");
-BranchInst::Create(label_GOTO_or_IF_1_i3_i_i_i_i_i, label_false_IFNE_i7_i_i_i_i_i, int1_346, label_true_IF_NULL_i1_i_i_i_i_i);
-
-// Block GOTO or IF*1.i3.i.i.i.i.i (label_GOTO_or_IF_1_i3_i_i_i_i_i)
-CastInst* ptr_348 = new BitCastInst(ptr_337, PointerTy_35, "", label_GOTO_or_IF_1_i3_i_i_i_i_i);
-CastInst* ptr__c1_i2_i_i_i_i_i = new IntToPtrInst(int32_326, PointerTy_31, ".c1.i2.i.i.i.i.i", label_GOTO_or_IF_1_i3_i_i_i_i_i);
- new StoreInst(ptr__c1_i2_i_i_i_i_i, ptr_348, false, label_GOTO_or_IF_1_i3_i_i_i_i_i);
-LoadInst* ptr_350 = new LoadInst(ptr_331, "", false, label_GOTO_or_IF_1_i3_i_i_i_i_i);
-ICmpInst* int1_351 = new ICmpInst(*label_GOTO_or_IF_1_i3_i_i_i_i_i, ICmpInst::ICMP_EQ, ptr_350, const_ptr_86, "");
-BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i8_i_i_i_i_i, int1_351, label_GOTO_or_IF_1_i3_i_i_i_i_i);
-
-// Block true IFNULL.i5.i.i.i.i.i (label_true_IFNULL_i5_i_i_i_i_i)
-GetElementPtrInst* ptr_353 = GetElementPtrInst::Create(ptr_332, const_int32_62, "", label_true_IFNULL_i5_i_i_i_i_i);
-CastInst* ptr_354 = new BitCastInst(ptr_353, PointerTy_25, "", label_true_IFNULL_i5_i_i_i_i_i);
-BranchInst::Create(label_bb2_i_i36_i, label_true_IFNULL_i5_i_i_i_i_i);
-
-// Block bb.i.i34.i (label_bb_i_i34_i)
-Argument* fwdref_357 = new Argument(IntegerType::get(mod->getContext(), 1));
-BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_bb1_i_i35_i, fwdref_357, label_bb_i_i34_i);
-
-// Block bb1.i.i35.i (label_bb1_i_i35_i)
-Argument* fwdref_359 = new Argument(IntegerType::get(mod->getContext(), 32));
-BinaryOperator* int32_358 = BinaryOperator::Create(Instruction::Add, fwdref_359, const_int32_77, "", label_bb1_i_i35_i);
-BranchInst::Create(label_bb2_i_i36_i, label_bb1_i_i35_i);
-
-// Block bb2.i.i36.i (label_bb2_i_i36_i)
-PHINode* int32_361 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_bb2_i_i36_i);
-int32_361->reserveOperandSpace(2);
-int32_361->addIncoming(const_int32_56, label_true_IFNULL_i5_i_i_i_i_i);
-int32_361->addIncoming(int32_358, label_bb1_i_i35_i);
-
-ICmpInst* int1_362 = new ICmpInst(*label_bb2_i_i36_i, ICmpInst::ICMP_ULT, int32_361, const_int32_89, "");
-std::vector<Value*> void_363_params;
-void_363_params.push_back(const_int1_90);
-void_363_params.push_back(const_int1_90);
-void_363_params.push_back(const_int1_90);
-void_363_params.push_back(const_int1_90);
-void_363_params.push_back(const_int1_90);
-CallInst* void_363 = CallInst::Create(func_llvm_memory_barrier, void_363_params.begin(), void_363_params.end(), "", label_bb2_i_i36_i);
-void_363->setCallingConv(CallingConv::C);
-void_363->setTailCall(true);
-AttrListPtr void_363_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- void_363_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-void_363->setAttributes(void_363_PAL);
-
-std::vector<Value*> int32_364_params;
-int32_364_params.push_back(ptr_354);
-int32_364_params.push_back(const_int32_56);
-int32_364_params.push_back(const_int32_77);
-CallInst* int32_364 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_364_params.begin(), int32_364_params.end(), "", label_bb2_i_i36_i);
-int32_364->setCallingConv(CallingConv::C);
-int32_364->setTailCall(true);
-AttrListPtr int32_364_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- int32_364_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-int32_364->setAttributes(int32_364_PAL);
-
-std::vector<Value*> void_365_params;
-void_365_params.push_back(const_int1_90);
-void_365_params.push_back(const_int1_90);
-void_365_params.push_back(const_int1_90);
-void_365_params.push_back(const_int1_90);
-void_365_params.push_back(const_int1_90);
-CallInst* void_365 = CallInst::Create(func_llvm_memory_barrier, void_365_params.begin(), void_365_params.end(), "", label_bb2_i_i36_i);
-void_365->setCallingConv(CallingConv::C);
-void_365->setTailCall(true);
-AttrListPtr void_365_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- void_365_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-void_365->setAttributes(void_365_PAL);
-
-ICmpInst* int1_366 = new ICmpInst(*label_bb2_i_i36_i, ICmpInst::ICMP_EQ, int32_364, const_int32_56, "");
-BranchInst::Create(label_bb_i_i34_i, label_bb4_preheader_i_i37_i, int1_362, label_bb2_i_i36_i);
-
-// Block bb4.preheader.i.i37.i (label_bb4_preheader_i_i37_i)
-BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_bb3_i_i38_i, int1_366, label_bb4_preheader_i_i37_i);
-
-// Block bb3.i.i38.i (label_bb3_i_i38_i)
-CallInst* void_369 = CallInst::Create(func__ZN3mvm6Thread5yieldEv, "", label_bb3_i_i38_i);
-void_369->setCallingConv(CallingConv::C);
-void_369->setTailCall(true);
-AttrListPtr void_369_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- void_369_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-void_369->setAttributes(void_369_PAL);
-
-std::vector<Value*> void_370_params;
-void_370_params.push_back(const_int1_90);
-void_370_params.push_back(const_int1_90);
-void_370_params.push_back(const_int1_90);
-void_370_params.push_back(const_int1_90);
-void_370_params.push_back(const_int1_90);
-CallInst* void_370 = CallInst::Create(func_llvm_memory_barrier, void_370_params.begin(), void_370_params.end(), "", label_bb3_i_i38_i);
-void_370->setCallingConv(CallingConv::C);
-void_370->setTailCall(true);
-AttrListPtr void_370_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- void_370_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-void_370->setAttributes(void_370_PAL);
-
-std::vector<Value*> int32_371_params;
-int32_371_params.push_back(ptr_354);
-int32_371_params.push_back(const_int32_56);
-int32_371_params.push_back(const_int32_77);
-CallInst* int32_371 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_371_params.begin(), int32_371_params.end(), "", label_bb3_i_i38_i);
-int32_371->setCallingConv(CallingConv::C);
-int32_371->setTailCall(true);
-AttrListPtr int32_371_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- int32_371_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-int32_371->setAttributes(int32_371_PAL);
-
-std::vector<Value*> void_372_params;
-void_372_params.push_back(const_int1_90);
-void_372_params.push_back(const_int1_90);
-void_372_params.push_back(const_int1_90);
-void_372_params.push_back(const_int1_90);
-void_372_params.push_back(const_int1_90);
-CallInst* void_372 = CallInst::Create(func_llvm_memory_barrier, void_372_params.begin(), void_372_params.end(), "", label_bb3_i_i38_i);
-void_372->setCallingConv(CallingConv::C);
-void_372->setTailCall(true);
-AttrListPtr void_372_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- void_372_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-void_372->setAttributes(void_372_PAL);
-
-ICmpInst* int1_373 = new ICmpInst(*label_bb3_i_i38_i, ICmpInst::ICMP_EQ, int32_371, const_int32_56, "");
-BranchInst::Create(label_true_IF_NULL_i1_i_i_i_i_i, label_bb3_i_i38_i, int1_373, label_bb3_i_i38_i);
-
-// Block false IFNE.i7.i.i.i.i.i (label_false_IFNE_i7_i_i_i_i_i)
-std::vector<Value*> ptr_375_indices;
-ptr_375_indices.push_back(const_int32_56);
-ptr_375_indices.push_back(const_int32_56);
-Instruction* ptr_375 = GetElementPtrInst::Create(ptr_345, ptr_375_indices.begin(), ptr_375_indices.end(), "", label_false_IFNE_i7_i_i_i_i_i);
-CastInst* ptr__c_i6_i_i_i_i_i = new IntToPtrInst(int32_326, PointerTy_31, ".c.i6.i.i.i.i.i", label_false_IFNE_i7_i_i_i_i_i);
- new StoreInst(ptr__c_i6_i_i_i_i_i, ptr_375, false, label_false_IFNE_i7_i_i_i_i_i);
-BranchInst::Create(label_GOTO_or_IF_1_i3_i_i_i_i_i, label_false_IFNE_i7_i_i_i_i_i);
-
-// Block true IFNULL3.i8.i.i.i.i.i (label_true_IFNULL3_i8_i_i_i_i_i)
-GetElementPtrInst* ptr_378 = GetElementPtrInst::Create(ptr_350, const_int32_62, "", label_true_IFNULL3_i8_i_i_i_i_i);
-CastInst* ptr_379 = new BitCastInst(ptr_378, PointerTy_25, "", label_true_IFNULL3_i8_i_i_i_i_i);
- new StoreInst(const_int32_56, ptr_379, false, label_true_IFNULL3_i8_i_i_i_i_i);
-BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i8_i_i_i_i_i);
-
-// Block tableswitch4.i.i.i (label_tableswitch4_i_i_i)
-std::vector<Value*> ptr_382_indices;
-ptr_382_indices.push_back(const_int32_56);
-ptr_382_indices.push_back(const_int32_77);
-Instruction* ptr_382 = GetElementPtrInst::Create(ptr_291, ptr_382_indices.begin(), ptr_382_indices.end(), "", label_tableswitch4_i_i_i);
-CastInst* ptr_383 = new BitCastInst(ptr_382, PointerTy_25, "", label_tableswitch4_i_i_i);
-LoadInst* int32_384 = new LoadInst(ptr_383, "", false, label_tableswitch4_i_i_i);
-BinaryOperator* int32_385 = BinaryOperator::Create(Instruction::And, int32_384, const_int32_79, "", label_tableswitch4_i_i_i);
-LoadInst* ptr_386 = new LoadInst(const_ptr_91, "", false, label_tableswitch4_i_i_i);
-CastInst* int32_387 = new PtrToIntInst(ptr_386, IntegerType::get(mod->getContext(), 32), "", label_tableswitch4_i_i_i);
-BinaryOperator* int32_388 = BinaryOperator::Create(Instruction::Or, int32_387, int32_385, "", label_tableswitch4_i_i_i);
-CastInst* ptr__c2 = new IntToPtrInst(int32_388, PointerTy_0, ".c2", label_tableswitch4_i_i_i);
- new StoreInst(ptr__c2, ptr_382, false, label_tableswitch4_i_i_i);
-BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_tableswitch4_i_i_i);
-
-// Block tableswitch5.i.i.i (label_tableswitch5_i_i_i)
-std::vector<Value*> ptr_391_indices;
-ptr_391_indices.push_back(const_int32_56);
-ptr_391_indices.push_back(const_int32_77);
-Instruction* ptr_391 = GetElementPtrInst::Create(ptr_291, ptr_391_indices.begin(), ptr_391_indices.end(), "", label_tableswitch5_i_i_i);
-CastInst* ptr_392 = new BitCastInst(ptr_391, PointerTy_25, "", label_tableswitch5_i_i_i);
-LoadInst* int32_393 = new LoadInst(ptr_392, "", false, label_tableswitch5_i_i_i);
-BinaryOperator* int32_394 = BinaryOperator::Create(Instruction::And, int32_393, const_int32_55, "", label_tableswitch5_i_i_i);
-LoadInst* ptr_395 = new LoadInst(const_ptr_92, "", false, label_tableswitch5_i_i_i);
-CastInst* int32_396 = new PtrToIntInst(ptr_395, IntegerType::get(mod->getContext(), 32), "", label_tableswitch5_i_i_i);
-BinaryOperator* int32_397 = BinaryOperator::Create(Instruction::Or, int32_394, const_int32_58, "", label_tableswitch5_i_i_i);
-BinaryOperator* int32_398 = BinaryOperator::Create(Instruction::Or, int32_397, int32_396, "", label_tableswitch5_i_i_i);
-CastInst* ptr__c = new IntToPtrInst(int32_398, PointerTy_0, ".c", label_tableswitch5_i_i_i);
- new StoreInst(ptr__c, ptr_391, false, label_tableswitch5_i_i_i);
-LoadInst* ptr_400 = new LoadInst(const_ptr_93, "", false, label_tableswitch5_i_i_i);
-CastInst* int32_401 = new PtrToIntInst(ptr_291, IntegerType::get(mod->getContext(), 32), "", label_tableswitch5_i_i_i);
-BinaryOperator* int32_402 = BinaryOperator::Create(Instruction::And, int32_401, const_int32_85, "", label_tableswitch5_i_i_i);
-CastInst* ptr_403 = new IntToPtrInst(int32_402, PointerTy_30, "", label_tableswitch5_i_i_i);
-std::vector<Value*> ptr_404_indices;
-ptr_404_indices.push_back(const_int32_58);
-ptr_404_indices.push_back(const_int32_77);
-Instruction* ptr_404 = GetElementPtrInst::Create(ptr_400, ptr_404_indices.begin(), ptr_404_indices.end(), "", label_tableswitch5_i_i_i);
-LoadInst* ptr_405 = new LoadInst(ptr_404, "", false, label_tableswitch5_i_i_i);
-GetElementPtrInst* ptr_406 = GetElementPtrInst::Create(ptr_405, const_int32_71, "", label_tableswitch5_i_i_i);
-CastInst* ptr_407 = new BitCastInst(ptr_406, PointerTy_32, "", label_tableswitch5_i_i_i);
-LoadInst* ptr_408 = new LoadInst(ptr_407, "", false, label_tableswitch5_i_i_i);
-ICmpInst* int1_409 = new ICmpInst(*label_tableswitch5_i_i_i, ICmpInst::ICMP_EQ, ptr_408, const_ptr_86, "");
-BranchInst::Create(label_true_IF_NULL_i1_i_i3_i_i_i, label_true_IFNULL_i5_i_i6_i_i_i, int1_409, label_tableswitch5_i_i_i);
-
-// Block true IF*NULL.i1.i.i3.i.i.i (label_true_IF_NULL_i1_i_i3_i_i_i)
-std::vector<Value*> ptr_411_indices;
-ptr_411_indices.push_back(const_int32_56);
-ptr_411_indices.push_back(const_int32_56);
-Instruction* ptr_411 = GetElementPtrInst::Create(ptr_403, ptr_411_indices.begin(), ptr_411_indices.end(), "", label_true_IF_NULL_i1_i_i3_i_i_i);
- new StoreInst(const_ptr_78, ptr_411, false, label_true_IF_NULL_i1_i_i3_i_i_i);
-GetElementPtrInst* ptr_413 = GetElementPtrInst::Create(ptr_405, const_int32_62, "", label_true_IF_NULL_i1_i_i3_i_i_i);
-CastInst* ptr_414 = new BitCastInst(ptr_413, PointerTy_29, "", label_true_IF_NULL_i1_i_i3_i_i_i);
-LoadInst* ptr_415 = new LoadInst(ptr_414, "", false, label_true_IF_NULL_i1_i_i3_i_i_i);
-LoadInst* ptr_416 = new LoadInst(const_ptr_87, "", false, label_true_IF_NULL_i1_i_i3_i_i_i);
-CastInst* int32_417 = new PtrToIntInst(ptr_416, IntegerType::get(mod->getContext(), 32), "", label_true_IF_NULL_i1_i_i3_i_i_i);
-BinaryOperator* int32_418 = BinaryOperator::Create(Instruction::Add, int32_417, int32_402, "", label_true_IF_NULL_i1_i_i3_i_i_i);
-CastInst* ptr_419 = new IntToPtrInst(int32_418, PointerTy_29, "", label_true_IF_NULL_i1_i_i3_i_i_i);
- new StoreInst(ptr_415, ptr_419, false, label_true_IF_NULL_i1_i_i3_i_i_i);
-LoadInst* ptr_421 = new LoadInst(ptr_414, "", false, label_true_IF_NULL_i1_i_i3_i_i_i);
-ICmpInst* int1_422 = new ICmpInst(*label_true_IF_NULL_i1_i_i3_i_i_i, ICmpInst::ICMP_EQ, ptr_421, const_ptr_88, "");
-BranchInst::Create(label_GOTO_or_IF_1_i3_i_i5_i_i_i, label_false_IFNE_i7_i_i8_i_i_i, int1_422, label_true_IF_NULL_i1_i_i3_i_i_i);
-
-// Block GOTO or IF*1.i3.i.i5.i.i.i (label_GOTO_or_IF_1_i3_i_i5_i_i_i)
-CastInst* ptr_424 = new BitCastInst(ptr_413, PointerTy_35, "", label_GOTO_or_IF_1_i3_i_i5_i_i_i);
-CastInst* ptr__c1_i2_i_i4_i_i_i = new IntToPtrInst(int32_402, PointerTy_31, ".c1.i2.i.i4.i.i.i", label_GOTO_or_IF_1_i3_i_i5_i_i_i);
- new StoreInst(ptr__c1_i2_i_i4_i_i_i, ptr_424, false, label_GOTO_or_IF_1_i3_i_i5_i_i_i);
-LoadInst* ptr_426 = new LoadInst(ptr_407, "", false, label_GOTO_or_IF_1_i3_i_i5_i_i_i);
-ICmpInst* int1_427 = new ICmpInst(*label_GOTO_or_IF_1_i3_i_i5_i_i_i, ICmpInst::ICMP_EQ, ptr_426, const_ptr_86, "");
-BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i8_i_i9_i_i_i, int1_427, label_GOTO_or_IF_1_i3_i_i5_i_i_i);
-
-// Block true IFNULL.i5.i.i6.i.i.i (label_true_IFNULL_i5_i_i6_i_i_i)
-GetElementPtrInst* ptr_429 = GetElementPtrInst::Create(ptr_408, const_int32_62, "", label_true_IFNULL_i5_i_i6_i_i_i);
-CastInst* ptr_430 = new BitCastInst(ptr_429, PointerTy_25, "", label_true_IFNULL_i5_i_i6_i_i_i);
-BranchInst::Create(label_bb2_i_i_i, label_true_IFNULL_i5_i_i6_i_i_i);
-
-// Block bb.i.i.i (label_bb_i_i_i)
-Argument* fwdref_433 = new Argument(IntegerType::get(mod->getContext(), 1));
-BranchInst::Create(label_true_IF_NULL_i1_i_i3_i_i_i, label_bb1_i_i_i, fwdref_433, label_bb_i_i_i);
-
-// Block bb1.i.i.i (label_bb1_i_i_i)
-Argument* fwdref_435 = new Argument(IntegerType::get(mod->getContext(), 32));
-BinaryOperator* int32_434 = BinaryOperator::Create(Instruction::Add, fwdref_435, const_int32_77, "", label_bb1_i_i_i);
-BranchInst::Create(label_bb2_i_i_i, label_bb1_i_i_i);
-
-// Block bb2.i.i.i (label_bb2_i_i_i)
-PHINode* int32_437 = PHINode::Create(IntegerType::get(mod->getContext(), 32), "", label_bb2_i_i_i);
-int32_437->reserveOperandSpace(2);
-int32_437->addIncoming(const_int32_56, label_true_IFNULL_i5_i_i6_i_i_i);
-int32_437->addIncoming(int32_434, label_bb1_i_i_i);
-
-ICmpInst* int1_438 = new ICmpInst(*label_bb2_i_i_i, ICmpInst::ICMP_ULT, int32_437, const_int32_89, "");
-std::vector<Value*> void_439_params;
-void_439_params.push_back(const_int1_90);
-void_439_params.push_back(const_int1_90);
-void_439_params.push_back(const_int1_90);
-void_439_params.push_back(const_int1_90);
-void_439_params.push_back(const_int1_90);
-CallInst* void_439 = CallInst::Create(func_llvm_memory_barrier, void_439_params.begin(), void_439_params.end(), "", label_bb2_i_i_i);
-void_439->setCallingConv(CallingConv::C);
-void_439->setTailCall(true);
-AttrListPtr void_439_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- void_439_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-void_439->setAttributes(void_439_PAL);
-
-std::vector<Value*> int32_440_params;
-int32_440_params.push_back(ptr_430);
-int32_440_params.push_back(const_int32_56);
-int32_440_params.push_back(const_int32_77);
-CallInst* int32_440 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_440_params.begin(), int32_440_params.end(), "", label_bb2_i_i_i);
-int32_440->setCallingConv(CallingConv::C);
-int32_440->setTailCall(true);
-AttrListPtr int32_440_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- int32_440_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-int32_440->setAttributes(int32_440_PAL);
-
-std::vector<Value*> void_441_params;
-void_441_params.push_back(const_int1_90);
-void_441_params.push_back(const_int1_90);
-void_441_params.push_back(const_int1_90);
-void_441_params.push_back(const_int1_90);
-void_441_params.push_back(const_int1_90);
-CallInst* void_441 = CallInst::Create(func_llvm_memory_barrier, void_441_params.begin(), void_441_params.end(), "", label_bb2_i_i_i);
-void_441->setCallingConv(CallingConv::C);
-void_441->setTailCall(true);
-AttrListPtr void_441_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- void_441_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-void_441->setAttributes(void_441_PAL);
-
-ICmpInst* int1_442 = new ICmpInst(*label_bb2_i_i_i, ICmpInst::ICMP_EQ, int32_440, const_int32_56, "");
-BranchInst::Create(label_bb_i_i_i, label_bb4_preheader_i_i_i, int1_438, label_bb2_i_i_i);
-
-// Block bb4.preheader.i.i.i (label_bb4_preheader_i_i_i)
-BranchInst::Create(label_true_IF_NULL_i1_i_i3_i_i_i, label_bb3_i_i_i, int1_442, label_bb4_preheader_i_i_i);
-
-// Block bb3.i.i.i (label_bb3_i_i_i)
-CallInst* void_445 = CallInst::Create(func__ZN3mvm6Thread5yieldEv, "", label_bb3_i_i_i);
-void_445->setCallingConv(CallingConv::C);
-void_445->setTailCall(true);
-AttrListPtr void_445_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- void_445_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-void_445->setAttributes(void_445_PAL);
-
-std::vector<Value*> void_446_params;
-void_446_params.push_back(const_int1_90);
-void_446_params.push_back(const_int1_90);
-void_446_params.push_back(const_int1_90);
-void_446_params.push_back(const_int1_90);
-void_446_params.push_back(const_int1_90);
-CallInst* void_446 = CallInst::Create(func_llvm_memory_barrier, void_446_params.begin(), void_446_params.end(), "", label_bb3_i_i_i);
-void_446->setCallingConv(CallingConv::C);
-void_446->setTailCall(true);
-AttrListPtr void_446_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- void_446_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-void_446->setAttributes(void_446_PAL);
-
-std::vector<Value*> int32_447_params;
-int32_447_params.push_back(ptr_430);
-int32_447_params.push_back(const_int32_56);
-int32_447_params.push_back(const_int32_77);
-CallInst* int32_447 = CallInst::Create(func_llvm_atomic_cmp_swap_i32_p0i32, int32_447_params.begin(), int32_447_params.end(), "", label_bb3_i_i_i);
-int32_447->setCallingConv(CallingConv::C);
-int32_447->setTailCall(true);
-AttrListPtr int32_447_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- int32_447_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-int32_447->setAttributes(int32_447_PAL);
-
-std::vector<Value*> void_448_params;
-void_448_params.push_back(const_int1_90);
-void_448_params.push_back(const_int1_90);
-void_448_params.push_back(const_int1_90);
-void_448_params.push_back(const_int1_90);
-void_448_params.push_back(const_int1_90);
-CallInst* void_448 = CallInst::Create(func_llvm_memory_barrier, void_448_params.begin(), void_448_params.end(), "", label_bb3_i_i_i);
-void_448->setCallingConv(CallingConv::C);
-void_448->setTailCall(true);
-AttrListPtr void_448_PAL;
-{
- SmallVector<AttributeWithIndex, 4> Attrs;
- AttributeWithIndex PAWI;
- PAWI.Index = 4294967295U; PAWI.Attrs = 0 | Attribute::NoUnwind;
- Attrs.push_back(PAWI);
- void_448_PAL = AttrListPtr::get(Attrs.begin(), Attrs.end());
-
-}
-void_448->setAttributes(void_448_PAL);
-
-ICmpInst* int1_449 = new ICmpInst(*label_bb3_i_i_i, ICmpInst::ICMP_EQ, int32_447, const_int32_56, "");
-BranchInst::Create(label_true_IF_NULL_i1_i_i3_i_i_i, label_bb3_i_i_i, int1_449, label_bb3_i_i_i);
-
-// Block false IFNE.i7.i.i8.i.i.i (label_false_IFNE_i7_i_i8_i_i_i)
-std::vector<Value*> ptr_451_indices;
-ptr_451_indices.push_back(const_int32_56);
-ptr_451_indices.push_back(const_int32_56);
-Instruction* ptr_451 = GetElementPtrInst::Create(ptr_421, ptr_451_indices.begin(), ptr_451_indices.end(), "", label_false_IFNE_i7_i_i8_i_i_i);
-CastInst* ptr__c_i6_i_i7_i_i_i = new IntToPtrInst(int32_402, PointerTy_31, ".c.i6.i.i7.i.i.i", label_false_IFNE_i7_i_i8_i_i_i);
- new StoreInst(ptr__c_i6_i_i7_i_i_i, ptr_451, false, label_false_IFNE_i7_i_i8_i_i_i);
-BranchInst::Create(label_GOTO_or_IF_1_i3_i_i5_i_i_i, label_false_IFNE_i7_i_i8_i_i_i);
-
-// Block true IFNULL3.i8.i.i9.i.i.i (label_true_IFNULL3_i8_i_i9_i_i_i)
-GetElementPtrInst* ptr_454 = GetElementPtrInst::Create(ptr_426, const_int32_62, "", label_true_IFNULL3_i8_i_i9_i_i_i);
-CastInst* ptr_455 = new BitCastInst(ptr_454, PointerTy_25, "", label_true_IFNULL3_i8_i_i9_i_i_i);
- new StoreInst(const_int32_56, ptr_455, false, label_true_IFNULL3_i8_i_i9_i_i_i);
-BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_true_IFNULL3_i8_i_i9_i_i_i);
-
-// Block false IFNE.i.i (label_false_IFNE_i_i)
-std::vector<Value*> ptr_458_indices;
-ptr_458_indices.push_back(const_int32_56);
-ptr_458_indices.push_back(const_int32_77);
-Instruction* ptr_458 = GetElementPtrInst::Create(ptr_291, ptr_458_indices.begin(), ptr_458_indices.end(), "", label_false_IFNE_i_i);
-CastInst* ptr_459 = new BitCastInst(ptr_458, PointerTy_25, "", label_false_IFNE_i_i);
-LoadInst* int32_460 = new LoadInst(ptr_459, "", false, label_false_IFNE_i_i);
-BinaryOperator* int32_461 = BinaryOperator::Create(Instruction::And, int32_460, const_int32_79, "", label_false_IFNE_i_i);
-LoadInst* ptr_462 = new LoadInst(const_ptr_94, "", false, label_false_IFNE_i_i);
-CastInst* int32_463 = new PtrToIntInst(ptr_462, IntegerType::get(mod->getContext(), 32), "", label_false_IFNE_i_i);
-BinaryOperator* int32_464 = BinaryOperator::Create(Instruction::Or, int32_463, int32_461, "", label_false_IFNE_i_i);
-CastInst* ptr__c6 = new IntToPtrInst(int32_464, PointerTy_0, ".c6", label_false_IFNE_i_i);
- new StoreInst(ptr__c6, ptr_458, false, label_false_IFNE_i_i);
-BranchInst::Create(label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit, label_false_IFNE_i_i);
-
-// Block JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2.exit (label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit)
-CastInst* ptr_tmp1 = new BitCastInst(ptr_291, PointerTy_0, "tmp1", label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit);
-ReturnInst::Create(mod->getContext(), ptr_tmp1, label_JnJVM_org_j3_bindings_Bindings_gcmalloc__ILorg_vmmagic_unboxed_ObjectReference_2_exit);
+ptr_12->setAttributes(ptr_12_PAL);
-// Resolve Forward References
-fwdref_359->replaceAllUsesWith(int32_361); delete fwdref_359;
-fwdref_357->replaceAllUsesWith(int1_366); delete fwdref_357;
-fwdref_435->replaceAllUsesWith(int32_437); delete fwdref_435;
-fwdref_433->replaceAllUsesWith(int1_442); delete fwdref_433;
+CastInst* ptr_tmp1 = new BitCastInst(ptr_12, PointerTy_0, "tmp1", label_entry);
+ReturnInst::Create(mod->getContext(), ptr_tmp1, label_entry);
return func_gcmalloc;
}
Modified: vmkit/trunk/mmtk/java/src/org/j3/mmtk/Barriers.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/j3/mmtk/Barriers.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/j3/mmtk/Barriers.java (original)
+++ vmkit/trunk/mmtk/java/src/org/j3/mmtk/Barriers.java Sat Aug 14 07:25:41 2010
@@ -1,202 +1,592 @@
-//===--------------- Barriers.java - Barriers for J3 ----------------------===//
-//
-// The VMKit project
-//
-// This file is distributed under the University of Illinois Open Source
-// License. See LICENSE.TXT for details.
-//
-//===----------------------------------------------------------------------===//
-
+/*
+ * This file is part of the Jikes RVM project (http://jikesrvm.org).
+ *
+ * This file is licensed to You under the Eclipse Public License (EPL);
+ * You may not use this file except in compliance with the License. You
+ * may obtain a copy of the License at
+ *
+ * http://www.opensource.org/licenses/eclipse-1.0.php
+ *
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.
+ */
package org.j3.mmtk;
+import org.jikesrvm.SizeConstants;
import org.jikesrvm.Magic;
+import org.mmtk.vm.VM;
+
import org.vmmagic.unboxed.*;
import org.vmmagic.pragma.*;
-public final class Barriers extends org.mmtk.vm.Barriers {
+ at Uninterruptible
+public class Barriers extends org.mmtk.vm.Barriers implements SizeConstants {
/**
- * Perform the actual write of the write barrier.
+ * Perform the actual write of a boolean write barrier.
*
- * @param ref The object that has the reference field
- * @param slot The slot that holds the reference
- * @param target The value that the slot will be updated to
- * @param metaDataA The offset from the ref
- * @param metaDataB The index of the FieldReference
- * @param mode The context in which the write is occuring
+ * @param objref The object that has the boolean field
+ * @param value The value that the slot will be updated to
+ * @param offset The offset from the ref
+ * @param location The FieldReference index to assist the store
+ * @param mode The context in which the write is occurring
*/
@Inline
- public final void performWriteInBarrier(ObjectReference ref, Address slot,
- ObjectReference target, Word metaDataA,
- Word metaDataB, int mode) {
- Object obj = ref.toObject();
- Offset offset = metaDataA.toOffset();
- int location = metaDataB.toInt();
- Magic.setObjectAtOffset(obj, offset, target.toObject(), location);
+ @Override
+ public final void booleanWrite(ObjectReference objref, boolean value, Word offset, Word location, int mode) {
+ Magic.setBooleanAtOffset(objref.toObject(), offset.toOffset(), value, location.toInt());
}
/**
- * Perform the actual write of the write barrier, writing the value as a raw word.
+ * Perform the actual read of a boolean read barrier.
*
- * @param ref The object that has the reference field
- * @param slot The slot that holds the reference
- * @param rawTarget The value that the slot will be updated to
- * @param metaDataA The offset from the ref
- * @param metaDataB The index of the FieldReference
- * @param mode The context in which the write is occuring
+ * @param objref The object that has the boolean field
+ * @param offset The offset from the ref
+ * @param unused Unused
+ * @param mode The context in which the write is occurring
+ * @return the read value
*/
@Inline
- public final void performRawWriteInBarrier(ObjectReference ref, Address slot,
- Word rawTarget, Word metaDataA,
- Word metaDataB, int mode) {
- Object obj = ref.toObject();
- Offset offset = metaDataA.toOffset();
- int location = metaDataB.toInt();
- Magic.setWordAtOffset(obj, offset, rawTarget, location);
+ @Override
+ public final boolean booleanRead(ObjectReference objref, Word offset, Word location, int mode) {
+ return Magic.getByteAtOffset(objref.toObject(), offset.toOffset()) == 0;
}
/**
- * Perform the actual read of the read barrier.
+ * Perform the actual write of a byte write barrier.
*
- * @param ref The object that has the reference field
- * @param slot The slot that holds the reference
- * @param metaDataA The offset from the ref
- * @param metaDataB The index of the FieldReference
- * @param mode The context in which the write is occuring
+ * @param objref The object that has the byte field
+ * @param value The value that the slot will be updated to
+ * @param offset The offset from the ref
+ * @param location The FieldReference index to assist the store
+ * @param mode The context in which the write is occurring
+ */
+ @Inline
+ @Override
+ public final void byteWrite(ObjectReference objref, byte value, Word offset, Word location, int mode) {
+ Magic.setByteAtOffset(objref.toObject(), offset.toOffset(), value, location.toInt());
+ }
+
+ /**
+ * Perform the actual read of a byte read barrier.
+ *
+ * @param objref The object that has the byte field
+ * @param offset The offset from the ref
+ * @param unused Unused
+ * @param mode The context in which the write is occurring
* @return the read value
*/
@Inline
- public final ObjectReference performReadInBarrier(ObjectReference ref, Address slot,
- Word metaDataA, Word metaDataB, int mode) {
- Object obj = ref.toObject();
- Offset offset = metaDataA.toOffset();
- int location = metaDataB.toInt();
- return ObjectReference.fromObject(Magic.getObjectAtOffset(obj, offset, location));
+ @Override
+ public final byte byteRead(ObjectReference objref, Word offset, Word location, int mode) {
+ return Magic.getByteAtOffset(objref.toObject(), offset.toOffset());
}
/**
- * Perform the actual read of the read barrier, returning the value as a raw word.
+ * Perform the actual write of a char write barrier.
*
- * @param ref The object that has the reference field
- * @param slot The slot that holds the reference
- * @param metaDataA The offset from the ref
- * @param metaDataB The index of the FieldReference
- * @param mode The context in which the write is occuring
+ * @param objref The object that has the char field
+ * @param value The value that the slot will be updated to
+ * @param offset The offset from the ref
+ * @param location The FieldReference index to assist the store
+ * @param mode The context in which the write is occurring
+ */
+ @Inline
+ @Override
+ public final void charWrite(ObjectReference objref, char value, Word offset, Word location, int mode) {
+ Magic.setCharAtOffset(objref.toObject(), offset.toOffset(), value, location.toInt());
+ }
+
+ /**
+ * Perform the actual read of a char read barrier.
+ *
+ * @param objref The object that has the char field
+ * @param offset The offset from the ref
+ * @param unused Unused
+ * @param mode The context in which the write is occurring
+ * @return the read value
+ */
+ @Inline
+ @Override
+ public final char charRead(ObjectReference objref, Word offset, Word location, int mode) {
+ return Magic.getCharAtOffset(objref.toObject(), offset.toOffset());
+ }
+
+ /**
+ * Perform the actual write of a short write barrier.
+ *
+ * @param objref The object that has the short field
+ * @param value The value that the slot will be updated to
+ * @param offset The offset from the ref
+ * @param location The FieldReference index to assist the store
+ * @param mode The context in which the write is occurring
+ */
+ @Inline
+ @Override
+ public final void shortWrite(ObjectReference objref, short value, Word offset, Word location, int mode) {
+ Magic.setShortAtOffset(objref.toObject(), offset.toOffset(), value, location.toInt());
+ }
+
+ /**
+ * Perform the actual read of a short read barrier.
+ *
+ * @param objref The object that has the short field
+ * @param offset The offset from the ref
+ * @param unused Unused
+ * @param mode The context in which the write is occurring
+ * @return the read value
+ */
+ @Inline
+ @Override
+ public final short shortRead(ObjectReference objref, Word offset, Word location, int mode) {
+ return Magic.getShortAtOffset(objref.toObject(), offset.toOffset());
+ }
+
+ /**
+ * Perform the actual write of a int write barrier.
+ *
+ * @param objref The object that has the int field
+ * @param value The value that the slot will be updated to
+ * @param offset The offset from the ref
+ * @param location The FieldReference index to assist the store
+ * @param mode The context in which the write is occurring
+ */
+ @Inline
+ @Override
+ public final void intWrite(ObjectReference objref, int value, Word offset, Word location, int mode) {
+ Magic.setIntAtOffset(objref.toObject(), offset.toOffset(), value, location.toInt());
+ }
+
+ /**
+ * Perform the actual read of a int read barrier.
+ *
+ * @param objref The object that has the int field
+ * @param offset The offset from the ref
+ * @param unused Unused
+ * @param mode The context in which the write is occurring
+ * @return the read value
+ */
+ @Inline
+ @Override
+ public final int intRead(ObjectReference objref, Word offset, Word location, int mode) {
+ return Magic.getIntAtOffset(objref.toObject(), offset.toOffset());
+ }
+
+ /**
+ * Attempt an atomic compare and exchange in a write barrier sequence.
+ *
+ * @param objref The object that has the int field
+ * @param expected The old int to be swapped out
+ * @param newValue the new int
+ * @param offset The offset from the ref
+ * @param unused Unused
+ * @param mode The context in which the write is occurring
+ * @return True if the compare and swap was successful
+ */
+ @Override
+ public boolean intTryCompareAndSwap(ObjectReference objref, int expected, int newValue, Word offset, Word unused, int mode) {
+ int oldValue;
+ do {
+ oldValue = Magic.prepareInt(objref, offset.toOffset());
+ if (oldValue != expected) return false;
+ } while (!Magic.attemptInt(objref, offset.toOffset(), oldValue, newValue));
+ return true;
+ }
+
+ /**
+ * Perform the actual write of a long write barrier.
+ *
+ * @param objref The object that has the long field
+ * @param value The value that the slot will be updated to
+ * @param offset The offset from the ref
+ * @param location The FieldReference index to assist the store
+ * @param mode The context in which the write is occurring
+ */
+ @Inline
+ @Override
+ public final void longWrite(ObjectReference objref, long value, Word offset, Word location, int mode) {
+ Magic.setLongAtOffset(objref.toObject(), offset.toOffset(), value, location.toInt());
+ }
+
+ /**
+ * Perform the actual read of a long read barrier.
+ *
+ * @param objref The object that has the long field
+ * @param offset The offset from the ref
+ * @param unused Unused
+ * @param mode The context in which the write is occurring
+ * @return the read value
+ */
+ @Inline
+ @Override
+ public final long longRead(ObjectReference objref, Word offset, Word location, int mode) {
+ return Magic.getLongAtOffset(objref.toObject(), offset.toOffset());
+ }
+
+ /**
+ * Attempt an atomic compare and exchange in a write barrier sequence.
+ *
+ * @param objref The object that has the long field
+ * @param expected The old long to be swapped out
+ * @param newValue the new long
+ * @param offset The offset from the ref
+ * @param unused Unused
+ * @param mode The context in which the write is occurring
+ * @return True if the compare and swap was successful
+ */
+ @Override
+ public boolean longTryCompareAndSwap(ObjectReference objref, long expected, long newValue, Word offset, Word unused, int mode) {
+ long oldValue;
+ do {
+ oldValue = Magic.prepareLong(objref, offset.toOffset());
+ if (oldValue != expected) return false;
+ } while (!Magic.attemptLong(objref, offset.toOffset(), oldValue, newValue));
+ return true;
+ }
+
+ /**
+ * Perform the actual write of a float write barrier.
+ *
+ * @param objref The object that has the float field
+ * @param value The value that the slot will be updated to
+ * @param offset The offset from the ref
+ * @param location The FieldReference index to assist the store
+ * @param mode The context in which the write is occurring
+ */
+ @Inline
+ @Override
+ public final void floatWrite(ObjectReference objref, float value, Word offset, Word location, int mode) {
+ Magic.setFloatAtOffset(objref.toObject(), offset.toOffset(), value, location.toInt());
+ }
+
+ /**
+ * Perform the actual read of a float read barrier.
+ *
+ * @param objref The object that has the float field
+ * @param offset The offset from the ref
+ * @param unused Unused
+ * @param mode The context in which the write is occurring
+ * @return the read value
+ */
+ @Inline
+ @Override
+ public final float floatRead(ObjectReference objref, Word offset, Word location, int mode) {
+ return Magic.getFloatAtOffset(objref.toObject(), offset.toOffset());
+ }
+
+ /**
+ * Perform the actual write of a double write barrier.
+ *
+ * @param objref The object that has the double field
+ * @param value The value that the slot will be updated to
+ * @param offset The offset from the ref
+ * @param location The FieldReference index to assist the store
+ * @param mode The context in which the write is occurring
+ */
+ @Inline
+ @Override
+ public final void doubleWrite(ObjectReference objref, double value, Word offset, Word location, int mode) {
+ Magic.setDoubleAtOffset(objref.toObject(), offset.toOffset(), value, location.toInt());
+ }
+
+ /**
+ * Perform the actual read of a double read barrier.
+ *
+ * @param objref The object that has the double field
+ * @param offset The offset from the ref
+ * @param unused Unused
+ * @param mode The context in which the write is occurring
* @return the read value
*/
@Inline
- public final Word performRawReadInBarrier(ObjectReference ref, Address slot,
- Word metaDataA, Word metaDataB, int mode) {
- Object obj = ref.toObject();
- Offset offset = metaDataA.toOffset();
- int location = metaDataB.toInt();
- return Magic.getWordAtOffset(obj, offset, location);
+ @Override
+ public final double doubleRead(ObjectReference objref, Word offset, Word location, int mode) {
+ return Magic.getDoubleAtOffset(objref.toObject(), offset.toOffset());
+ }
+
+ /**
+ * Perform the actual write of an object reference write barrier.
+ *
+ * @param objref The object that has the reference field
+ * @param value The value that the slot will be updated to
+ * @param offset The offset from the ref
+ * @param location The index of the FieldReference
+ * @param mode The context in which the write is occurring
+ */
+ @Inline
+ @Override
+ public final void objectReferenceWrite(ObjectReference objref, ObjectReference value, Word offset, Word location, int mode) {
+ Magic.setObjectAtOffset(objref.toObject(), offset.toOffset(), value.toObject(), location.toInt());
+ }
+
+ /**
+ * Perform the actual read of an object reference read barrier.
+ *
+ * @param objref The object that has the reference field
+ * @param offset The offset from the ref
+ * @param location The index of the FieldReference
+ * @param mode The context in which the write is occurring
+ * @return the object reference read value
+ */
+ @Inline
+ @Override
+ public final ObjectReference objectReferenceRead(ObjectReference objref, Word offset, Word location, int mode) {
+ return ObjectReference.fromObject(Magic.getObjectAtOffset(objref.toObject(), offset.toOffset(), location.toInt()));
+ }
+
+ /**
+ * Perform the actual write of the non-heap write barrier. This is
+ * used when the store is not to an object, but to a non-heap location
+ * such as statics or the stack.
+ * @param target The value that the slot will be updated to
+ * @param unusedA The offset from the ref
+ * @param unusedB Unused
+ * @param ref The object that has the reference field
+ */
+ @Inline
+ @Override
+ public final void objectReferenceNonHeapWrite(Address slot, ObjectReference target, Word unusedA, Word unusedB) {
+ slot.store(target);
}
/**
* Atomically write a reference field of an object or array and return
* the old value of the reference field.
*
- * @param ref The object that has the reference field
- * @param slot The slot that holds the reference
+ * @param objref The object that has the reference field
* @param target The value that the slot will be updated to
- * @param metaDataA The offset from the ref
- * @param metaDataB Unused
- * @param mode The context in which the write is occuring
+ * @param offset The offset from the ref
+ * @param unused Unused
+ * @param mode The context in which the write is occurring
* @return The value that was replaced by the write.
*/
@Inline
- public final ObjectReference performWriteInBarrierAtomic(
- ObjectReference ref, Address slot,
- ObjectReference target, Word metaDataA,
- Word metaDataB, int mode) {
- Object obj = ref.toObject();
+ @Override
+ public final ObjectReference objectReferenceAtomicWrite(ObjectReference objref, ObjectReference target, Word offset, Word unused, int mode) {
+ Object obj = objref.toObject();
Object newObject = target.toObject();
- Offset offset = metaDataA.toOffset();
Object oldObject;
do {
- oldObject = Magic.prepareObject(obj, offset);
- } while (!Magic.attemptObject(obj, offset, oldObject, newObject));
+ oldObject = Magic.prepareObject(obj, offset.toOffset());
+ } while (!Magic.attemptObject(obj, offset.toOffset(), oldObject, newObject));
return ObjectReference.fromObject(oldObject);
}
+ /**
+ * Attempt an atomic compare and exchange in a write barrier sequence.
+ *
+ * @param objref The object that has the reference field
+ * @param old The old reference to be swapped out
+ * @param target The value that the slot will be updated to
+ * @param offset The offset from the ref
+ * @param unused Unused
+ * @param mode The context in which the write is occurring
+ * @return True if the compare and swap was successful
+ */
+ @Inline
+ @Override
+ public final boolean objectReferenceTryCompareAndSwap(ObjectReference objref, ObjectReference old, ObjectReference target, Word offset, Word unused, int mode) {
+ Object oldValue;
+ do {
+ oldValue = Magic.prepareObject(objref, offset.toOffset());
+ if (oldValue != old) return false;
+ } while (!Magic.attemptObject(objref, offset.toOffset(), oldValue, target));
+ return true;
+ }
+
+ /**
+ * Perform the actual write of the write barrier, writing the value as a raw Word.
+ *
+ * @param ref The object that has the Word field
+ * @param target The value that the slot will be updated to
+ * @param offset The offset from the ref
+ * @param location The index of the FieldReference
+ * @param mode The context in which the write is occurring
+ */
+ @Inline
+ @Override
+ public final void wordWrite(ObjectReference ref, Word target,
+ Word offset, Word location, int mode) {
+ Magic.setWordAtOffset(ref.toObject(), offset.toOffset(), target, location.toInt());
+ }
/**
* Atomically write a raw reference field of an object or array and return
* the old value of the reference field.
*
- * @param ref The object that has the reference field
- * @param slot The slot that holds the reference
- * @param rawTarget The value that the slot will be updated to
- * @param metaDataA The offset from the ref
- * @param metaDataB Unused
- * @param mode The context in which the write is occuring
+ * @param ref The object that has the Word field
+ * @param target The value that the slot will be updated to
+ * @param offset The offset from the ref
+ * @param unused Unused
+ * @param mode The context in which the write is occurring
* @return The value that was replaced by the write.
*/
@Inline
- public final Word performRawWriteInBarrierAtomic(
- ObjectReference ref, Address slot,
- Word rawTarget, Word metaDataA,
- Word metaDataB, int mode) {
- Object obj = ref.toObject();
- Offset offset = metaDataA.toOffset();
+ @Override
+ public final Word wordAtomicWrite(ObjectReference ref, Word target,
+ Word offset, Word unused, int mode) {
Word oldValue;
do {
- oldValue = Magic.prepareWord(obj, offset);
- } while (!Magic.attemptWord(obj, offset, oldValue, rawTarget));
+ oldValue = Magic.prepareWord(ref.toObject(), offset.toOffset());
+ } while (!Magic.attemptWord(ref.toObject(), offset.toOffset(), oldValue, target));
return oldValue;
}
/**
* Attempt an atomic compare and exchange in a write barrier sequence.
*
- * @param ref The object that has the reference field
- * @param slot The slot that holds the reference
- * @param old The old reference to be swapped out
+ * @param ref The object that has the Word field
+ * @param old The old Word to be swapped out
* @param target The value that the slot will be updated to
- * @param metaDataA The offset from the ref
- * @param metaDataB Unused
- * @param mode The context in which the write is occuring
+ * @param offset The offset from the ref
+ * @param unused Unused
+ * @param mode The context in which the write is occurring
* @return True if the compare and swap was successful
*/
@Inline
- public final boolean tryCompareAndSwapWriteInBarrier(ObjectReference ref, Address slot,
- ObjectReference old, ObjectReference target,
- Word metaDataA, Word metaDataB, int mode) {
- Object oldValue;
- Offset offset = metaDataA.toOffset();
+ @Override
+ public final boolean wordTryCompareAndSwap(ObjectReference ref, Word old, Word target,
+ Word offset, Word unused, int mode) {
do {
- oldValue = Magic.prepareObject(ref, offset);
- if (oldValue != old) return false;
- } while (!Magic.attemptObject(ref, offset, oldValue, target));
+ Word currentValue = Magic.prepareWord(ref, offset.toOffset());
+ if (currentValue != old) return false;
+ } while (!Magic.attemptWord(ref, offset.toOffset(), old, target));
return true;
}
+ /**
+ * Perform the actual read of the read barrier, returning the value as a raw Word.
+ *
+ * @param ref The object that has the Word field
+ * @param offset The offset from the ref
+ * @param location The index of the FieldReference
+ * @param mode The context in which the write is occurring
+ * @return the read value
+ */
+ @Inline
+ @Override
+ public final Word wordRead(ObjectReference ref,
+ Word offset, Word location, int mode) {
+ return Magic.getWordAtOffset(ref.toObject(), offset.toOffset(), location.toInt());
+ }
+
+ /**
+ * Perform the actual write of the write barrier, writing the value as a raw Address.
+ *
+ * @param ref The object that has the Address field
+ * @param target The value that the slot will be updated to
+ * @param offset The offset from the ref
+ * @param location The index of the FieldReference
+ * @param mode The context in which the write is occurring
+ */
+ @Inline
+ @Override
+ public final void addressWrite(ObjectReference ref, Address target,
+ Word offset, Word location, int mode) {
+ Magic.setAddressAtOffset(ref.toObject(), offset.toOffset(), target, location.toInt());
+ }
+
+ /**
+ * Perform the actual read of the read barrier, returning the value as a raw Address.
+ *
+ * @param ref The object that has the Address field
+ * @param offset The offset from the ref
+ * @param location The index of the FieldReference
+ * @param mode The context in which the write is occurring
+ * @return the read value
+ */
+ @Inline
+ @Override
+ public final Address addressRead(ObjectReference ref,
+ Word offset, Word location, int mode) {
+ return Magic.getAddressAtOffset(ref.toObject(), offset.toOffset(), location.toInt());
+ }
/**
* Attempt an atomic compare and exchange in a write barrier sequence.
*
- * @param ref The object that has the reference field
- * @param slot The slot that holds the reference
- * @param rawOld The old reference to be swapped out
- * @param rawTarget The value that the slot will be updated to
- * @param metaDataA The offset from the ref
- * @param metaDataB Unused
- * @param mode The context in which the write is occuring
+ * @param objref The object that has the Address field
+ * @param expected The old Address to be swapped out
+ * @param newValue the new Address
+ * @param offset The offset from the ref
+ * @param unused Unused
+ * @param mode The context in which the write is occurring
* @return True if the compare and swap was successful
*/
- @Inline
- public final boolean tryRawCompareAndSwapWriteInBarrier(ObjectReference ref, Address slot,
- Word rawOld, Word rawTarget, Word metaDataA,
- Word metaDataB, int mode) {
- Offset offset = metaDataA.toOffset();
- do {
- Word currentValue = Magic.prepareWord(ref, offset);
- if (currentValue != rawOld) return false;
- } while (!Magic.attemptObject(ref, offset, rawOld, rawTarget));
+ @Override
+ public boolean addressTryCompareAndSwap(ObjectReference objref, Address expected, Address newValue, Word offset, Word unused, int mode) {
+ Address oldValue;
+ do {
+ oldValue = Magic.prepareAddress(objref, offset.toOffset());
+ if (oldValue != expected) return false;
+ } while (!Magic.attemptAddress(objref, offset.toOffset(), oldValue, newValue));
return true;
}
/**
+ * Perform the actual write of the write barrier, writing the value as a raw Offset.
+ *
+ * @param ref The object that has the Offset field
+ * @param target The value that the slot will be updated to
+ * @param offset The offset from the ref
+ * @param location The index of the FieldReference
+ * @param mode The context in which the write is occurring
+ */
+ @Inline
+ @Override
+ public final void offsetWrite(ObjectReference ref, Offset target,
+ Word offset, Word location, int mode) {
+ Magic.setOffsetAtOffset(ref.toObject(), offset.toOffset(), target, location.toInt());
+ }
+
+ /**
+ * Perform the actual read of the read barrier, returning the value as a raw Offset.
+ *
+ * @param ref The object that has the Offset field
+ * @param offset The offset from the ref
+ * @param location The index of the FieldReference
+ * @param mode The context in which the write is occurring
+ * @return the read value
+ */
+ @Inline
+ @Override
+ public final Offset offsetRead(ObjectReference ref,
+ Word offset, Word location, int mode) {
+ return Magic.getOffsetAtOffset(ref.toObject(), offset.toOffset(), location.toInt());
+ }
+
+ /**
+ * Perform the actual write of the write barrier, writing the value as a raw Extent.
+ *
+ * @param ref The object that has the Extent field
+ * @param target The value that the slot will be updated to
+ * @param offset The offset from the ref
+ * @param location The index of the FieldReference
+ * @param mode The context in which the write is occurring
+ */
+ @Inline
+ @Override
+ public final void extentWrite(ObjectReference ref, Extent target,
+ Word offset, Word location, int mode) {
+ Magic.setExtentAtOffset(ref.toObject(), offset.toOffset(), target, location.toInt());
+ }
+
+ /**
+ * Perform the actual read of the read barrier, returning the value as a raw Extent.
+ *
+ * @param ref The object that has the Extent field
+ * @param offset The offset from the ref
+ * @param location The index of the FieldReference
+ * @param mode The context in which the write is occurring
+ * @return the read value
+ */
+ @Inline
+ @Override
+ public final Extent extentRead(ObjectReference ref,
+ Word offset, Word location, int mode) {
+ return Magic.getExtentAtOffset(ref.toObject(), offset.toOffset(), location.toInt());
+ }
+
+ /**
* Sets an element of an object array without invoking any write
* barrier. This method is called by the Map class to ensure
* potentially-allocation-triggering write barriers do not occur in
@@ -206,7 +596,11 @@
* @param index the index of the element to set
* @param value the new value for the element
*/
- public final void setArrayNoBarrier(Object [] dst, int index, Object value) {
- dst[index] = value;
+ @UninterruptibleNoWarn
+ @Override
+ public final void objectArrayStoreNoGCBarrier(Object[] dst, int index, Object value) {
+ Address base = ObjectReference.fromObject(dst).toAddress();
+ Address slot = base.plus(Offset.fromIntZeroExtend(index << LOG_BYTES_IN_ADDRESS));
+ VM.activePlan.global().storeObjectReference(slot, ObjectReference.fromObject(value));
}
}
Modified: vmkit/trunk/mmtk/java/src/org/j3/mmtk/Statistics.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/j3/mmtk/Statistics.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/j3/mmtk/Statistics.java (original)
+++ vmkit/trunk/mmtk/java/src/org/j3/mmtk/Statistics.java Sat Aug 14 07:25:41 2010
@@ -63,27 +63,14 @@
}
/**
- * Initialize performance counters
- *
- * @param metric An integer identifying the metric being read
+ * Initialize performance events
*/
- public native void perfCtrInit(int metric);
+ @Interruptible
+ public native void perfEventInit(String events);
/**
- * Read the current cycle count from the perfctr libraries
- *
- * @return the current cycle count from the perfctr libraries
+ * Read a performance event
*/
- public native long perfCtrReadCycles();
-
- /**
- * Read the current event count for the metric being measured by the
- * perfctr libraries
- *
- * @return the current event count for the metric being measured by the
- * perfctr libraries
- */
- public native long perfCtrReadMetric();
-
+ public native void perfEventRead(int id, long[] values);
}
Modified: vmkit/trunk/mmtk/java/src/org/jikesrvm/Magic.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/jikesrvm/Magic.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/jikesrvm/Magic.java (original)
+++ vmkit/trunk/mmtk/java/src/org/jikesrvm/Magic.java Sat Aug 14 07:25:41 2010
@@ -12,16 +12,17 @@
*/
package org.jikesrvm;
+import org.j3.runtime.VM;
+
import org.vmmagic.Intrinsic;
import org.vmmagic.pragma.Entrypoint;
import org.vmmagic.pragma.Uninterruptible;
import org.vmmagic.unboxed.Address;
+import org.vmmagic.unboxed.Extent;
import org.vmmagic.unboxed.Offset;
import org.vmmagic.unboxed.Word;
import org.vmmagic.unboxed.WordArray;
-import org.j3.runtime.VM;
-
/**
* Magic methods for accessing raw machine memory, registers, and
* operating system calls.
@@ -35,17 +36,6 @@
@Intrinsic
public final class Magic {
- /**
- * Read contents of hardware time base registers.
- * Note: we think that 1 "tick" == 4 "machine cycles", but this seems to be
- * undocumented and may vary across processor implementations.
- * @return number of ticks (epoch undefined)
- */
- public static long getTimeBase() {
- if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
- return -1;
- }
-
//---------------------------------------//
// Memory Access. //
//---------------------------------------//
@@ -70,6 +60,15 @@
}
/**
+ * Get char at arbitrary (byte) offset from object. The most
+ * significant 16bits will be 0.
+ */
+ public static char getCharAtOffset(Object object, Offset offset) {
+ if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ return (char) -1;
+ }
+
+ /**
* Get short at arbitrary (byte) offset from object. The most
* significant 16bits will be the same as the most significant bit
* in the short.
@@ -80,30 +79,38 @@
}
/**
- * Get char at arbitrary (byte) offset from object. The most
- * significant 16bits will be 0.
+ * Get int at arbitrary (byte) offset from object.
+ * Use getIntAtOffset(obj, ofs) instead of getMemoryInt(objectAsAddress(obj)+ofs)
*/
- public static char getCharAtOffset(Object object, Offset offset) {
+ public static int getIntAtOffset(Object object, Offset offset) {
if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
- return (char) -1;
+ return -1;
}
/**
- * Get int at arbitrary (byte) offset from object.
- * Use getIntAtOffset(obj, ofs) instead of getMemoryInt(objectAsAddress(obj)+ofs)
+ * Get long at arbitrary (byte) offset from object.
+ * Use getlongAtOffset(obj, ofs) instead of two getIntAtOffset
*/
- public static int getIntAtOffset(Object object, Offset offset) {
+ public static long getLongAtOffset(Object object, Offset offset) {
if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
return -1;
}
/**
- * Get Word at arbitrary (byte) offset from object.
- * Use getWordAtOffset(obj, ofs) instead of getMemoryWord(objectAsAddress(obj)+ofs)
+ * Get float at arbitrary (byte) offset from object.
*/
- public static Word getWordAtOffset(Object object, Offset offset) {
+ public static float getFloatAtOffset(Object object, Offset offset) {
if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
- return Word.max();
+ return -1;
+ }
+
+ /**
+ * Get double at arbitrary (byte) offset from object.
+ * Use getDoubleAtOffset(obj, ofs) instead of two getIntAtOffset
+ */
+ public static double getDoubleAtOffset(Object object, Offset offset) {
+ if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ return -1;
}
/**
@@ -128,6 +135,15 @@
/**
* Get Word at arbitrary (byte) offset from object.
+ * Use getWordAtOffset(obj, ofs) instead of getMemoryWord(objectAsAddress(obj)+ofs)
+ */
+ public static Word getWordAtOffset(Object object, Offset offset) {
+ if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ return Word.max();
+ }
+
+ /**
+ * Get Word at arbitrary (byte) offset from object.
*/
public static Word getWordAtOffset(Object object, Offset offset, int locationMetadata) {
if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
@@ -135,21 +151,70 @@
}
/**
- * Get long at arbitrary (byte) offset from object.
- * Use getlongAtOffset(obj, ofs) instead of two getIntAtOffset
+ * Get Address at arbitrary (byte) offset from object.
+ * Use getAddressAtOffset(obj, ofs) instead of getMemoryWord(objectAsAddress(obj)+ofs)
*/
- public static long getLongAtOffset(Object object, Offset offset) {
+ public static Address getAddressAtOffset(Object object, Offset offset) {
if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
- return -1;
+ return null;
}
/**
- * Get double at arbitrary (byte) offset from object.
- * Use getDoubleAtOffset(obj, ofs) instead of two getIntAtOffset
+ * Get Address at arbitrary (byte) offset from object.
*/
- public static double getDoubleAtOffset(Object object, Offset offset) {
+ public static Address getAddressAtOffset(Object object, Offset offset, int locationMetadata) {
if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
- return -1;
+ return null;
+ }
+
+ /**
+ * Get Extent at arbitrary (byte) offset from object.
+ * Use getExtentAtOffset(obj, ofs) instead of getMemoryWord(objectAsAddress(obj)+ofs)
+ */
+ public static Extent getExtentAtOffset(Object object, Offset offset) {
+ if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ return null;
+ }
+
+ /**
+ * Get Extent at arbitrary (byte) offset from object.
+ */
+ public static Extent getExtentAtOffset(Object object, Offset offset, int locationMetadata) {
+ if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ return null;
+ }
+
+ /**
+ * Get Offset at arbitrary (byte) offset from object.
+ * Use getOffsetAtOffset(obj, ofs) instead of getMemoryWord(objectAsAddress(obj)+ofs)
+ */
+ public static Offset getOffsetAtOffset(Object object, Offset offset) {
+ if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ return null;
+ }
+
+ /**
+ * Get Offset at arbitrary (byte) offset from object.
+ */
+ public static Offset getOffsetAtOffset(Object object, Offset offset, int locationMetadata) {
+ if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ return null;
+ }
+
+ /**
+ * Set boolean at arbitrary (byte) offset from object.
+ */
+ public static void setBooleanAtOffset(Object object, Offset offset, boolean newvalue) {
+ if (VM.VerifyAssertions)
+ VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ }
+
+ /**
+ * Set boolean at arbitrary (byte) offset from object.
+ */
+ public static void setBooleanAtOffset(Object object, Offset offset, boolean newvalue, int locationMetadata) {
+ if (VM.VerifyAssertions)
+ VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
}
/**
@@ -160,6 +225,14 @@
}
/**
+ * Set byte at arbitrary (byte) offset from object.
+ */
+ public static void setByteAtOffset(Object object, Offset offset, byte newvalue, int locationMetadata) {
+ if (VM.VerifyAssertions)
+ VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ }
+
+ /**
* Set char at arbitrary (byte) offset from object.
*/
public static void setCharAtOffset(Object object, Offset offset, char newvalue) {
@@ -167,6 +240,29 @@
}
/**
+ * Set char at arbitrary (byte) offset from object.
+ */
+ public static void setCharAtOffset(Object object, Offset offset, char newvalue, int locationMetadata) {
+ if (VM.VerifyAssertions)
+ VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ }
+
+ /**
+ * Set short at arbitrary (byte) offset from object.
+ */
+ public static void setShortAtOffset(Object object, Offset offset, short newvalue) {
+ if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ }
+
+ /**
+ * Set short at arbitrary (byte) offset from object.
+ */
+ public static void setShortAtOffset(Object object, Offset offset, short newvalue, int locationMetadata) {
+ if (VM.VerifyAssertions)
+ VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ }
+
+ /**
* Set int at arbitrary (byte) offset from object.
* Use setIntAtOffset(obj, ofs, new) instead of setMemoryWord(objectAsAddress(obj)+ofs, new)
*/
@@ -175,7 +271,64 @@
}
/**
- * Set word at arbitrary (byte) offset from object.
+ * Set int at arbitrary (byte) offset from object.
+ */
+ public static void setIntAtOffset(Object object, Offset offset, int newvalue, int locationMetadata) {
+ if (VM.VerifyAssertions)
+ VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ }
+
+ /**
+ * Set long at arbitrary (byte) offset from object.
+ * Use setlongAtOffset(obj, ofs) instead of two setIntAtOffset
+ */
+ public static void setLongAtOffset(Object object, Offset offset, long newvalue) {
+ if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ }
+
+ /**
+ * Set long at arbitrary (byte) offset from object. Use setlongAtOffset(obj,
+ * ofs) instead of two setIntAtOffset
+ */
+ public static void setLongAtOffset(Object object, Offset offset, long newvalue, int locationMetadata) {
+ if (VM.VerifyAssertions)
+ VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ }
+
+ /**
+ * Set float at arbitrary (byte) offset from object.
+ */
+ public static void setFloatAtOffset(Object object, Offset offset, float newvalue) {
+ if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ }
+
+ /**
+ * Set float at arbitrary (byte) offset from object.
+ */
+ public static void setFloatAtOffset(Object object, Offset offset, float newvalue, int locationMetadata) {
+ if (VM.VerifyAssertions)
+ VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ }
+
+ /**
+ * Set double at arbitrary (byte) offset from object.
+ * Use setDoubleAtOffset(obj, ofs) instead of two setIntAtOffset
+ */
+ public static void setDoubleAtOffset(Object object, Offset offset, double newvalue) {
+ if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ }
+
+ /**
+ * Set double at arbitrary (byte) offset from object. Use
+ * setDoubleAtOffset(obj, ofs) instead of two setIntAtOffset
+ */
+ public static void setDoubleAtOffset(Object object, Offset offset, double newvalue, int locationMetadata) {
+ if (VM.VerifyAssertions)
+ VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ }
+
+ /**
+ * Set Word at arbitrary (byte) offset from object.
* Use setWordAtOffset(obj, ofs, new) instead of setMemoryWord(objectAsAddress(obj)+ofs, new)
*/
public static void setWordAtOffset(Object object, Offset offset, Word newvalue) {
@@ -183,7 +336,7 @@
}
/**
- * Set word at arbitrary (byte) offset from object.
+ * Set Word at arbitrary (byte) offset from object.
* Use setWordAtOffset(obj, ofs, new) instead of setMemoryWord(objectAsAddress(obj)+ofs, new)
*/
public static void setWordAtOffset(Object object, Offset offset, Word newvalue, int locationMetadata) {
@@ -191,36 +344,69 @@
}
/**
- * Set Object at arbitrary (byte) offset from object.
- * Use setObjectAtOffset(obj, ofs, new) instead of setMemoryWord(objectAsAddress(obj)+ofs, objectAsAddress(new))
+ * Set Address at arbitrary (byte) offset from object.
+ * Use setAddressAtOffset(obj, ofs, new) instead of setMemoryWord(objectAsAddress(obj)+ofs, new)
*/
- public static void setObjectAtOffset(Object object, Offset offset, Object newvalue) {
+ public static void setAddressAtOffset(Object object, Offset offset, Address newvalue) {
if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
}
/**
- * Set Object at arbitrary (byte) offset from object.
+ * Set Address at arbitrary (byte) offset from object.
+ * Use setAddressAtOffset(obj, ofs, new) instead of setMemoryWord(objectAsAddress(obj)+ofs, new)
*/
- public static void setObjectAtOffset(Object object, Offset offset, Object newvalue, int locationMetadata) {
+ public static void setAddressAtOffset(Object object, Offset offset, Address newvalue, int locationMetadata) {
if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
}
/**
- * Set long at arbitrary (byte) offset from object.
- * Use setlongAtOffset(obj, ofs) instead of two setIntAtOffset
+ * Set Extent at arbitrary (byte) offset from object.
+ * Use setExtentAtOffset(obj, ofs, new) instead of setMemoryWord(objectAsAddress(obj)+ofs, new)
*/
- public static void setLongAtOffset(Object object, Offset offset, long newvalue) {
+ public static void setExtentAtOffset(Object object, Offset offset, Extent newvalue) {
if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
}
/**
- * Set double at arbitrary (byte) offset from object.
- * Use setDoubleAtOffset(obj, ofs) instead of two setIntAtOffset
+ * Set Extent at arbitrary (byte) offset from object.
+ * Use setExtenttOffset(obj, ofs, new) instead of setMemoryWord(objectAsAddress(obj)+ofs, new)
*/
- public static void setDoubleAtOffset(Object object, Offset offset, double newvalue) {
+ public static void setExtentAtOffset(Object object, Offset offset, Extent newvalue, int locationMetadata) {
if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
}
+ /**
+ * Set Offset at arbitrary (byte) offset from object.
+ * Use setOffsetAtOffset(obj, ofs, new) instead of setMemoryWord(objectAsAddress(obj)+ofs, new)
+ */
+ public static void setOffsetAtOffset(Object object, Offset offset, Offset newvalue) {
+ if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ }
+
+ /**
+ * Set Offset at arbitrary (byte) offset from object.
+ * Use setOffsetAtOffset(obj, ofs, new) instead of setMemoryWord(objectAsAddress(obj)+ofs, new)
+ */
+ public static void setOffsetAtOffset(Object object, Offset offset, Offset newvalue, int locationMetadata) {
+ if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ }
+
+ /**
+ * Set Object at arbitrary (byte) offset from object.
+ * Use setObjectAtOffset(obj, ofs, new) instead of setMemoryWord(objectAsAddress(obj)+ofs, objectAsAddress(new))
+ */
+ public static void setObjectAtOffset(Object object, Offset offset, Object newvalue) {
+ if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ }
+
+ /**
+ * Set Object at arbitrary (byte) offset from object.
+ */
+ public static void setObjectAtOffset(Object object, Offset offset, Object newvalue, int locationMetadata) {
+ if (VM.VerifyAssertions) VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ }
+
+
//---------------------------------------//
// Atomic Memory Access Primitives. //
//---------------------------------------//
@@ -348,5 +534,59 @@
}
}
-}
+ /****************************************************************
+ *
+ * Misc
+ *
+ */
+
+ /**
+ * On IA32, emit a PAUSE instruction, to optimize spin-wait loops.
+ */
+ public static void pause() {
+ if (VM.runningVM && VM.VerifyAssertions) {
+ VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ }
+ }
+ /**
+ * A hardware SQRT instruction
+ */
+ public static float sqrt(float value) {
+ if (VM.runningVM && VM.VerifyAssertions) {
+ VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ }
+ return -1.0f; // which should upset them even if assertions aren't enabled ...
+ }
+
+ /**
+ * A hardware SQRT instruction
+ */
+ public static double sqrt(double value) {
+ if (VM.runningVM && VM.VerifyAssertions) {
+ VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ }
+ return -1.0d; // which should upset them even if assertions aren't enabled ...
+ }
+
+ /**
+ * How deeply inlined is this method (0 means no inlining).
+ */
+ public static int getInlineDepth() {
+ if (VM.runningVM && VM.VerifyAssertions) {
+ VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ }
+ return 0;
+ }
+
+ /**
+ * Is the specified parameter constant (due to either inlining or specialization).
+ * Count starts at zero and includes the 'this' parameter for instance methods.
+ */
+ public static boolean isConstantParameter(int index) {
+ if (VM.runningVM && VM.VerifyAssertions) {
+ VM._assert(VM.NOT_REACHED); // call site should have been hijacked by magic in compiler
+ }
+ return false;
+ }
+}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/MutatorContext.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/MutatorContext.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/MutatorContext.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/MutatorContext.java Sat Aug 14 07:25:41 2010
@@ -118,13 +118,13 @@
protected final LargeObjectLocal los = new LargeObjectLocal(Plan.loSpace);
/** Per-mutator allocator into the small code space */
- private final MarkSweepLocal smcode = Plan.USE_CODE_SPACE ? new MarkSweepLocal(Plan.smallCodeSpace) : null;
+ protected final MarkSweepLocal smcode = Plan.USE_CODE_SPACE ? new MarkSweepLocal(Plan.smallCodeSpace) : null;
/** Per-mutator allocator into the large code space */
- private final LargeObjectLocal lgcode = Plan.USE_CODE_SPACE ? new LargeObjectLocal(Plan.largeCodeSpace) : null;
+ protected final LargeObjectLocal lgcode = Plan.USE_CODE_SPACE ? new LargeObjectLocal(Plan.largeCodeSpace) : null;
/** Per-mutator allocator into the non moving space */
- private final MarkSweepLocal nonmove = new MarkSweepLocal(Plan.nonMovingSpace);
+ protected final MarkSweepLocal nonmove = new MarkSweepLocal(Plan.nonMovingSpace);
/****************************************************************************
@@ -267,47 +267,624 @@
*/
/**
- * A new reference is about to be created. Take appropriate write
- * barrier actions.<p>
+ * Read a reference type. In a concurrent collector this may
+ * involve adding the referent to the marking queue.
+ *
+ * @param referent The referent being read.
+ * @return The new referent.
+ */
+ @Inline
+ public ObjectReference javaLangReferenceReadBarrier(ObjectReference referent) {
+ // Either: read barriers are used and this is overridden, or
+ // read barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return ObjectReference.nullReference();
+ }
+
+ /**
+ * Write a boolean. Take appropriate write barrier actions.<p>
+ *
+ * <b>By default do nothing, override if appropriate.</b>
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param value The value of the new boolean
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void booleanWrite(ObjectReference src, Address slot, boolean value, Word metaDataA, Word metaDataB, int mode) {
+ // Either: write barriers are used and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ }
+
+ /**
+ * Read a boolean. Take appropriate read barrier action, and
+ * return the value that was read.<p> This is a <b>substituting<b>
+ * barrier. The call to this barrier takes the place of a load.<p>
+ *
+ * @param src The object reference holding the field being read.
+ * @param slot The address of the slot being read.
+ * @param metaDataA A value that assists the host VM in creating a load
+ * @param metaDataB A value that assists the host VM in creating a load
+ * @param mode The context in which the load occurred
+ * @return The boolean that was read.
+ */
+ @Inline
+ public boolean booleanRead(ObjectReference src, Address slot, Word metaDataA, Word metaDataB, int mode) {
+ // Either: read barriers are used and this is overridden, or
+ // read barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return false;
+ }
+
+ /**
+ * A number of booleans are about to be copied from object
+ * <code>src</code> to object <code>dst</code> (as in an array
+ * copy). Thus, <code>dst</code> is the mutated object. Take
+ * appropriate write barrier actions.<p>
+ *
+ * @param src The source array
+ * @param srcOffset The starting source offset
+ * @param dst The destination array
+ * @param dstOffset The starting destination offset
+ * @param bytes The number of bytes to be copied
+ * @return True if the update was performed by the barrier, false if
+ * left to the caller (always false in this case).
+ */
+ public boolean booleanBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) {
+ // Either: bulk copy is supported and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return false;
+ }
+
+ /**
+ * Write a byte. Take appropriate write barrier actions.<p>
+ *
+ * <b>By default do nothing, override if appropriate.</b>
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param value The value of the new byte
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void byteWrite(ObjectReference src, Address slot, byte value, Word metaDataA, Word metaDataB, int mode) {
+ // Either: write barriers are used and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ }
+
+ /**
+ * Read a byte. Take appropriate read barrier action, and
+ * return the value that was read.<p> This is a <b>substituting<b>
+ * barrier. The call to this barrier takes the place of a load.<p>
+ *
+ * @param src The object reference holding the field being read.
+ * @param slot The address of the slot being read.
+ * @param metaDataA A value that assists the host VM in creating a load
+ * @param metaDataB A value that assists the host VM in creating a load
+ * @param mode The context in which the load occurred
+ * @return The byte that was read.
+ */
+ @Inline
+ public byte byteRead(ObjectReference src, Address slot, Word metaDataA, Word metaDataB, int mode) {
+ // Either: read barriers are used and this is overridden, or
+ // read barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return 0;
+ }
+
+ /**
+ * A number of bytes are about to be copied from object
+ * <code>src</code> to object <code>dst</code> (as in an array
+ * copy). Thus, <code>dst</code> is the mutated object. Take
+ * appropriate write barrier actions.<p>
+ *
+ * @param src The source array
+ * @param srcOffset The starting source offset
+ * @param dst The destination array
+ * @param dstOffset The starting destination offset
+ * @param bytes The number of bytes to be copied
+ * @return True if the update was performed by the barrier, false if
+ * left to the caller (always false in this case).
+ */
+ public boolean byteBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) {
+ // Either: bulk copy is supported and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return false;
+ }
+
+ /**
+ * Write a char. Take appropriate write barrier actions.<p>
+ *
+ * <b>By default do nothing, override if appropriate.</b>
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param value The value of the new char
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void charWrite(ObjectReference src, Address slot, char value, Word metaDataA, Word metaDataB, int mode) {
+ // Either: write barriers are used and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ }
+
+ /**
+ * Read a char. Take appropriate read barrier action, and
+ * return the value that was read.<p> This is a <b>substituting<b>
+ * barrier. The call to this barrier takes the place of a load.<p>
+ *
+ * @param src The object reference holding the field being read.
+ * @param slot The address of the slot being read.
+ * @param metaDataA A value that assists the host VM in creating a load
+ * @param metaDataB A value that assists the host VM in creating a load
+ * @param mode The context in which the load occurred
+ * @return The char that was read.
+ */
+ @Inline
+ public char charRead(ObjectReference src, Address slot, Word metaDataA, Word metaDataB, int mode) {
+ // Either: read barriers are used and this is overridden, or
+ // read barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return 0;
+ }
+
+ /**
+ * A number of chars are about to be copied from object
+ * <code>src</code> to object <code>dst</code> (as in an array
+ * copy). Thus, <code>dst</code> is the mutated object. Take
+ * appropriate write barrier actions.<p>
+ *
+ * @param src The source array
+ * @param srcOffset The starting source offset
+ * @param dst The destination array
+ * @param dstOffset The starting destination offset
+ * @param bytes The number of bytes to be copied
+ * @return True if the update was performed by the barrier, false if
+ * left to the caller (always false in this case).
+ */
+ public boolean charBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) {
+ // Either: bulk copy is supported and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return false;
+ }
+
+ /**
+ * Write a short. Take appropriate write barrier actions.<p>
+ *
+ * <b>By default do nothing, override if appropriate.</b>
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param value The value of the new short
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void shortWrite(ObjectReference src, Address slot, short value, Word metaDataA, Word metaDataB, int mode) {
+ // Either: write barriers are used and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ }
+
+ /**
+ * Read a short. Take appropriate read barrier action, and
+ * return the value that was read.<p> This is a <b>substituting<b>
+ * barrier. The call to this barrier takes the place of a load.<p>
+ *
+ * @param src The object reference holding the field being read.
+ * @param slot The address of the slot being read.
+ * @param metaDataA A value that assists the host VM in creating a load
+ * @param metaDataB A value that assists the host VM in creating a load
+ * @param mode The context in which the load occurred
+ * @return The short that was read.
+ */
+ @Inline
+ public short shortRead(ObjectReference src, Address slot, Word metaDataA, Word metaDataB, int mode) {
+ // Either: read barriers are used and this is overridden, or
+ // read barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return 0;
+ }
+
+ /**
+ * A number of shorts are about to be copied from object
+ * <code>src</code> to object <code>dst</code> (as in an array
+ * copy). Thus, <code>dst</code> is the mutated object. Take
+ * appropriate write barrier actions.<p>
+ *
+ * @param src The source array
+ * @param srcOffset The starting source offset
+ * @param dst The destination array
+ * @param dstOffset The starting destination offset
+ * @param bytes The number of bytes to be copied
+ * @return True if the update was performed by the barrier, false if
+ * left to the caller (always false in this case).
+ */
+ public boolean shortBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) {
+ // Either: bulk copy is supported and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return false;
+ }
+
+
+ /**
+ * Write a int. Take appropriate write barrier actions.<p>
+ *
+ * <b>By default do nothing, override if appropriate.</b>
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param value The value of the new int
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void intWrite(ObjectReference src, Address slot, int value, Word metaDataA, Word metaDataB, int mode) {
+ // Either: write barriers are used and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ }
+
+ /**
+ * Read a int. Take appropriate read barrier action, and
+ * return the value that was read.<p> This is a <b>substituting<b>
+ * barrier. The call to this barrier takes the place of a load.<p>
+ *
+ * @param src The object reference holding the field being read.
+ * @param slot The address of the slot being read.
+ * @param metaDataA A value that assists the host VM in creating a load
+ * @param metaDataB A value that assists the host VM in creating a load
+ * @param mode The context in which the load occurred
+ * @return The int that was read.
+ */
+ @Inline
+ public int intRead(ObjectReference src, Address slot, Word metaDataA, Word metaDataB, int mode) {
+ // Either: read barriers are used and this is overridden, or
+ // read barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return 0;
+ }
+
+ /**
+ * A number of ints are about to be copied from object
+ * <code>src</code> to object <code>dst</code> (as in an array
+ * copy). Thus, <code>dst</code> is the mutated object. Take
+ * appropriate write barrier actions.<p>
+ *
+ * @param src The source array
+ * @param srcOffset The starting source offset
+ * @param dst The destination array
+ * @param dstOffset The starting destination offset
+ * @param bytes The number of bytes to be copied
+ * @return True if the update was performed by the barrier, false if
+ * left to the caller (always false in this case).
+ */
+ public boolean intBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) {
+ // Either: bulk copy is supported and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return false;
+ }
+
+ /**
+ * Attempt to atomically exchange the value in the given slot
+ * with the passed replacement value.
+ *
+ * <b>By default do nothing, override if appropriate.</b>
+ *
+ * @param src The object into which the value will be stored
+ * @param slot The address into which the value will be
+ * stored.
+ * @param old The old int to be swapped out
+ * @param value The new int
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ * @return True if the swap was successful.
+ */
+ public boolean intTryCompareAndSwap(ObjectReference src, Address slot, int old, int value, Word metaDataA, Word metaDataB, int mode) {
+ // Either: write barriers are used and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return false;
+ }
+
+ /**
+ * Write a long. Take appropriate write barrier actions.<p>
+ *
+ * <b>By default do nothing, override if appropriate.</b>
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param value The value of the new long
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void longWrite(ObjectReference src, Address slot, long value, Word metaDataA, Word metaDataB, int mode) {
+ // Either: write barriers are used and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ }
+
+ /**
+ * Read a long. Take appropriate read barrier action, and
+ * return the value that was read.<p> This is a <b>substituting<b>
+ * barrier. The call to this barrier takes the place of a load.<p>
+ *
+ * @param src The object reference holding the field being read.
+ * @param slot The address of the slot being read.
+ * @param metaDataA A value that assists the host VM in creating a load
+ * @param metaDataB A value that assists the host VM in creating a load
+ * @param mode The context in which the load occurred
+ * @return The long that was read.
+ */
+ @Inline
+ public long longRead(ObjectReference src, Address slot, Word metaDataA, Word metaDataB, int mode) {
+ // Either: read barriers are used and this is overridden, or
+ // read barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return 0;
+ }
+
+ /**
+ * A number of longs are about to be copied from object
+ * <code>src</code> to object <code>dst</code> (as in an array
+ * copy). Thus, <code>dst</code> is the mutated object. Take
+ * appropriate write barrier actions.<p>
+ *
+ * @param src The source array
+ * @param srcOffset The starting source offset
+ * @param dst The destination array
+ * @param dstOffset The starting destination offset
+ * @param bytes The number of bytes to be copied
+ * @return True if the update was performed by the barrier, false if
+ * left to the caller (always false in this case).
+ */
+ public boolean longBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) {
+ // Either: bulk copy is supported and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return false;
+ }
+
+ /**
+ * Attempt to atomically exchange the value in the given slot
+ * with the passed replacement value.
+ *
+ * <b>By default do nothing, override if appropriate.</b>
+ *
+ * @param src The object into which the value will be stored
+ * @param slot The address into which the value will be
+ * stored.
+ * @param old The old long to be swapped out
+ * @param value The new long
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ * @return True if the swap was successful.
+ */
+ public boolean longTryCompareAndSwap(ObjectReference src, Address slot, long old, long value, Word metaDataA, Word metaDataB, int mode) {
+ // Either: write barriers are used and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return false;
+ }
+
+ /**
+ * Write a float. Take appropriate write barrier actions.<p>
+ *
+ * <b>By default do nothing, override if appropriate.</b>
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param value The value of the new float
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void floatWrite(ObjectReference src, Address slot, float value, Word metaDataA, Word metaDataB, int mode) {
+ // Either: write barriers are used and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ }
+
+ /**
+ * Read a float. Take appropriate read barrier action, and
+ * return the value that was read.<p> This is a <b>substituting<b>
+ * barrier. The call to this barrier takes the place of a load.<p>
+ *
+ * @param src The object reference holding the field being read.
+ * @param slot The address of the slot being read.
+ * @param metaDataA A value that assists the host VM in creating a load
+ * @param metaDataB A value that assists the host VM in creating a load
+ * @param mode The context in which the load occurred
+ * @return The float that was read.
+ */
+ @Inline
+ public float floatRead(ObjectReference src, Address slot, Word metaDataA, Word metaDataB, int mode) {
+ // Either: read barriers are used and this is overridden, or
+ // read barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return 0;
+ }
+
+ /**
+ * A number of floats are about to be copied from object
+ * <code>src</code> to object <code>dst</code> (as in an array
+ * copy). Thus, <code>dst</code> is the mutated object. Take
+ * appropriate write barrier actions.<p>
+ *
+ * @param src The source array
+ * @param srcOffset The starting source offset
+ * @param dst The destination array
+ * @param dstOffset The starting destination offset
+ * @param bytes The number of bytes to be copied
+ * @return True if the update was performed by the barrier, false if
+ * left to the caller (always false in this case).
+ */
+ public boolean floatBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) {
+ // Either: bulk copy is supported and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return false;
+ }
+
+ /**
+ * Write a double. Take appropriate write barrier actions.<p>
+ *
+ * <b>By default do nothing, override if appropriate.</b>
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param value The value of the new double
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void doubleWrite(ObjectReference src, Address slot, double value, Word metaDataA, Word metaDataB, int mode) {
+ // Either: write barriers are used and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ }
+
+ /**
+ * Read a double. Take appropriate read barrier action, and
+ * return the value that was read.<p> This is a <b>substituting<b>
+ * barrier. The call to this barrier takes the place of a load.<p>
+ *
+ * @param src The object reference holding the field being read.
+ * @param slot The address of the slot being read.
+ * @param metaDataA A value that assists the host VM in creating a load
+ * @param metaDataB A value that assists the host VM in creating a load
+ * @param mode The context in which the load occurred
+ * @return The double that was read.
+ */
+ @Inline
+ public double doubleRead(ObjectReference src, Address slot, Word metaDataA, Word metaDataB, int mode) {
+ // Either: read barriers are used and this is overridden, or
+ // read barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return 0;
+ }
+
+ /**
+ * A number of doubles are about to be copied from object
+ * <code>src</code> to object <code>dst</code> (as in an array
+ * copy). Thus, <code>dst</code> is the mutated object. Take
+ * appropriate write barrier actions.<p>
+ *
+ * @param src The source array
+ * @param srcOffset The starting source offset
+ * @param dst The destination array
+ * @param dstOffset The starting destination offset
+ * @param bytes The number of bytes to be copied
+ * @return True if the update was performed by the barrier, false if
+ * left to the caller (always false in this case).
+ */
+ public boolean doubleBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) {
+ // Either: bulk copy is supported and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return false;
+ }
+
+ /**
+ * Write a Word. Take appropriate write barrier actions.<p>
*
* <b>By default do nothing, override if appropriate.</b>
*
* @param src The object into which the new reference will be stored
* @param slot The address into which the new reference will be
* stored.
- * @param tgt The target of the new reference
+ * @param value The value of the new Word
* @param metaDataA A value that assists the host VM in creating a store
* @param metaDataB A value that assists the host VM in creating a store
* @param mode The context in which the store occurred
*/
- public void writeBarrier(ObjectReference src, Address slot,
- ObjectReference tgt, Word metaDataA,
- Word metaDataB, int mode) {
+ public void wordWrite(ObjectReference src, Address slot, Word value, Word metaDataA, Word metaDataB, int mode) {
// Either: write barriers are used and this is overridden, or
// write barriers are not used and this is never called
if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
}
/**
+ * Read a Word. Take appropriate read barrier action, and
+ * return the value that was read.<p> This is a <b>substituting<b>
+ * barrier. The call to this barrier takes the place of a load.<p>
+ *
+ * @param src The object reference holding the field being read.
+ * @param slot The address of the slot being read.
+ * @param metaDataA A value that assists the host VM in creating a load
+ * @param metaDataB A value that assists the host VM in creating a load
+ * @param mode The context in which the load occurred
+ * @return The Word that was read.
+ */
+ @Inline
+ public Word wordRead(ObjectReference src, Address slot, Word metaDataA, Word metaDataB, int mode) {
+ // Either: read barriers are used and this is overridden, or
+ // read barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return Word.zero();
+ }
+
+ /**
+ * A number of Words are about to be copied from object
+ * <code>src</code> to object <code>dst</code> (as in an array
+ * copy). Thus, <code>dst</code> is the mutated object. Take
+ * appropriate write barrier actions.<p>
+ *
+ * @param src The source array
+ * @param srcOffset The starting source offset
+ * @param dst The destination array
+ * @param dstOffset The starting destination offset
+ * @param bytes The number of bytes to be copied
+ * @return True if the update was performed by the barrier, false if
+ * left to the caller (always false in this case).
+ */
+ public boolean wordBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) {
+ // Either: bulk copy is supported and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return false;
+ }
+
+ /**
* Attempt to atomically exchange the value in the given slot
- * with the passed replacement value. If a new reference is
- * created, we must then take appropriate write barrier actions.<p>
+ * with the passed replacement value.
*
* <b>By default do nothing, override if appropriate.</b>
*
* @param src The object into which the new reference will be stored
* @param slot The address into which the new reference will be
* stored.
- * @param old The old reference to be swapped out
- * @param tgt The target of the new reference
+ * @param old The old Word to be swapped out
+ * @param value The new Word
* @param metaDataA A value that assists the host VM in creating a store
* @param metaDataB A value that assists the host VM in creating a store
* @param mode The context in which the store occurred
* @return True if the swap was successful.
*/
- public boolean tryCompareAndSwapWriteBarrier(ObjectReference src, Address slot,
- ObjectReference old, ObjectReference tgt, Word metaDataA,
- Word metaDataB, int mode) {
+ public boolean wordTryCompareAndSwap(ObjectReference src, Address slot, Word old, Word value, Word metaDataA, Word metaDataB, int mode) {
// Either: write barriers are used and this is overridden, or
// write barriers are not used and this is never called
if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
@@ -315,26 +892,82 @@
}
/**
- * A number of references are about to be copied from object
+ * Write an Address. Take appropriate write barrier actions.<p>
+ *
+ * <b>By default do nothing, override if appropriate.</b>
+ *
+ * @param src The object into which the Word will be stored
+ * @param slot The address into which the Word will be
+ * stored.
+ * @param value The value of the new Address
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void addressWrite(ObjectReference src, Address slot, Address value, Word metaDataA, Word metaDataB, int mode) {
+ // Either: write barriers are used and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ }
+
+ /**
+ * Read an Address. Take appropriate read barrier action, and
+ * return the value that was read.<p> This is a <b>substituting<b>
+ * barrier. The call to this barrier takes the place of a load.<p>
+ *
+ * @param src The object reference holding the field being read.
+ * @param slot The address of the slot being read.
+ * @param metaDataA A value that assists the host VM in creating a load
+ * @param metaDataB A value that assists the host VM in creating a load
+ * @param mode The context in which the load occurred
+ * @return The Address that was read.
+ */
+ @Inline
+ public Address addressRead(ObjectReference src, Address slot, Word metaDataA, Word metaDataB, int mode) {
+ // Either: read barriers are used and this is overridden, or
+ // read barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return Address.zero();
+ }
+
+ /**
+ * A number of Addresse's are about to be copied from object
* <code>src</code> to object <code>dst</code> (as in an array
* copy). Thus, <code>dst</code> is the mutated object. Take
* appropriate write barrier actions.<p>
*
- * @param src The source of the values to be copied
- * @param srcOffset The offset of the first source address, in
- * bytes, relative to <code>src</code> (in principle, this could be
- * negative).
- * @param dst The mutated object, i.e. the destination of the copy.
- * @param dstOffset The offset of the first destination address, in
- * bytes relative to <code>tgt</code> (in principle, this could be
- * negative).
- * @param bytes The size of the region being copied, in bytes.
+ * @param src The source array
+ * @param srcOffset The starting source offset
+ * @param dst The destination array
+ * @param dstOffset The starting destination offset
+ * @param bytes The number of bytes to be copied
* @return True if the update was performed by the barrier, false if
* left to the caller (always false in this case).
*/
- public boolean writeBarrier(ObjectReference src, Offset srcOffset,
- ObjectReference dst, Offset dstOffset,
- int bytes) {
+ public boolean addressBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) {
+ // Either: bulk copy is supported and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return false;
+ }
+
+ /**
+ * Attempt to atomically exchange the value in the given slot
+ * with the passed replacement value.
+ *
+ * <b>By default do nothing, override if appropriate.</b>
+ *
+ * @param src The object into which the Address will be stored
+ * @param slot The address into which the Address will be
+ * stored.
+ * @param old The old Address to be swapped out
+ * @param value The new Address
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ * @return True if the swap was successful.
+ */
+ public boolean addressTryCompareAndSwap(ObjectReference src, Address slot, Address old, Address value, Word metaDataA, Word metaDataB, int mode) {
// Either: write barriers are used and this is overridden, or
// write barriers are not used and this is never called
if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
@@ -342,22 +975,146 @@
}
/**
- * Read a reference type. In a concurrent collector this may
- * involve adding the referent to the marking queue.
+ * Write an Extent. Take appropriate write barrier actions.<p>
*
- * @param referent The referent being read.
- * @return The new referent.
+ * <b>By default do nothing, override if appropriate.</b>
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param value The value of the new Extent
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void extentWrite(ObjectReference src, Address slot, Extent value, Word metaDataA, Word metaDataB, int mode) {
+ // Either: write barriers are used and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ }
+
+ /**
+ * Read an Extent. Take appropriate read barrier action, and
+ * return the value that was read.<p> This is a <b>substituting<b>
+ * barrier. The call to this barrier takes the place of a load.<p>
+ *
+ * @param src The object reference holding the field being read.
+ * @param slot The address of the slot being read.
+ * @param metaDataA A value that assists the host VM in creating a load
+ * @param metaDataB A value that assists the host VM in creating a load
+ * @param mode The context in which the load occurred
+ * @return The Extent that was read.
*/
@Inline
- public ObjectReference referenceTypeReadBarrier(ObjectReference referent) {
+ public Extent extentRead(ObjectReference src, Address slot, Word metaDataA, Word metaDataB, int mode) {
// Either: read barriers are used and this is overridden, or
// read barriers are not used and this is never called
if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
- return ObjectReference.nullReference();
+ return Extent.zero();
+ }
+
+ /**
+ * A number of Extents are about to be copied from object
+ * <code>src</code> to object <code>dst</code> (as in an array
+ * copy). Thus, <code>dst</code> is the mutated object. Take
+ * appropriate write barrier actions.<p>
+ *
+ * @param src The source array
+ * @param srcOffset The starting source offset
+ * @param dst The destination array
+ * @param dstOffset The starting destination offset
+ * @param bytes The number of bytes to be copied
+ * @return True if the update was performed by the barrier, false if
+ * left to the caller (always false in this case).
+ */
+ public boolean extentBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) {
+ // Either: bulk copy is supported and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return false;
+ }
+
+ /**
+ * Write an Offset. Take appropriate write barrier actions.<p>
+ *
+ * <b>By default do nothing, override if appropriate.</b>
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param value The value of the new Offset
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void offsetWrite(ObjectReference src, Address slot, Offset value, Word metaDataA, Word metaDataB, int mode) {
+ // Either: write barriers are used and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ }
+
+ /**
+ * Read an Offset. Take appropriate read barrier action, and
+ * return the value that was read.<p> This is a <b>substituting<b>
+ * barrier. The call to this barrier takes the place of a load.<p>
+ *
+ * @param src The object reference holding the field being read.
+ * @param slot The address of the slot being read.
+ * @param metaDataA A value that assists the host VM in creating a load
+ * @param metaDataB A value that assists the host VM in creating a load
+ * @param mode The context in which the load occurred
+ * @return The Offset that was read.
+ */
+ @Inline
+ public Offset offsetRead(ObjectReference src, Address slot, Word metaDataA, Word metaDataB, int mode) {
+ // Either: read barriers are used and this is overridden, or
+ // read barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return Offset.zero();
+ }
+
+ /**
+ * A number of Offsets are about to be copied from object
+ * <code>src</code> to object <code>dst</code> (as in an array
+ * copy). Thus, <code>dst</code> is the mutated object. Take
+ * appropriate write barrier actions.<p>
+ *
+ * @param src The source array
+ * @param srcOffset The starting source offset
+ * @param dst The destination array
+ * @param dstOffset The starting destination offset
+ * @param bytes The number of bytes to be copied
+ * @return True if the update was performed by the barrier, false if
+ * left to the caller (always false in this case).
+ */
+ public boolean offsetBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) {
+ // Either: bulk copy is supported and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return false;
+ }
+
+ /**
+ * Write an object reference. Take appropriate write barrier actions.<p>
+ *
+ * <b>By default do nothing, override if appropriate.</b>
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param value The value of the new reference
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void objectReferenceWrite(ObjectReference src, Address slot, ObjectReference value, Word metaDataA, Word metaDataB, int mode) {
+ // Either: write barriers are used and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
}
/**
- * Read a reference. Take appropriate read barrier action, and
+ * Read an object reference. Take appropriate read barrier action, and
* return the value that was read.<p> This is a <b>substituting<b>
* barrier. The call to this barrier takes the place of a load.<p>
*
@@ -369,7 +1126,65 @@
* @return The reference that was read.
*/
@Inline
- public ObjectReference readBarrier(ObjectReference src, Address slot, Word metaDataA, Word metaDataB, int mode) {
+ public ObjectReference objectReferenceRead(ObjectReference src, Address slot, Word metaDataA, Word metaDataB, int mode) {
+ // Either: read barriers are used and this is overridden, or
+ // read barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return ObjectReference.nullReference();
+ }
+
+ /**
+ * A number of references are about to be copied from object
+ * <code>src</code> to object <code>dst</code> (as in an array
+ * copy). Thus, <code>dst</code> is the mutated object. Take
+ * appropriate write barrier actions.<p>
+ *
+ * @param src The source array
+ * @param srcOffset The starting source offset
+ * @param dst The destination array
+ * @param dstOffset The starting destination offset
+ * @param bytes The number of bytes to be copied
+ * @return True if the update was performed by the barrier, false if
+ * left to the caller (always false in this case).
+ */
+ public boolean objectReferenceBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) {
+ // Either: bulk copy is supported and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return false;
+ }
+
+
+ /**
+ * A new reference is about to be created in a location that is not
+ * a regular heap object. Take appropriate write barrier actions.<p>
+ *
+ * <b>By default do nothing, override if appropriate.</b>
+ *
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param tgt The target of the new reference
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ */
+ public void objectReferenceNonHeapWrite(Address slot, ObjectReference tgt, Word metaDataA, Word metaDataB) {
+ // Either: write barriers are used and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ }
+
+ /**
+ * Read an object reference. Take appropriate read barrier action, and
+ * return the value that was read.<p> This is a <b>substituting<b>
+ * barrier. The call to this barrier takes the place of a load.<p>
+ *
+ * @param slot The address of the slot being read.
+ * @param metaDataA A value that assists the host VM in creating a load
+ * @param metaDataB A value that assists the host VM in creating a load
+ * @return The reference that was read.
+ */
+ @Inline
+ public ObjectReference objectReferenceNonHeapRead(Address slot, Word metaDataA, Word metaDataB) {
// Either: read barriers are used and this is overridden, or
// read barriers are not used and this is never called
if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
@@ -377,6 +1192,30 @@
}
/**
+ * Attempt to atomically exchange the value in the given slot
+ * with the passed replacement value. If a new reference is
+ * created, we must then take appropriate write barrier actions.<p>
+ *
+ * <b>By default do nothing, override if appropriate.</b>
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param old The old reference to be swapped out
+ * @param tgt The target of the new reference
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ * @return True if the swap was successful.
+ */
+ public boolean objectReferenceTryCompareAndSwap(ObjectReference src, Address slot, ObjectReference old, ObjectReference tgt, Word metaDataA, Word metaDataB, int mode) {
+ // Either: write barriers are used and this is overridden, or
+ // write barriers are not used and this is never called
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ return false;
+ }
+
+ /**
* Flush mutator context, in response to a requestMutatorFlush.
* Also called by the default implementation of deinitMutator.
*/
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/Plan.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/Plan.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/Plan.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/Plan.java Sat Aug 14 07:25:41 2010
@@ -26,7 +26,6 @@
import org.mmtk.utility.Log;
import org.mmtk.utility.options.*;
import org.mmtk.utility.sanitychecker.SanityChecker;
-import org.mmtk.utility.statistics.PerfCounter;
import org.mmtk.utility.statistics.Timer;
import org.mmtk.utility.statistics.Stats;
@@ -110,9 +109,6 @@
/* Do we support a log bit in the object header? Some write barriers may use it */
public static final boolean NEEDS_LOG_BIT_IN_HEADER = VM.activePlan.constraints().needsLogBitInHeader();
- public static final Word LOG_SET_MASK = VM.activePlan.constraints().unloggedBit();
- private static final Word LOG_CLEAR_MASK = LOG_SET_MASK.not();
- public static final Word UNLOGGED_BIT = VM.activePlan.constraints().unloggedBit();
/****************************************************************************
* Class variables
@@ -152,9 +148,6 @@
/** Timer that counts total time */
public static final Timer totalTime = new Timer("time");
- /** Performance counters */
- public static final PerfCounter totalPerfCnt = new PerfCounter("perf");
-
/** Support for time-limited GCs */
protected static long timeCap;
@@ -183,7 +176,7 @@
Options.eagerMmapSpaces = new EagerMmapSpaces();
Options.sanityCheck = new SanityCheck();
Options.debugAddress = new DebugAddress();
- Options.perfMetric = new PerfMetric();
+ Options.perfEvents = new PerfEvents();
Map.finalizeStaticSpaceMap();
registerSpecializedMethods();
}
@@ -211,7 +204,7 @@
*/
@Interruptible
public void postBoot() {
- VM.statistics.perfCtrInit(Options.perfMetric.getValue());
+ VM.statistics.perfEventInit(Options.perfEvents.getValue());
if (Options.verbose.getValue() > 2) Space.printVMMap();
if (Options.verbose.getValue() > 3) VM.config.printConfig();
if (Options.verbose.getValue() > 0) Stats.startAll();
@@ -257,26 +250,6 @@
protected void printDetailedTiming(boolean totals) {}
/**
- * Perform any required initialization of the GC portion of the header.
- * Called for objects created at boot time.
- *
- * @param ref the object ref to the storage to be initialized
- * @param typeRef the type reference for the instance being created
- * @param size the number of bytes allocated by the GC system for
- * this object.
- * @param status the initial value of the status word
- * @return The new value of the status word
- */
- @Inline
- public Word setBootTimeGCBits(Address ref, ObjectReference typeRef,
- int size, Word status) {
- if (NEEDS_LOG_BIT_IN_HEADER)
- return status.or(UNLOGGED_BIT);
- else
- return status; // nothing to do (no bytes of GC header)
- }
-
- /**
* Perform any required write barrier action when installing an object reference
* a boot time.
*
@@ -992,46 +965,6 @@
}
/****************************************************************************
- * Support for logging bits (this is cross-cutting).
- */
-
- /**
- * Return true if the specified object needs to be logged.
- *
- * @param src The object in question
- * @return True if the object in question needs to be logged (remembered).
- */
- public static final boolean logRequired(ObjectReference src) {
- int value = VM.objectModel.readAvailableByte(src);
- return !((value & LOG_SET_MASK.toInt()) == 0);
- }
-
- /**
- * Mark an object as logged. Since duplicate logging does
- * not raise any correctness issues, we do <i>not</i> worry
- * about synchronization and allow threads to race to log the
- * object, potentially including it twice (unlike reference
- * counting where duplicates would lead to incorrect reference
- * counts).
- *
- * @param object The object to be marked as logged
- */
- public static final void markAsLogged(ObjectReference object) {
- int value = VM.objectModel.readAvailableByte(object);
- VM.objectModel.writeAvailableByte(object, (byte) (value & LOG_CLEAR_MASK.toInt()));
- }
-
- /**
- * Mark an object as unlogged.
- *
- * @param object The object to be marked as unlogged
- */
- public static final void markAsUnlogged(ObjectReference object) {
- int value = VM.objectModel.readAvailableByte(object);
- VM.objectModel.writeAvailableByte(object, (byte) (value | UNLOGGED_BIT.toInt()));
- }
-
- /****************************************************************************
* Specialized Methods
*/
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/PlanConstraints.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/PlanConstraints.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/PlanConstraints.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/PlanConstraints.java Sat Aug 14 07:25:41 2010
@@ -14,7 +14,6 @@
import org.mmtk.policy.SegregatedFreeListSpace;
import org.vmmagic.pragma.*;
-import org.vmmagic.unboxed.Word;
/**
* This class and its subclasses communicate to the host VM/Runtime
@@ -23,20 +22,131 @@
* issues with ordering of static initialization.
*/
@Uninterruptible public abstract class PlanConstraints {
- /** @return True if this Plan requires write barriers. */
- public boolean needsWriteBarrier() { return false; }
+ /** @return True if this Plan requires read barriers on java.lang.reference types. */
+ public boolean needsJavaLangReferenceReadBarrier() { return false; }
- /** @return True of this Plan requires read barriers on reference types. */
- public boolean needsReferenceTypeReadBarrier() { return false; }
+ /** @return True if this Plan requires write barriers on booleans. */
+ public boolean needsBooleanWriteBarrier() { return false; }
- /** @return True of this Plan requires read barriers. */
- public boolean needsReadBarrier() { return false; }
+ /** @return True if this Plan requires read barriers on booleans. */
+ public boolean needsBooleanReadBarrier() { return false; }
- /** @return True if this Plan requires static write barriers. */
- public boolean needsStaticWriteBarrier() { return false;}
+ /** @return True if this Plan can perform bulk boolean arraycopy barriers. */
+ public boolean booleanBulkCopySupported() { return false; }
- /** @return True if this Plan requires static read barriers. */
- public boolean needsStaticReadBarrier() { return false; }
+ /** @return True if this Plan requires write barriers on bytes. */
+ public boolean needsByteWriteBarrier() { return false; }
+
+ /** @return True if this Plan requires read barriers on bytes. */
+ public boolean needsByteReadBarrier() { return false; }
+
+ /** @return True if this Plan can perform bulk byte arraycopy barriers. */
+ public boolean byteBulkCopySupported() { return false; }
+
+ /** @return True if this Plan requires write barriers on chars. */
+ public boolean needsCharWriteBarrier() { return false; }
+
+ /** @return True if this Plan requires read barriers on chars. */
+ public boolean needsCharReadBarrier() { return false; }
+
+ /** @return True if this Plan can perform bulk char arraycopy barriers. */
+ public boolean charBulkCopySupported() { return false; }
+
+ /** @return True if this Plan requires write barriers on shorts. */
+ public boolean needsShortWriteBarrier() { return false; }
+
+ /** @return True if this Plan requires read barriers on shorts. */
+ public boolean needsShortReadBarrier() { return false; }
+
+ /** @return True if this Plan can perform bulk short arraycopy barriers. */
+ public boolean shortBulkCopySupported() { return false; }
+
+ /** @return True if this Plan requires write barriers on ints. */
+ public boolean needsIntWriteBarrier() { return false; }
+
+ /** @return True if this Plan requires read barriers on ints. */
+ public boolean needsIntReadBarrier() { return false; }
+
+ /** @return True if this Plan can perform bulk int arraycopy barriers. */
+ public boolean intBulkCopySupported() { return false; }
+
+ /** @return True if this Plan requires write barriers on longs. */
+ public boolean needsLongWriteBarrier() { return false; }
+
+ /** @return True if this Plan requires read barriers on longs. */
+ public boolean needsLongReadBarrier() { return false; }
+
+ /** @return True if this Plan can perform bulk long arraycopy barriers. */
+ public boolean longBulkCopySupported() { return false; }
+
+ /** @return True if this Plan requires write barriers on floats. */
+ public boolean needsFloatWriteBarrier() { return false; }
+
+ /** @return True if this Plan requires read barriers on floats. */
+ public boolean needsFloatReadBarrier() { return false; }
+
+ /** @return True if this Plan can perform bulk float arraycopy barriers. */
+ public boolean floatBulkCopySupported() { return false; }
+
+ /** @return True if this Plan requires write barriers on doubles. */
+ public boolean needsDoubleWriteBarrier() { return false; }
+
+ /** @return True if this Plan requires read barriers on doubles. */
+ public boolean needsDoubleReadBarrier() { return false; }
+
+ /** @return True if this Plan can perform bulk double arraycopy barriers. */
+ public boolean doubleBulkCopySupported() { return false; }
+
+ /** @return True if this Plan requires write barriers on Words. */
+ public boolean needsWordWriteBarrier() { return false; }
+
+ /** @return True if this Plan requires read barriers on Words. */
+ public boolean needsWordReadBarrier() { return false; }
+
+ /** @return True if this Plan can perform bulk Word arraycopy barriers. */
+ public boolean wordBulkCopySupported() { return false; }
+
+ /** @return True if this Plan requires write barriers on Address's. */
+ public boolean needsAddressWriteBarrier() { return false; }
+
+ /** @return True if this Plan requires read barriers on Address's. */
+ public boolean needsAddressReadBarrier() { return false; }
+
+ /** @return True if this Plan can perform bulk Address arraycopy barriers. */
+ public boolean addressBulkCopySupported() { return false; }
+
+ /** @return True if this Plan requires write barriers on Extents. */
+ public boolean needsExtentWriteBarrier() { return false; }
+
+ /** @return True if this Plan requires read barriers on Extents. */
+ public boolean needsExtentReadBarrier() { return false; }
+
+ /** @return True if this Plan can perform bulk Extent arraycopy barriers. */
+ public boolean extentBulkCopySupported() { return false; }
+
+ /** @return True if this Plan requires write barriers on Offsets. */
+ public boolean needsOffsetWriteBarrier() { return false; }
+
+ /** @return True if this Plan requires read barriers on Offsets. */
+ public boolean needsOffsetReadBarrier() { return false; }
+
+ /** @return True if this Plan can perform bulk Offset arraycopy barriers. */
+ public boolean offsetBulkCopySupported() { return false; }
+
+ /** @return True if this Plan requires write barriers on object references. */
+ public boolean needsObjectReferenceWriteBarrier() { return false; }
+
+ /** @return True if this Plan requires read barriers on object references. */
+ public boolean needsObjectReferenceReadBarrier() { return false; }
+
+ /** @return True if this Plan requires non-heap write barriers on object references. */
+ public boolean needsObjectReferenceNonHeapWriteBarrier() { return false;}
+
+ /** @return True if this Plan requires non-heap read barriers on object references. */
+ public boolean needsObjectReferenceNonHeapReadBarrier() { return false; }
+
+ /** @return True if this Plan can perform bulk object arraycopy barriers. */
+ public boolean objectReferenceBulkCopySupported() { return false; }
/** @return True if this Plan requires linear scanning. */
public boolean needsLinearScan() { return org.mmtk.utility.Constants.SUPPORT_CARD_SCANNING;}
@@ -83,10 +193,4 @@
/** @return True if this Plan requires a header bit for object logging */
public boolean needsLogBitInHeader() { return false; }
-
- /** @return A bit which represents that a header is unlogged */
- public Word unloggedBit() {return Word.zero(); }
-
- /** @return A bit which represents that a header is unlogged */
- public Word logSetBitMask() {return Word.zero(); }
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/SimpleMutator.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/SimpleMutator.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/SimpleMutator.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/SimpleMutator.java Sat Aug 14 07:25:41 2010
@@ -56,12 +56,18 @@
if (phaseId == Simple.PREPARE) {
los.prepare(true);
+ lgcode.prepare(true);
+ smcode.prepare();
+ nonmove.prepare();
VM.memory.collectorPrepareVMSpace();
return;
}
if (phaseId == Simple.RELEASE) {
los.release(true);
+ lgcode.release(true);
+ smcode.release();
+ nonmove.release();
VM.memory.collectorReleaseVMSpace();
return;
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/Gen.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/Gen.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/Gen.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/Gen.java Sat Aug 14 07:25:41 2010
@@ -56,11 +56,16 @@
protected static final float MATURE_FRACTION = 0.5f; // est yield
private static final float WORST_CASE_COPY_EXPANSION = 1.5f; // worst case for addition of one word overhead due to address based hashing
public static final boolean IGNORE_REMSETS = false;
- public static final boolean USE_STATIC_WRITE_BARRIER = false;
+ public static final boolean USE_NON_HEAP_OBJECT_REFERENCE_WRITE_BARRIER = false;
public static final boolean USE_OBJECT_BARRIER_FOR_AASTORE = false; // choose between slot and object barriers
public static final boolean USE_OBJECT_BARRIER_FOR_PUTFIELD = false; // choose between slot and object barriers
public static final boolean USE_OBJECT_BARRIER = USE_OBJECT_BARRIER_FOR_AASTORE || USE_OBJECT_BARRIER_FOR_PUTFIELD;
- private static final boolean USE_DISCONTIGUOUS_NURSERY = false;
+
+ /** Fraction of available virtual memory to give to the nursery (if contiguous) */
+ protected static final float NURSERY_VM_FRACTION = 0.15f;
+
+ /** Switch between a contiguous and discontiguous nursery (experimental) */
+ static final boolean USE_DISCONTIGUOUS_NURSERY = false;
// Allocators
public static final int ALLOC_NURSERY = ALLOC_DEFAULT;
@@ -85,12 +90,11 @@
public static final SizeCounter nurseryCons;
/** The nursery space is where all new objects are allocated by default */
- private static final VMRequest vmRequest = USE_DISCONTIGUOUS_NURSERY ? VMRequest.create() : VMRequest.create(0.15f, true);
+ private static final VMRequest vmRequest = USE_DISCONTIGUOUS_NURSERY ? VMRequest.create() : VMRequest.create(NURSERY_VM_FRACTION, true);
public static final CopySpace nurserySpace = new CopySpace("nursery", DEFAULT_POLL_FREQUENCY, false, vmRequest);
public static final int NURSERY = nurserySpace.getDescriptor();
private static final Address NURSERY_START = nurserySpace.getStart();
- protected static final int MAX_NURSERY_ALLOC_BYTES = USE_DISCONTIGUOUS_NURSERY ? org.mmtk.utility.Constants.MAX_INT : nurserySpace.getExtent().toInt();
/*****************************************************************************
*
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenCollector.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenCollector.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenCollector.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenCollector.java Sat Aug 14 07:25:41 2010
@@ -95,7 +95,7 @@
if (phaseId == StopTheWorld.ROOTS) {
VM.scanning.computeGlobalRoots(getCurrentTrace());
- if (!Gen.USE_STATIC_WRITE_BARRIER || global().traceFullHeap()) {
+ if (!Gen.USE_NON_HEAP_OBJECT_REFERENCE_WRITE_BARRIER || global().traceFullHeap()) {
VM.scanning.computeStaticRoots(getCurrentTrace());
}
if (Plan.SCAN_BOOT_IMAGE && global().traceFullHeap()) {
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenConstraints.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenConstraints.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenConstraints.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenConstraints.java Sat Aug 14 07:25:41 2010
@@ -15,10 +15,9 @@
import org.mmtk.plan.StopTheWorldConstraints;
import org.mmtk.policy.CopySpace;
-import org.mmtk.policy.MarkSweepSpace;
+import org.mmtk.policy.Space;
import org.vmmagic.pragma.*;
-import org.vmmagic.unboxed.Word;
/**
* This class and its subclasses communicate to the host VM/Runtime
@@ -47,11 +46,15 @@
/** @return True if this plan requires a write barrier */
@Override
- public boolean needsWriteBarrier() { return true; }
+ public boolean needsObjectReferenceWriteBarrier() { return true; }
/** @return True if this plan requires a static barrier */
@Override
- public boolean needsStaticWriteBarrier() { return Gen.USE_STATIC_WRITE_BARRIER; }
+ public boolean needsObjectReferenceNonHeapWriteBarrier() { return Gen.USE_NON_HEAP_OBJECT_REFERENCE_WRITE_BARRIER; }
+
+ /** @return True if this Plan can perform bulk object arraycopy barriers. */
+ @Override
+ public boolean objectReferenceBulkCopySupported() { return true; }
/** @return The specialized scan methods required */
@Override
@@ -61,12 +64,19 @@
@Override
public boolean needsLogBitInHeader() { return Gen.USE_OBJECT_BARRIER; }
- /** @return A bit which represents that a header is unlogged */
- @Override
- public Word unloggedBit() {return MarkSweepSpace.UNLOGGED_BIT; }
-
- /** @return The maximum size of an object that may be allocated directly into the nursery */
- @Override
- public int maxNonLOSDefaultAllocBytes() { return Gen.MAX_NURSERY_ALLOC_BYTES; }
+ /**
+ * @return The maximum size of an object that may be allocated directly into the nursery
+ */
+ @Override
+ public int maxNonLOSDefaultAllocBytes() {
+ /*
+ * If the nursery is discontiguous, the maximum object is essentially unbounded. In
+ * a contiguous nursery, we can't attempt to nursery-allocate objects larger than the
+ * available nursery virtual memory.
+ */
+ return Gen.USE_DISCONTIGUOUS_NURSERY ?
+ org.mmtk.utility.Constants.MAX_INT :
+ Space.getFracAvailable(Gen.NURSERY_VM_FRACTION).toInt();
+ }
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenMatureTraceLocal.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenMatureTraceLocal.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenMatureTraceLocal.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenMatureTraceLocal.java Sat Aug 14 07:25:41 2010
@@ -12,9 +12,9 @@
*/
package org.mmtk.plan.generational;
-import org.mmtk.plan.Plan;
import org.mmtk.plan.TraceLocal;
import org.mmtk.plan.Trace;
+import org.mmtk.utility.HeaderByte;
import org.mmtk.utility.deque.*;
import org.mmtk.vm.VM;
@@ -124,7 +124,7 @@
logMessage(5, "clearing modbuf");
ObjectReference obj;
while (!(obj = modbuf.pop()).isNull()) {
- Plan.markAsUnlogged(obj);
+ HeaderByte.markAsUnlogged(obj);
}
logMessage(5, "clearing remset");
while (!remset.isEmpty()) {
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenMutator.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenMutator.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenMutator.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenMutator.java Sat Aug 14 07:25:41 2010
@@ -15,6 +15,7 @@
import org.mmtk.plan.*;
import org.mmtk.policy.CopyLocal;
import org.mmtk.policy.Space;
+import org.mmtk.utility.HeaderByte;
import org.mmtk.utility.deque.*;
import org.mmtk.utility.alloc.Allocator;
import org.mmtk.utility.statistics.Stats;
@@ -142,11 +143,11 @@
@Inline
private void fastPath(ObjectReference src, Address slot, ObjectReference tgt, int mode) {
if (Gen.GATHER_WRITE_BARRIER_STATS) Gen.wbFast.inc();
- if ((mode == AASTORE_WRITE_BARRIER && USE_OBJECT_BARRIER_FOR_AASTORE) ||
- (mode == PUTFIELD_WRITE_BARRIER && USE_OBJECT_BARRIER_FOR_PUTFIELD)) {
- if (Plan.logRequired(src)) {
+ if ((mode == ARRAY_ELEMENT && USE_OBJECT_BARRIER_FOR_AASTORE) ||
+ (mode == INSTANCE_FIELD && USE_OBJECT_BARRIER_FOR_PUTFIELD)) {
+ if (HeaderByte.isUnlogged(src)) {
if (Gen.GATHER_WRITE_BARRIER_STATS) Gen.wbSlow.inc();
- Plan.markAsLogged(src);
+ HeaderByte.markAsLogged(src);
modbuf.insert(src);
}
} else {
@@ -174,11 +175,51 @@
* @param mode The mode of the store (eg putfield, putstatic etc)
*/
@Inline
- public final void writeBarrier(ObjectReference src, Address slot,
+ public final void objectReferenceWrite(ObjectReference src, Address slot,
ObjectReference tgt, Word metaDataA,
Word metaDataB, int mode) {
fastPath(src, slot, tgt, mode);
- VM.barriers.performWriteInBarrier(src, slot, tgt, metaDataA, metaDataB, mode);
+ VM.barriers.objectReferenceWrite(src, tgt, metaDataA, metaDataB, mode);
+ }
+
+
+ /**
+ * Perform the root write barrier fast path, which may involve remembering
+ * a reference if necessary.
+ *
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param tgt The target of the new reference
+ * @param mode The mode of the store (eg putfield, putstatic etc)
+ */
+ @Inline
+ private void fastPath(Address slot, ObjectReference tgt) {
+ if (Gen.GATHER_WRITE_BARRIER_STATS) Gen.wbFast.inc();
+ if (Gen.inNursery(tgt)) {
+ if (Gen.GATHER_WRITE_BARRIER_STATS) Gen.wbSlow.inc();
+ remset.insert(slot);
+ }
+ }
+
+ /**
+ * A new reference is about to be created in a location that is not
+ * a regular heap object. Take appropriate write barrier actions.<p>
+ *
+ * In this case, we remember the address of the source of the
+ * pointer if the new reference points into the nursery from
+ * non-nursery space.
+ *
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param tgt The target of the new reference
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ */
+ @Inline
+ public final void objectReferenceNonHeapWrite(Address slot, ObjectReference tgt,
+ Word metaDataA, Word metaDataB) {
+ fastPath(slot, tgt);
+ VM.barriers.objectReferenceNonHeapWrite(slot, tgt, metaDataA, metaDataB);
}
/**
@@ -201,10 +242,9 @@
* @return True if the swap was successful.
*/
@Inline
- public boolean tryCompareAndSwapWriteBarrier(ObjectReference src, Address slot,
- ObjectReference old, ObjectReference tgt, Word metaDataA,
- Word metaDataB, int mode) {
- boolean result = VM.barriers.tryCompareAndSwapWriteInBarrier(src, slot, old, tgt, metaDataA, metaDataB, mode);
+ public boolean objectReferenceTryCompareAndSwap(ObjectReference src, Address slot, ObjectReference old, ObjectReference tgt,
+ Word metaDataA, Word metaDataB, int mode) {
+ boolean result = VM.barriers.objectReferenceTryCompareAndSwap(src, old, tgt, metaDataA, metaDataB, mode);
if (result)
fastPath(src, slot, tgt, mode);
return result;
@@ -219,26 +259,21 @@
* In this case, we remember the mutated source address range and
* will scan that address range at GC time.
*
- * @param src The source of the values to copied
- * @param srcOffset The offset of the first source address, in
- * bytes, relative to <code>src</code> (in principle, this could be
- * negative).
+ * @param src The source of the values to be copied
+ * @param srcIdx The starting source index
* @param dst The mutated object, i.e. the destination of the copy.
- * @param dstOffset The offset of the first destination address, in
- * bytes relative to <code>tgt</code> (in principle, this could be
- * negative).
- * @param bytes The size of the region being copied, in bytes.
+ * @param srcIdx The starting source index
+ * @param len The number of array elements to be copied
* @return True if the update was performed by the barrier, false if
* left to the caller (always false in this case).
*/
@Inline
- public final boolean writeBarrier(ObjectReference src, Offset srcOffset,
- ObjectReference dst, Offset dstOffset,
- int bytes) {
- // We can ignore when src is in old space, right?
- if (!Gen.inNursery(dst))
- arrayRemset.insert(dst.toAddress().plus(dstOffset),
- dst.toAddress().plus(dstOffset.plus(bytes)));
+ @Override
+ public final boolean objectReferenceBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) {
+ if (!Gen.inNursery(dst)) {
+ Address start = dst.toAddress().plus(dstOffset);
+ arrayRemset.insert(start, start.plus(bytes));
+ }
return false;
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenNurseryTraceLocal.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenNurseryTraceLocal.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenNurseryTraceLocal.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/GenNurseryTraceLocal.java Sat Aug 14 07:25:41 2010
@@ -12,9 +12,9 @@
*/
package org.mmtk.plan.generational;
-import org.mmtk.plan.Plan;
import org.mmtk.plan.TraceLocal;
import org.mmtk.plan.Trace;
+import org.mmtk.utility.HeaderByte;
import org.mmtk.utility.deque.*;
import org.mmtk.vm.VM;
@@ -95,7 +95,7 @@
ObjectReference obj;
while (!(obj = modbuf.pop()).isNull()) {
if (VM.DEBUG) VM.debugging.modbufEntry(obj);
- Plan.markAsUnlogged(obj);
+ HeaderByte.markAsUnlogged(obj);
scanObject(obj);
}
logMessage(5, "processing remset");
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/copying/GenCopyCollector.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/copying/GenCopyCollector.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/copying/GenCopyCollector.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/copying/GenCopyCollector.java Sat Aug 14 07:25:41 2010
@@ -17,7 +17,8 @@
import org.mmtk.plan.Plan;
import org.mmtk.plan.TraceLocal;
import org.mmtk.policy.CopyLocal;
-import org.mmtk.policy.CopySpace;
+import org.mmtk.utility.ForwardingWord;
+import org.mmtk.utility.HeaderByte;
import org.mmtk.utility.alloc.Allocator;
import org.mmtk.vm.VM;
@@ -111,13 +112,13 @@
@Inline
public final void postCopy(ObjectReference object, ObjectReference typeRef,
int bytes, int allocator) {
- CopySpace.clearGCBits(object);
+ ForwardingWord.clearForwardingBits(object);
if (allocator == Plan.ALLOC_LOS)
Plan.loSpace.initializeHeader(object, false);
else if (GenCopy.IGNORE_REMSETS)
- CopySpace.markObject(getCurrentTrace(),object, GenCopy.immortalSpace.getMarkState());
+ GenCopy.immortalSpace.traceObject(getCurrentTrace(), object); // FIXME this does not look right
if (Gen.USE_OBJECT_BARRIER)
- Plan.markAsUnlogged(object);
+ HeaderByte.markAsUnlogged(object);
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/copying/GenCopyMutator.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/copying/GenCopyMutator.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/copying/GenCopyMutator.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/copying/GenCopyMutator.java Sat Aug 14 07:25:41 2010
@@ -142,7 +142,7 @@
*/
public void collectionPhase(short phaseId, boolean primary) {
if (global().traceFullHeap()) {
- if (phaseId == GenCopy.PREPARE) {
+ if (phaseId == GenCopy.RELEASE) {
super.collectionPhase(phaseId, primary);
if (global().gcFullHeap) mature.rebind(GenCopy.toSpace());
return;
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/immix/GenImmixCollector.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/immix/GenImmixCollector.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/immix/GenImmixCollector.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/immix/GenImmixCollector.java Sat Aug 14 07:25:41 2010
@@ -16,6 +16,7 @@
import org.mmtk.plan.TraceLocal;
import org.mmtk.plan.generational.*;
import org.mmtk.policy.Space;
+import org.mmtk.utility.HeaderByte;
import org.mmtk.utility.alloc.Allocator;
import org.mmtk.utility.alloc.ImmixAllocator;
import org.mmtk.utility.statistics.Stats;
@@ -119,7 +120,7 @@
GenImmix.immixSpace.postCopy(object, bytes, allocator == GenImmix.ALLOC_MATURE_MAJORGC);
}
if (Gen.USE_OBJECT_BARRIER)
- Plan.markAsUnlogged(object);
+ HeaderByte.markAsUnlogged(object);
}
/*****************************************************************************
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/marksweep/GenMSCollector.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/marksweep/GenMSCollector.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/marksweep/GenMSCollector.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/generational/marksweep/GenMSCollector.java Sat Aug 14 07:25:41 2010
@@ -17,6 +17,7 @@
import org.mmtk.plan.generational.*;
import org.mmtk.policy.MarkSweepLocal;
import org.mmtk.policy.Space;
+import org.mmtk.utility.HeaderByte;
import org.mmtk.utility.alloc.Allocator;
import org.mmtk.utility.statistics.Stats;
@@ -115,7 +116,7 @@
else
GenMS.msSpace.postCopy(object, allocator == GenMS.ALLOC_MATURE_MAJORGC);
if (Gen.USE_OBJECT_BARRIER)
- Plan.markAsUnlogged(object);
+ HeaderByte.markAsUnlogged(object);
}
/*****************************************************************************
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/immix/ImmixDefragTraceLocal.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/immix/ImmixDefragTraceLocal.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/immix/ImmixDefragTraceLocal.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/immix/ImmixDefragTraceLocal.java Sat Aug 14 07:25:41 2010
@@ -18,6 +18,7 @@
import org.mmtk.plan.TraceLocal;
import org.mmtk.plan.Trace;
import org.mmtk.policy.Space;
+import org.mmtk.utility.HeaderByte;
import org.mmtk.utility.deque.ObjectReferenceDeque;
import org.mmtk.vm.VM;
@@ -145,7 +146,7 @@
logMessage(5, "clearing modBuffer");
while (!modBuffer.isEmpty()) {
ObjectReference src = modBuffer.pop();
- Plan.markAsUnlogged(src);
+ HeaderByte.markAsUnlogged(src);
}
}
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/immix/ImmixTraceLocal.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/immix/ImmixTraceLocal.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/immix/ImmixTraceLocal.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/immix/ImmixTraceLocal.java Sat Aug 14 07:25:41 2010
@@ -14,10 +14,10 @@
import static org.mmtk.policy.immix.ImmixConstants.MARK_LINE_AT_SCAN_TIME;
-import org.mmtk.plan.Plan;
import org.mmtk.plan.TraceLocal;
import org.mmtk.plan.Trace;
import org.mmtk.policy.Space;
+import org.mmtk.utility.HeaderByte;
import org.mmtk.utility.deque.ObjectReferenceDeque;
import org.mmtk.vm.VM;
@@ -133,7 +133,7 @@
logMessage(5, "clearing modBuffer");
while (!modBuffer.isEmpty()) {
ObjectReference src = modBuffer.pop();
- Plan.markAsUnlogged(src);
+ HeaderByte.markAsUnlogged(src);
}
}
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/markcompact/MC.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/markcompact/MC.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/markcompact/MC.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/markcompact/MC.java Sat Aug 14 07:25:41 2010
@@ -48,10 +48,16 @@
* Class variables
*/
+ /** The mark compact space itself */
public static final MarkCompactSpace mcSpace = new MarkCompactSpace("mc", DEFAULT_POLL_FREQUENCY, VMRequest.create(0.6f));
+
+ /** The space descriptor */
public static final int MARK_COMPACT = mcSpace.getDescriptor();
+ /** Specialized method identifier for the MARK phase */
public static final int SCAN_MARK = 0;
+
+ /** Specialized method identifier for the FORWARD phase */
public static final int SCAN_FORWARD = 1;
/* Phases */
@@ -59,8 +65,10 @@
public static final short FORWARD_CLOSURE = Phase.createSimple("fw-closure");
public static final short RELEASE_FORWARD = Phase.createSimple("fw-release");
- /* FIXME these two phases need to be made per-collector phases */
+ /** Calculate forwarding pointers via a linear scan over the heap */
public static final short CALCULATE_FP = Phase.createSimple("calc-fp");
+
+ /** Perform compaction via a linear scan over the heap */
public static final short COMPACT = Phase.createSimple("compact");
// CHECKSTYLE:OFF
@@ -75,7 +83,7 @@
Phase.scheduleComplex (rootClosurePhase),
Phase.scheduleComplex (refTypeClosurePhase),
Phase.scheduleComplex (completeClosurePhase),
- Phase.scheduleMutator (CALCULATE_FP),
+ Phase.scheduleCollector(CALCULATE_FP),
Phase.scheduleGlobal (PREPARE_FORWARD),
Phase.scheduleCollector(PREPARE_FORWARD),
Phase.scheduleMutator (PREPARE),
@@ -87,7 +95,7 @@
Phase.scheduleMutator (RELEASE),
Phase.scheduleCollector(RELEASE_FORWARD),
Phase.scheduleGlobal (RELEASE_FORWARD),
- Phase.scheduleMutator (COMPACT),
+ Phase.scheduleCollector(COMPACT),
Phase.scheduleComplex (finishPhase));
// CHECKSTYLE:ON
@@ -96,7 +104,10 @@
* Instance variables
*/
+ /** This trace sets the mark bit in live objects */
public final Trace markTrace;
+
+ /** This trace updates pointers with the forwarded references */
public final Trace forwardTrace;
/**
@@ -119,6 +130,7 @@
*
* @param phaseId Collection phase to execute.
*/
+ @Override
@Inline
public final void collectionPhase(short phaseId) {
if (phaseId == PREPARE) {
@@ -167,6 +179,7 @@
* @return The number of pages reserved given the pending
* allocation, excluding space reserved for copying.
*/
+ @Override
public int getPagesUsed() {
return (mcSpace.reservedPages() + super.getPagesUsed());
}
@@ -178,6 +191,7 @@
* @return the number of pages a collection is required to free to satisfy
* outstanding allocation requests.
*/
+ @Override
public int getPagesRequired() {
return super.getPagesRequired() + mcSpace.requiredPages();
}
@@ -203,6 +217,7 @@
*
* @return The expected (root excluded) reference count.
*/
+ @Override
public int sanityExpectedRC(ObjectReference object, int sanityRootRC) {
Space space = Space.getSpaceForObject(object);
@@ -212,14 +227,14 @@
// This is not very satisfying but allows us to use the sanity checker to
// detect dangling pointers.
return SanityChecker.UNSURE;
- } else {
- return super.sanityExpectedRC(object, sanityRootRC);
}
+ return super.sanityExpectedRC(object, sanityRootRC);
}
/**
* Register specialized methods.
*/
+ @Override
@Interruptible
protected void registerSpecializedMethods() {
TransitiveClosure.registerSpecializedScan(SCAN_MARK, MCMarkTraceLocal.class);
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/markcompact/MCCollector.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/markcompact/MCCollector.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/markcompact/MCCollector.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/markcompact/MCCollector.java Sat Aug 14 07:25:41 2010
@@ -13,6 +13,7 @@
package org.mmtk.plan.markcompact;
import org.mmtk.plan.*;
+import org.mmtk.policy.MarkCompactCollector;
import org.mmtk.vm.VM;
@@ -29,12 +30,6 @@
* method), and collection-time allocation.<p>
*
* @see MC for an overview of the mark-compact algorithm.<p>
- *
- * FIXME Currently MC does not properly separate mutator and collector
- * behaviors, so some of the collection logic in MCMutator should
- * really be per-collector thread, not per-mutator thread.
- *
- * @see MC
* @see MCMutator
* @see StopTheWorldCollector
* @see CollectorContext
@@ -50,6 +45,7 @@
private final MCMarkTraceLocal markTrace;
private final MCForwardTraceLocal forwardTrace;
+ private final MarkCompactCollector mc;
private boolean currentTrace;
/****************************************************************************
@@ -63,6 +59,7 @@
public MCCollector() {
markTrace = new MCMarkTraceLocal(global().markTrace);
forwardTrace = new MCForwardTraceLocal(global().forwardTrace);
+ mc = new MarkCompactCollector(MC.mcSpace);
}
@@ -81,6 +78,7 @@
* @param offset The alignment offset.
* @return The address of the first byte of the allocated region
*/
+ @Override
@Inline
public Address allocCopy(ObjectReference original, int bytes,
int align, int offset, int allocator) {
@@ -96,6 +94,7 @@
* @param typeRef the type reference for the instance being created
* @param bytes The size of the space to be allocated (in bytes)
*/
+ @Override
@Inline
public void postCopy(ObjectReference object, ObjectReference typeRef,
int bytes, int allocator) {
@@ -113,6 +112,7 @@
* @param phaseId The collection phase to perform
* @param primary Perform any single-threaded activities using this thread.
*/
+ @Override
@Inline
public final void collectionPhase(short phaseId, boolean primary) {
if (phaseId == MC.PREPARE) {
@@ -127,6 +127,16 @@
return;
}
+ if (phaseId == MC.CALCULATE_FP) {
+ mc.calculateForwardingPointers();
+ return;
+ }
+
+ if (phaseId == MC.COMPACT) {
+ mc.compact();
+ return;
+ }
+
if (phaseId == MC.RELEASE) {
markTrace.release();
super.collectionPhase(phaseId, primary);
@@ -160,12 +170,12 @@
*/
/** @return The current trace instance. */
+ @Override
public final TraceLocal getCurrentTrace() {
if (currentTrace == TRACE_MARK) {
return markTrace;
- } else {
- return forwardTrace;
}
+ return forwardTrace;
}
/** @return The active global plan as an <code>MC</code> instance. */
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/markcompact/MCConstraints.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/markcompact/MCConstraints.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/markcompact/MCConstraints.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/markcompact/MCConstraints.java Sat Aug 14 07:25:41 2010
@@ -15,6 +15,7 @@
import org.mmtk.plan.StopTheWorldConstraints;
import org.mmtk.policy.MarkCompactSpace;
+import org.mmtk.policy.MarkCompactLocal;
import org.vmmagic.pragma.*;
@@ -33,6 +34,8 @@
@Override
public boolean needsLinearScan() { return true; }
@Override
+ public int maxNonLOSDefaultAllocBytes() { return MarkCompactLocal.MINIMUM_DATA_SIZE; }
+ @Override
public int gcHeaderBits() { return MarkCompactSpace.LOCAL_GC_BITS_REQUIRED; }
@Override
public int gcHeaderWords() { return MarkCompactSpace.GC_HEADER_WORDS_REQUIRED; }
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/markcompact/MCMutator.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/markcompact/MCMutator.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/markcompact/MCMutator.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/markcompact/MCMutator.java Sat Aug 14 07:25:41 2010
@@ -32,10 +32,6 @@
*
* See {@link MC} for an overview of the mark-compact algorithm.<p>
*
- * FIXME Currently MC does not properly separate mutator and collector
- * behaviors, so some of the collection logic here should really be
- * per-collector thread, not per-mutator thread.
- *
* @see MC
* @see MCCollector
* @see org.mmtk.plan.StopTheWorldMutator
@@ -46,7 +42,7 @@
/****************************************************************************
* Instance fields
*/
- private MarkCompactLocal mc;
+ private final MarkCompactLocal mc;
/****************************************************************************
*
@@ -77,6 +73,7 @@
* @param site Allocation site
* @return The low address of the allocated memory.
*/
+ @Override
@Inline
public Address alloc(int bytes, int align, int offset, int allocator, int site) {
if (allocator == MC.ALLOC_DEFAULT) {
@@ -95,6 +92,7 @@
* @param bytes The size of the space to be allocated (in bytes)
* @param allocator The allocator number to be used for this allocation
*/
+ @Override
@Inline
public void postAlloc(ObjectReference ref, ObjectReference typeRef,
int bytes, int allocator) {
@@ -113,6 +111,7 @@
* which is allocating into <code>space</code>, or <code>null</code>
* if no appropriate allocator can be established.
*/
+ @Override
public Allocator getAllocatorFromSpace(Space space) {
if (space == MC.mcSpace) return mc;
return super.getAllocatorFromSpace(space);
@@ -130,25 +129,15 @@
* @param phaseId The collection phase to perform
* @param primary Perform any single-threaded activities using this thread.
*/
+ @Override
@Inline
public final void collectionPhase(short phaseId, boolean primary) {
if (phaseId == MC.PREPARE) {
+ mc.prepare();
super.collectionPhase(phaseId, primary);
return;
}
- /* FIXME this needs to be made a per-collector phase */
- if (phaseId == MC.CALCULATE_FP) {
- mc.calculateForwardingPointers();
- return;
- }
-
- /* FIXME this needs to be made a per-collector phase */
- if (phaseId == MC.COMPACT) {
- mc.compact();
- return;
- }
-
if (phaseId == MC.RELEASE) {
super.collectionPhase(phaseId, primary);
return;
@@ -156,4 +145,18 @@
super.collectionPhase(phaseId, primary);
}
+ /**
+ * Flush the pages this mutator has allocated back to the global
+ * dirty page list, where the collectors can find them.
+ *
+ * @see org.mmtk.plan.MutatorContext#flush()
+ */
+ @Override
+ public void flush() {
+ super.flush();
+ mc.flush();
+ }
+
+
+
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/marksweep/MSTraceLocal.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/marksweep/MSTraceLocal.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/marksweep/MSTraceLocal.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/marksweep/MSTraceLocal.java Sat Aug 14 07:25:41 2010
@@ -12,10 +12,10 @@
*/
package org.mmtk.plan.marksweep;
-import org.mmtk.plan.Plan;
import org.mmtk.plan.TraceLocal;
import org.mmtk.plan.Trace;
import org.mmtk.policy.Space;
+import org.mmtk.utility.HeaderByte;
import org.mmtk.utility.deque.ObjectReferenceDeque;
import org.vmmagic.pragma.*;
@@ -93,7 +93,7 @@
logMessage(5, "clearing modBuffer");
while (!modBuffer.isEmpty()) {
ObjectReference src = modBuffer.pop();
- Plan.markAsUnlogged(src);
+ HeaderByte.markAsUnlogged(src);
}
}
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/poisoned/PoisonedConstraints.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/poisoned/PoisonedConstraints.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/poisoned/PoisonedConstraints.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/poisoned/PoisonedConstraints.java Sat Aug 14 07:25:41 2010
@@ -24,11 +24,11 @@
@Uninterruptible
public class PoisonedConstraints extends MSConstraints {
@Override
- public boolean needsWriteBarrier() { return true; }
+ public boolean needsObjectReferenceWriteBarrier() { return true; }
@Override
- public boolean needsReadBarrier() { return true; }
+ public boolean needsObjectReferenceReadBarrier() { return true; }
@Override
- public boolean needsStaticWriteBarrier() { return false; }
+ public boolean needsObjectReferenceNonHeapWriteBarrier() { return false; }
@Override
- public boolean needsStaticReadBarrier() { return false; }
+ public boolean needsObjectReferenceNonHeapReadBarrier() { return false; }
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/poisoned/PoisonedMutator.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/poisoned/PoisonedMutator.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/poisoned/PoisonedMutator.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/poisoned/PoisonedMutator.java Sat Aug 14 07:25:41 2010
@@ -18,7 +18,6 @@
import org.vmmagic.pragma.*;
import org.vmmagic.unboxed.Address;
import org.vmmagic.unboxed.ObjectReference;
-import org.vmmagic.unboxed.Offset;
import org.vmmagic.unboxed.Word;
/**
@@ -50,8 +49,8 @@
*/
@Inline
@Override
- public void writeBarrier(ObjectReference src, Address slot, ObjectReference tgt, Word metaDataA, Word metaDataB, int mode) {
- VM.barriers.performRawWriteInBarrier(src, slot, Poisoned.poison(tgt), metaDataA, metaDataB, mode);
+ public void objectReferenceWrite(ObjectReference src, Address slot, ObjectReference tgt, Word metaDataA, Word metaDataB, int mode) {
+ VM.barriers.wordWrite(src, Poisoned.poison(tgt), metaDataA, metaDataB, mode);
}
/**
@@ -72,35 +71,9 @@
* @return True if the swap was successful.
*/
@Override
- public boolean tryCompareAndSwapWriteBarrier(ObjectReference src, Address slot, ObjectReference old, ObjectReference tgt,
+ public boolean objectReferenceTryCompareAndSwap(ObjectReference src, Address slot, ObjectReference old, ObjectReference tgt,
Word metaDataA, Word metaDataB, int mode) {
- return VM.barriers.tryRawCompareAndSwapWriteInBarrier(src, slot, Poisoned.poison(old), Poisoned.poison(tgt), metaDataA, metaDataB, mode);
- }
-
- /**
- * A number of references are about to be copied from object
- * <code>src</code> to object <code>dst</code> (as in an array
- * copy). Thus, <code>dst</code> is the mutated object. Take
- * appropriate write barrier actions.<p>
- *
- * @param src The source of the values to be copied
- * @param srcOffset The offset of the first source address, in
- * bytes, relative to <code>src</code> (in principle, this could be
- * negative).
- * @param dst The mutated object, i.e. the destination of the copy.
- * @param dstOffset The offset of the first destination address, in
- * bytes relative to <code>tgt</code> (in principle, this could be
- * negative).
- * @param bytes The size of the region being copied, in bytes.
- * @return True if the update was performed by the barrier, false if
- * left to the caller (always false in this case).
- */
- @Override
- public boolean writeBarrier(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) {
- // TODO: Currently, read barriers implies that this is never used, perhaps
- // we might want to use it sometime anyway?
- if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
- return false;
+ return VM.barriers.wordTryCompareAndSwap(src, Poisoned.poison(old), Poisoned.poison(tgt), metaDataA, metaDataB, mode);
}
/**
@@ -117,7 +90,7 @@
*/
@Inline
@Override
- public ObjectReference readBarrier(ObjectReference src, Address slot, Word metaDataA, Word metaDataB, int mode) {
- return Poisoned.depoison(VM.barriers.performRawReadInBarrier(src, slot, metaDataA, metaDataB, mode));
+ public ObjectReference objectReferenceRead(ObjectReference src, Address slot, Word metaDataA, Word metaDataB, int mode) {
+ return Poisoned.depoison(VM.barriers.wordRead(src, metaDataA, metaDataB, mode));
}
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/refcount/RCBaseConstraints.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/refcount/RCBaseConstraints.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/refcount/RCBaseConstraints.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/refcount/RCBaseConstraints.java Sat Aug 14 07:25:41 2010
@@ -30,7 +30,7 @@
@Override
public int gcHeaderWords() { return RCHeader.GC_HEADER_WORDS_REQUIRED; }
@Override
- public boolean needsWriteBarrier() { return true; }
+ public boolean needsObjectReferenceWriteBarrier() { return true; }
@Override
public int maxNonLOSDefaultAllocBytes() { return MAX_FREELIST_OBJECT_BYTES; }
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/refcount/RCBaseMutator.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/refcount/RCBaseMutator.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/refcount/RCBaseMutator.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/refcount/RCBaseMutator.java Sat Aug 14 07:25:41 2010
@@ -238,13 +238,13 @@
* @param mode The context in which the store occurred
*/
@Inline
- public void writeBarrier(ObjectReference src, Address slot,
+ public void objectReferenceWrite(ObjectReference src, Address slot,
ObjectReference tgt, Word metaDataA,
Word metaDataB, int mode) {
if (RCHeader.logRequired(src)) {
coalescingWriteBarrierSlow(src);
}
- VM.barriers.performWriteInBarrier(src,slot,tgt, metaDataA, metaDataB, mode);
+ VM.barriers.objectReferenceWrite(src,tgt,metaDataA, metaDataB, mode);
}
/**
@@ -265,13 +265,13 @@
* @return True if the swap was successful.
*/
@Inline
- public boolean tryCompareAndSwapWriteBarrier(ObjectReference src, Address slot,
+ public boolean objectReferenceTryCompareAndSwap(ObjectReference src, Address slot,
ObjectReference old, ObjectReference tgt, Word metaDataA,
Word metaDataB, int mode) {
if (RCHeader.logRequired(src)) {
coalescingWriteBarrierSlow(src);
}
- return VM.barriers.tryCompareAndSwapWriteInBarrier(src,slot,old,tgt,metaDataA,metaDataB,mode);
+ return VM.barriers.objectReferenceTryCompareAndSwap(src,old,tgt,metaDataA,metaDataB,mode);
}
/**
@@ -293,7 +293,7 @@
* left to the caller (always false in this case).
*/
@Inline
- public boolean writeBarrier(ObjectReference src, Offset srcOffset,
+ public boolean objectReferenceBulkCopy(ObjectReference src, Offset srcOffset,
ObjectReference dst, Offset dstOffset, int bytes) {
if (RCHeader.logRequired(dst)) {
coalescingWriteBarrierSlow(dst);
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/refcount/generational/GenRCCollector.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/refcount/generational/GenRCCollector.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/refcount/generational/GenRCCollector.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/refcount/generational/GenRCCollector.java Sat Aug 14 07:25:41 2010
@@ -17,9 +17,9 @@
import org.mmtk.plan.refcount.RCBase;
import org.mmtk.plan.refcount.RCBaseCollector;
import org.mmtk.plan.refcount.RCHeader;
-import org.mmtk.policy.CopySpace;
import org.mmtk.policy.ExplicitFreeListLocal;
import org.mmtk.policy.ExplicitFreeListSpace;
+import org.mmtk.utility.ForwardingWord;
import org.mmtk.vm.VM;
import org.vmmagic.pragma.*;
import org.vmmagic.unboxed.Address;
@@ -102,7 +102,7 @@
@Inline
public final void postCopy(ObjectReference object, ObjectReference typeRef,
int bytes, int allocator) {
- CopySpace.clearGCBits(object);
+ ForwardingWord.clearForwardingBits(object);
RCHeader.initializeHeader(object, false);
RCHeader.makeUnlogged(object);
ExplicitFreeListSpace.unsyncSetLiveBit(object);
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/SSCollector.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/SSCollector.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/SSCollector.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/SSCollector.java Sat Aug 14 07:25:41 2010
@@ -13,10 +13,10 @@
package org.mmtk.plan.semispace;
import org.mmtk.plan.*;
-import org.mmtk.policy.CopySpace;
import org.mmtk.policy.CopyLocal;
import org.mmtk.policy.LargeObjectLocal;
import org.mmtk.policy.Space;
+import org.mmtk.utility.ForwardingWord;
import org.mmtk.vm.VM;
import org.vmmagic.unboxed.*;
@@ -111,7 +111,7 @@
@Inline
public void postCopy(ObjectReference object, ObjectReference typeRef,
int bytes, int allocator) {
- CopySpace.clearGCBits(object);
+ ForwardingWord.clearForwardingBits(object);
if (allocator == Plan.ALLOC_LOS)
Plan.loSpace.initializeHeader(object, false);
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/gctrace/GCTraceConstraints.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/gctrace/GCTraceConstraints.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/gctrace/GCTraceConstraints.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/gctrace/GCTraceConstraints.java Sat Aug 14 07:25:41 2010
@@ -22,7 +22,7 @@
@Uninterruptible
public class GCTraceConstraints extends SSConstraints {
@Override
- public boolean needsWriteBarrier() { return true; }
+ public boolean needsObjectReferenceWriteBarrier() { return true; }
@Override
public boolean generateGCTrace() { return true; }
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/gctrace/GCTraceMutator.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/gctrace/GCTraceMutator.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/gctrace/GCTraceMutator.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/gctrace/GCTraceMutator.java Sat Aug 14 07:25:41 2010
@@ -89,12 +89,12 @@
* @param mode The mode of the store (eg putfield, putstatic etc)
*/
@Inline
- public final void writeBarrier(ObjectReference src, Address slot,
+ public final void objectReferenceWrite(ObjectReference src, Address slot,
ObjectReference tgt, Word metaDataA,
Word metaDataB, int mode) {
- TraceGenerator.processPointerUpdate(mode == PUTFIELD_WRITE_BARRIER,
+ TraceGenerator.processPointerUpdate(mode == INSTANCE_FIELD,
src, slot, tgt);
- VM.barriers.performWriteInBarrier(src, slot, tgt, metaDataA, metaDataB, mode);
+ VM.barriers.objectReferenceWrite(src, tgt, metaDataA, metaDataB, mode);
}
/**
@@ -115,12 +115,12 @@
* @return True if the swap was successful.
*/
@Inline
- public boolean tryCompareAndSwapWriteBarrier(ObjectReference src, Address slot,
+ public boolean objectReferenceTryCompareAndSwap(ObjectReference src, Address slot,
ObjectReference old, ObjectReference tgt, Word metaDataA,
Word metaDataB, int mode) {
- boolean result = VM.barriers.tryCompareAndSwapWriteInBarrier(src, slot, old, tgt, metaDataA, metaDataB, mode);
+ boolean result = VM.barriers.objectReferenceTryCompareAndSwap(src, old, tgt, metaDataA, metaDataB, mode);
if (result) {
- TraceGenerator.processPointerUpdate(mode == PUTFIELD_WRITE_BARRIER, src, slot, tgt);
+ TraceGenerator.processPointerUpdate(mode == INSTANCE_FIELD, src, slot, tgt);
}
return result;
}
@@ -143,7 +143,7 @@
* @return True if the update was performed by the barrier, false if
* left to the caller (always false in this case).
*/
- public boolean writeBarrier(ObjectReference src, Offset srcOffset,
+ public boolean objectReferenceBulkCopy(ObjectReference src, Offset srcOffset,
ObjectReference dst, Offset dstOffset, int bytes) {
/* These names seem backwards, but are defined to be compatable with the
* previous writeBarrier method. */
Added: vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriers.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriers.java?rev=111072&view=auto
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriers.java (added)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriers.java Sat Aug 14 07:25:41 2010
@@ -0,0 +1,26 @@
+/*
+ * This file is part of the Jikes RVM project (http://jikesrvm.org).
+ *
+ * This file is licensed to You under the Eclipse Public License (EPL);
+ * You may not use this file except in compliance with the License. You
+ * may obtain a copy of the License at
+ *
+ * http://www.opensource.org/licenses/eclipse-1.0.php
+ *
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.
+ */
+package org.mmtk.plan.semispace.usePrimitiveWriteBarriers;
+
+import org.mmtk.plan.semispace.SS;
+
+import org.vmmagic.pragma.*;
+
+/**
+ * This class exercises primitive write barriers The write barriers contain no
+ * payloads but merely perform a write to the heap
+ */
+ at Uninterruptible
+public class UsePrimitiveWriteBarriers extends SS {
+
+}
Added: vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersCollector.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersCollector.java?rev=111072&view=auto
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersCollector.java (added)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersCollector.java Sat Aug 14 07:25:41 2010
@@ -0,0 +1,25 @@
+/*
+ * This file is part of the Jikes RVM project (http://jikesrvm.org).
+ *
+ * This file is licensed to You under the Eclipse Public License (EPL);
+ * You may not use this file except in compliance with the License. You
+ * may obtain a copy of the License at
+ *
+ * http://www.opensource.org/licenses/eclipse-1.0.php
+ *
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.
+ */
+package org.mmtk.plan.semispace.usePrimitiveWriteBarriers;
+
+import org.mmtk.plan.semispace.SSCollector;
+import org.vmmagic.pragma.*;
+
+/**
+ * This class extends the {@link SSCollector} class as part of the
+ * {@link UsePrimitiveWriteBarriers} collector. All implementation details
+ * concerning GC are handled by {@link SSCollector}
+ */
+ at Uninterruptible
+public class UsePrimitiveWriteBarriersCollector extends SSCollector {
+}
Added: vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersConstraints.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersConstraints.java?rev=111072&view=auto
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersConstraints.java (added)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersConstraints.java Sat Aug 14 07:25:41 2010
@@ -0,0 +1,84 @@
+/*
+ * This file is part of the Jikes RVM project (http://jikesrvm.org).
+ *
+ * This file is licensed to You under the Eclipse Public License (EPL);
+ * You may not use this file except in compliance with the License. You
+ * may obtain a copy of the License at
+ *
+ * http://www.opensource.org/licenses/eclipse-1.0.php
+ *
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.
+ */
+package org.mmtk.plan.semispace.usePrimitiveWriteBarriers;
+
+import org.mmtk.plan.semispace.SSConstraints;
+import org.vmmagic.pragma.*;
+
+/**
+ * UsePrimitiveWriteBarriers common constants.
+ */
+ at Uninterruptible
+public class UsePrimitiveWriteBarriersConstraints extends SSConstraints {
+
+ /** @return True if this Plan requires write barriers on booleans. */
+ public boolean needsBooleanWriteBarrier() { return true; }
+
+ /** @return True if this Plan can perform bulk boolean arraycopy barriers. */
+ public boolean booleanBulkCopySupported() { return true; }
+
+ /** @return True if this Plan requires write barriers on bytes. */
+ public boolean needsByteWriteBarrier() { return true; }
+
+ /** @return True if this Plan can perform bulk byte arraycopy barriers. */
+ public boolean byteBulkCopySupported() { return true; }
+
+ /** @return True if this Plan requires write barriers on chars. */
+ public boolean needsCharWriteBarrier() { return true; }
+
+ /** @return True if this Plan can perform bulk char arraycopy barriers. */
+ public boolean charBulkCopySupported() { return true; }
+
+ /** @return True if this Plan requires write barriers on shorts. */
+ public boolean needsShortWriteBarrier() { return true; }
+
+ /** @return True if this Plan can perform bulk short arraycopy barriers. */
+ public boolean shortBulkCopySupported() { return true; }
+
+ /** @return True if this Plan requires write barriers on ints. */
+ public boolean needsIntWriteBarrier() { return true; }
+
+ /** @return True if this Plan can perform bulk int arraycopy barriers. */
+ public boolean intBulkCopySupported() { return true; }
+
+ /** @return True if this Plan requires write barriers on longs. */
+ public boolean needsLongWriteBarrier() { return true; }
+
+ /** @return True if this Plan can perform bulk long arraycopy barriers. */
+ public boolean longBulkCopySupported() { return true; }
+
+ /** @return True if this Plan requires write barriers on floats. */
+ public boolean needsFloatWriteBarrier() { return true; }
+
+ /** @return True if this Plan can perform bulk float arraycopy barriers. */
+ public boolean floatBulkCopySupported() { return true; }
+
+ /** @return True if this Plan requires write barriers on doubles. */
+ public boolean needsDoubleWriteBarrier() { return true; }
+
+ /** @return True if this Plan can perform bulk double arraycopy barriers. */
+ public boolean doubleBulkCopySupported() { return true; }
+
+ /** @return True if this Plan requires write barriers on Words. */
+ public boolean needsWordWriteBarrier() { return true; }
+
+ /** @return True if this Plan requires write barriers on Address's. */
+ public boolean needsAddressWriteBarrier() { return true; }
+
+ /** @return True if this Plan requires write barriers on Extents. */
+ public boolean needsExtentWriteBarrier() { return true; }
+
+ /** @return True if this Plan requires write barriers on Offsets. */
+ public boolean needsOffsetWriteBarrier() { return true; }
+
+}
Added: vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersMutator.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersMutator.java?rev=111072&view=auto
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersMutator.java (added)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersMutator.java Sat Aug 14 07:25:41 2010
@@ -0,0 +1,424 @@
+/*
+ * This file is part of the Jikes RVM project (http://jikesrvm.org).
+ *
+ * This file is licensed to You under the Eclipse Public License (EPL);
+ * You may not use this file except in compliance with the License. You
+ * may obtain a copy of the License at
+ *
+ * http://www.opensource.org/licenses/eclipse-1.0.php
+ *
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.
+ */
+package org.mmtk.plan.semispace.usePrimitiveWriteBarriers;
+
+import org.mmtk.plan.semispace.SSMutator;
+import org.mmtk.vm.VM;
+
+import org.vmmagic.unboxed.*;
+import org.vmmagic.pragma.*;
+
+/**
+ * This class extends the {@link SSMutator} class as part of the
+ * {@link UsePrimitiveWriteBarriers} collector. It overrides various methods in
+ * {@link Mutator} to implement primitive write barriers.
+ */
+ at Uninterruptible
+public class UsePrimitiveWriteBarriersMutator extends SSMutator {
+
+ /**
+ * Write an Address. Take appropriate write barrier actions.<p>
+ *
+ * @param src The object into which the Word will be stored
+ * @param slot The address into which the Word will be
+ * stored.
+ * @param value The value of the new Address
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void addressWrite(ObjectReference src, Address slot, Address value, Word metaDataA, Word metaDataB, int mode) {
+ VM.barriers.addressWrite(src, value, metaDataA, metaDataB, mode);
+ }
+
+ /**
+ * Attempt to atomically exchange the value in the given slot
+ * with the passed replacement value.
+ *
+ * @param src The object into which the Address will be stored
+ * @param slot The address into which the Address will be
+ * stored.
+ * @param old The old Address to be swapped out
+ * @param value The new Address
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ * @return True if the swap was successful.
+ */
+ public boolean addressTryCompareAndSwap(ObjectReference src, Address slot, Address old, Address value, Word metaDataA, Word metaDataB, int mode) {
+ return VM.barriers.addressTryCompareAndSwap(src, old, value, metaDataA, metaDataB, mode);
+ }
+
+ /**
+ * Write a boolean. Take appropriate write barrier actions.<p>
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param value The value of the new boolean
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void booleanWrite(ObjectReference src, Address slot, boolean value, Word metaDataA, Word metaDataB, int mode) {
+ VM.barriers.booleanWrite(src, value, metaDataA, metaDataB, mode);
+ }
+
+ /**
+ * A number of booleans are about to be copied from object
+ * <code>src</code> to object <code>dst</code> (as in an array
+ * copy). Thus, <code>dst</code> is the mutated object. Take
+ * appropriate write barrier actions.<p>
+ *
+ * @param src The source array
+ * @param srcOffset The starting source offset
+ * @param dst The destination array
+ * @param dstOffset The starting destination offset
+ * @param bytes The number of bytes to be copied
+ * @return True if the update was performed by the barrier, false if
+ * left to the caller
+ */
+ public boolean booleanBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) {
+ return false;
+ }
+
+ /**
+ * Write a byte. Take appropriate write barrier actions.<p>
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param value The value of the new byte
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void byteWrite(ObjectReference src, Address slot, byte value, Word metaDataA, Word metaDataB, int mode) {
+ VM.barriers.byteWrite(src, value, metaDataA, metaDataB, mode);
+ }
+
+ /**
+ * A number of bytes are about to be copied from object
+ * <code>src</code> to object <code>dst</code> (as in an array
+ * copy). Thus, <code>dst</code> is the mutated object. Take
+ * appropriate write barrier actions.<p>
+ *
+ * @param src The source array
+ * @param srcOffset The starting source offset
+ * @param dst The destination array
+ * @param dstOffset The starting destination offset
+ * @param bytes The number of bytes to be copied
+ * @return True if the update was performed by the barrier, false if
+ * left to the caller
+ */
+ public boolean byteBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) {
+ return false;
+ }
+
+ /**
+ * Write a char. Take appropriate write barrier actions.<p>
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param value The value of the new char
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void charWrite(ObjectReference src, Address slot, char value, Word metaDataA, Word metaDataB, int mode) {
+ VM.barriers.charWrite(src, value, metaDataA, metaDataB, mode);
+ }
+
+ /**
+ * A number of chars are about to be copied from object
+ * <code>src</code> to object <code>dst</code> (as in an array
+ * copy). Thus, <code>dst</code> is the mutated object. Take
+ * appropriate write barrier actions.<p>
+ *
+ * @param src The source array
+ * @param srcOffset The starting source offset
+ * @param dst The destination array
+ * @param dstOffset The starting destination offset
+ * @param bytes The number of bytes to be copied
+ * @return True if the update was performed by the barrier, false if
+ * left to the caller
+ */
+ public boolean charBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) {
+ return false;
+ }
+
+ /**
+ * Write a double. Take appropriate write barrier actions.<p>
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param value The value of the new double
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void doubleWrite(ObjectReference src, Address slot, double value, Word metaDataA, Word metaDataB, int mode) {
+ VM.barriers.doubleWrite(src, value, metaDataA, metaDataB, mode);
+ }
+
+ /**
+ * A number of doubles are about to be copied from object
+ * <code>src</code> to object <code>dst</code> (as in an array
+ * copy). Thus, <code>dst</code> is the mutated object. Take
+ * appropriate write barrier actions.<p>
+ *
+ * @param src The source array
+ * @param srcOffset The starting source offset
+ * @param dst The destination array
+ * @param dstOffset The starting destination offset
+ * @param bytes The number of bytes to be copied
+ * @return True if the update was performed by the barrier, false if
+ * left to the caller
+ */
+ public boolean doubleBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) {
+ return false;
+ }
+
+ /**
+ * Write an Extent. Take appropriate write barrier actions.<p>
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param value The value of the new Extent
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void extentWrite(ObjectReference src, Address slot, Extent value, Word metaDataA, Word metaDataB, int mode) {
+ VM.barriers.extentWrite(src, value, metaDataA, metaDataB, mode);
+ }
+
+ /**
+ * Write a float. Take appropriate write barrier actions.<p>
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param value The value of the new float
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void floatWrite(ObjectReference src, Address slot, float value, Word metaDataA, Word metaDataB, int mode) {
+ VM.barriers.floatWrite(src, value, metaDataA, metaDataB, mode);
+ }
+
+ /**
+ * A number of floats are about to be copied from object
+ * <code>src</code> to object <code>dst</code> (as in an array
+ * copy). Thus, <code>dst</code> is the mutated object. Take
+ * appropriate write barrier actions.<p>
+ *
+ * @param src The source array
+ * @param srcOffset The starting source offset
+ * @param dst The destination array
+ * @param dstOffset The starting destination offset
+ * @param bytes The number of bytes to be copied
+ * @return True if the update was performed by the barrier, false if
+ * left to the caller
+ */
+ public boolean floatBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) {
+ return false;
+ }
+
+ /**
+ * Write a int. Take appropriate write barrier actions.<p>
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param value The value of the new int
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void intWrite(ObjectReference src, Address slot, int value, Word metaDataA, Word metaDataB, int mode) {
+ VM.barriers.intWrite(src, value, metaDataA, metaDataB, mode);
+ }
+
+ /**
+ * A number of ints are about to be copied from object
+ * <code>src</code> to object <code>dst</code> (as in an array
+ * copy). Thus, <code>dst</code> is the mutated object. Take
+ * appropriate write barrier actions.<p>
+ *
+ * @param src The source array
+ * @param srcOffset The starting source offset
+ * @param dst The destination array
+ * @param dstOffset The starting destination offset
+ * @param bytes The number of bytes to be copied
+ * @return True if the update was performed by the barrier, false if
+ * left to the caller
+ */
+ public boolean intBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) {
+ return false;
+ }
+
+ /**
+ * Attempt to atomically exchange the value in the given slot
+ * with the passed replacement value.
+ *
+ * @param src The object into which the value will be stored
+ * @param slot The address into which the value will be
+ * stored.
+ * @param old The old int to be swapped out
+ * @param value The new int
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ * @return True if the swap was successful.
+ */
+ public boolean intTryCompareAndSwap(ObjectReference src, Address slot, int old, int value, Word metaDataA, Word metaDataB, int mode) {
+ return VM.barriers.intTryCompareAndSwap(src, old, value, metaDataA, metaDataB, mode);
+ }
+
+ /**
+ * Write a long. Take appropriate write barrier actions.<p>
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param value The value of the new long
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void longWrite(ObjectReference src, Address slot, long value, Word metaDataA, Word metaDataB, int mode) {
+ VM.barriers.longWrite(src, value, metaDataA, metaDataB, mode);
+ }
+
+ /**
+ * A number of longs are about to be copied from object
+ * <code>src</code> to object <code>dst</code> (as in an array
+ * copy). Thus, <code>dst</code> is the mutated object. Take
+ * appropriate write barrier actions.<p>
+ *
+ * @param src The source array
+ * @param srcOffset The starting source offset
+ * @param dst The destination array
+ * @param dstOffset The starting destination offset
+ * @param bytes The number of bytes to be copied
+ * @return True if the update was performed by the barrier, false if
+ * left to the caller
+ */
+ public boolean longBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) {
+ return false;
+ }
+
+ /**
+ * Attempt to atomically exchange the value in the given slot
+ * with the passed replacement value.
+ *
+ * @param src The object into which the value will be stored
+ * @param slot The address into which the value will be
+ * stored.
+ * @param old The old long to be swapped out
+ * @param value The new long
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ * @return True if the swap was successful.
+ */
+ public boolean longTryCompareAndSwap(ObjectReference src, Address slot, long old, long value, Word metaDataA, Word metaDataB, int mode) {
+ return VM.barriers.longTryCompareAndSwap(src, old, value, metaDataA, metaDataB, mode);
+ }
+
+ /**
+ * Write an Offset. Take appropriate write barrier actions.<p>
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param value The value of the new Offset
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void offsetWrite(ObjectReference src, Address slot, Offset value, Word metaDataA, Word metaDataB, int mode) {
+ VM.barriers.offsetWrite(src, value, metaDataA, metaDataB, mode);
+ }
+
+ /**
+ * Write a short. Take appropriate write barrier actions.<p>
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param value The value of the new short
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void shortWrite(ObjectReference src, Address slot, short value, Word metaDataA, Word metaDataB, int mode) {
+ VM.barriers.shortWrite(src, value, metaDataA, metaDataB, mode);
+ }
+
+ /**
+ * A number of shorts are about to be copied from object
+ * <code>src</code> to object <code>dst</code> (as in an array
+ * copy). Thus, <code>dst</code> is the mutated object. Take
+ * appropriate write barrier actions.<p>
+ *
+ * @param src The source array
+ * @param srcOffset The starting source offset
+ * @param dst The destination array
+ * @param dstOffset The starting destination offset
+ * @param bytes The number of bytes to be copied
+ * @return True if the update was performed by the barrier, false if
+ * left to the caller
+ */
+ public boolean shortBulkCopy(ObjectReference src, Offset srcOffset, ObjectReference dst, Offset dstOffset, int bytes) {
+ return false;
+ }
+
+ /**
+ * Write a Word. Take appropriate write barrier actions.<p>
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param value The value of the new Word
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ */
+ public void wordWrite(ObjectReference src, Address slot, Word value, Word metaDataA, Word metaDataB, int mode) {
+ VM.barriers.wordWrite(src, value, metaDataA, metaDataB, mode);
+ }
+
+ /**
+ * Attempt to atomically exchange the value in the given slot
+ * with the passed replacement value.
+ *
+ * @param src The object into which the new reference will be stored
+ * @param slot The address into which the new reference will be
+ * stored.
+ * @param old The old Word to be swapped out
+ * @param value The new Word
+ * @param metaDataA A value that assists the host VM in creating a store
+ * @param metaDataB A value that assists the host VM in creating a store
+ * @param mode The context in which the store occurred
+ * @return True if the swap was successful.
+ */
+ public boolean wordTryCompareAndSwap(ObjectReference src, Address slot, Word old, Word value, Word metaDataA, Word metaDataB, int mode) {
+ return VM.barriers.wordTryCompareAndSwap(src, old, value, metaDataA, metaDataB, mode);
+ }
+}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyimmix/StickyImmixConstraints.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyimmix/StickyImmixConstraints.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyimmix/StickyImmixConstraints.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyimmix/StickyImmixConstraints.java Sat Aug 14 07:25:41 2010
@@ -16,10 +16,7 @@
import org.mmtk.plan.immix.ImmixConstraints;
-import org.mmtk.policy.MarkSweepSpace;
-
import org.vmmagic.pragma.*;
-import org.vmmagic.unboxed.Word;
/**
* This class and its subclasses communicate to the host VM/Runtime
@@ -35,16 +32,12 @@
/** @return True if this plan requires a write barrier */
@Override
- public boolean needsWriteBarrier() { return true; }
+ public boolean needsObjectReferenceWriteBarrier() { return true; }
/** @return True if this Plan requires a header bit for object logging */
@Override
public boolean needsLogBitInHeader() { return true; }
- /** @return A bit which represents that a header is unlogged */
- @Override
- public Word unloggedBit() {return MarkSweepSpace.UNLOGGED_BIT; }
-
/** @return Size (in bytes) beyond which new regular objects must be allocated to the LOS */
@Override
public int maxNonLOSDefaultAllocBytes() { return MAX_IMMIX_OBJECT_BYTES; }
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyimmix/StickyImmixMutator.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyimmix/StickyImmixMutator.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyimmix/StickyImmixMutator.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyimmix/StickyImmixMutator.java Sat Aug 14 07:25:41 2010
@@ -15,6 +15,7 @@
import org.mmtk.plan.*;
import org.mmtk.plan.immix.ImmixMutator;
+import org.mmtk.utility.HeaderByte;
import org.mmtk.utility.deque.ObjectReferenceDeque;
import org.mmtk.vm.VM;
@@ -79,11 +80,11 @@
* @param mode The mode of the store (eg putfield, putstatic etc)
*/
@Inline
- public final void writeBarrier(ObjectReference src, Address slot,
+ public final void objectReferenceWrite(ObjectReference src, Address slot,
ObjectReference tgt, Word metaDataA, Word metaDataB, int mode) {
- if (Plan.logRequired(src))
+ if (HeaderByte.isUnlogged(src))
logSource(src);
- VM.barriers.performWriteInBarrier(src, slot, tgt, metaDataA, metaDataB, mode);
+ VM.barriers.objectReferenceWrite(src, tgt, metaDataA, metaDataB, mode);
}
/**
@@ -108,9 +109,9 @@
* left to the caller (always false in this case).
*/
@Inline
- public final boolean writeBarrier(ObjectReference src, Offset srcOffset,
+ public final boolean objectReferenceBulkCopy(ObjectReference src, Offset srcOffset,
ObjectReference dst, Offset dstOffset, int bytes) {
- if (Plan.logRequired(src))
+ if (HeaderByte.isUnlogged(src))
logSource(src);
return false;
}
@@ -127,8 +128,8 @@
* @param src The object to be logged
*/
private void logSource(ObjectReference src) {
- Plan.markAsLogged(src);
- modBuffer.push(src);
+ HeaderByte.markAsLogged(src);
+ modBuffer.push(src);
}
/**
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyimmix/StickyImmixNurseryTraceLocal.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyimmix/StickyImmixNurseryTraceLocal.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyimmix/StickyImmixNurseryTraceLocal.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyimmix/StickyImmixNurseryTraceLocal.java Sat Aug 14 07:25:41 2010
@@ -15,10 +15,10 @@
import static org.mmtk.policy.immix.ImmixConstants.MARK_LINE_AT_SCAN_TIME;
import static org.mmtk.policy.immix.ImmixConstants.TMP_PREFER_COPY_ON_NURSERY_GC;
-import org.mmtk.plan.Plan;
import org.mmtk.plan.TraceLocal;
import org.mmtk.plan.Trace;
import org.mmtk.policy.Space;
+import org.mmtk.utility.HeaderByte;
import org.mmtk.utility.deque.ObjectReferenceDeque;
import org.mmtk.vm.VM;
@@ -136,7 +136,7 @@
logMessage(2, "processing modBuffer");
while (!modBuffer.isEmpty()) {
ObjectReference src = modBuffer.pop();
- Plan.markAsUnlogged(src);
+ HeaderByte.markAsUnlogged(src);
processNode(src);
}
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyms/StickyMS.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyms/StickyMS.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyms/StickyMS.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyms/StickyMS.java Sat Aug 14 07:25:41 2010
@@ -83,7 +83,7 @@
* Static initialization
*/
{
- msSpace.isAgeSegregatedSpace(); /* this space is to be collected generationally */
+ msSpace.makeAgeSegregatedSpace(); /* this space is to be collected generationally */
}
/*****************************************************************************
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyms/StickyMSConstraints.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyms/StickyMSConstraints.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyms/StickyMSConstraints.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyms/StickyMSConstraints.java Sat Aug 14 07:25:41 2010
@@ -14,11 +14,9 @@
import org.mmtk.plan.marksweep.MSConstraints;
-import org.mmtk.policy.MarkSweepSpace;
import org.mmtk.policy.SegregatedFreeListSpace;
import org.vmmagic.pragma.*;
-import org.vmmagic.unboxed.Word;
/**
* This class and its subclasses communicate to the host VM/Runtime
@@ -34,15 +32,12 @@
/** @return True if this plan requires a write barrier */
@Override
- public boolean needsWriteBarrier() { return true; }
+ public boolean needsObjectReferenceWriteBarrier() { return true; }
/** @return True if this Plan requires a header bit for object logging */
@Override
public boolean needsLogBitInHeader() { return true; }
- /** @return A bit which represents that a header is unlogged */
- @Override
- public Word unloggedBit() {return MarkSweepSpace.UNLOGGED_BIT; }
@Override
public int maxNonLOSDefaultAllocBytes() { return SegregatedFreeListSpace.MAX_FREELIST_OBJECT_BYTES; }
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyms/StickyMSMutator.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyms/StickyMSMutator.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyms/StickyMSMutator.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyms/StickyMSMutator.java Sat Aug 14 07:25:41 2010
@@ -16,6 +16,7 @@
import org.mmtk.plan.marksweep.MSMutator;
import org.mmtk.policy.MarkSweepLocal;
+import org.mmtk.utility.HeaderByte;
import org.mmtk.utility.deque.ObjectReferenceDeque;
import org.mmtk.vm.VM;
@@ -80,11 +81,11 @@
* @param mode The mode of the store (eg putfield, putstatic etc)
*/
@Inline
- public final void writeBarrier(ObjectReference src, Address slot,
+ public final void objectReferenceWrite(ObjectReference src, Address slot,
ObjectReference tgt, Word metaDataA, Word metaDataB, int mode) {
- if (Plan.logRequired(src))
+ if (HeaderByte.isUnlogged(src))
logSource(src);
- VM.barriers.performWriteInBarrier(src, slot, tgt, metaDataA, metaDataB, mode);
+ VM.barriers.objectReferenceWrite(src, tgt, metaDataA, metaDataB, mode);
}
/**
@@ -109,9 +110,9 @@
* left to the caller (always false in this case).
*/
@Inline
- public final boolean writeBarrier(ObjectReference src, Offset srcOffset,
+ public final boolean objectReferenceBulkCopy(ObjectReference src, Offset srcOffset,
ObjectReference dst, Offset dstOffset, int bytes) {
- if (Plan.logRequired(src))
+ if (HeaderByte.isUnlogged(src))
logSource(src);
return false;
}
@@ -128,8 +129,8 @@
* @param src The object to be logged
*/
private void logSource(ObjectReference src) {
- Plan.markAsLogged(src);
- modBuffer.push(src);
+ HeaderByte.markAsLogged(src);
+ modBuffer.push(src);
}
/**
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyms/StickyMSNurseryTraceLocal.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyms/StickyMSNurseryTraceLocal.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyms/StickyMSNurseryTraceLocal.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/plan/stickyms/StickyMSNurseryTraceLocal.java Sat Aug 14 07:25:41 2010
@@ -12,10 +12,10 @@
*/
package org.mmtk.plan.stickyms;
-import org.mmtk.plan.Plan;
import org.mmtk.plan.TraceLocal;
import org.mmtk.plan.Trace;
import org.mmtk.policy.Space;
+import org.mmtk.utility.HeaderByte;
import org.mmtk.utility.deque.ObjectReferenceDeque;
import org.mmtk.vm.VM;
@@ -94,7 +94,7 @@
logMessage(2, "processing modBuffer");
while (!modBuffer.isEmpty()) {
ObjectReference src = modBuffer.pop();
- Plan.markAsUnlogged(src);
+ HeaderByte.markAsUnlogged(src);
processNode(src);
}
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/policy/CopySpace.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/policy/CopySpace.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/policy/CopySpace.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/policy/CopySpace.java Sat Aug 14 07:25:41 2010
@@ -12,11 +12,11 @@
*/
package org.mmtk.policy;
-import org.mmtk.plan.TraceLocal;
import org.mmtk.plan.TransitiveClosure;
import org.mmtk.utility.heap.*;
import org.mmtk.utility.options.Options;
import org.mmtk.utility.Constants;
+import org.mmtk.utility.ForwardingWord;
import org.mmtk.utility.Log;
import org.mmtk.vm.VM;
@@ -42,21 +42,6 @@
private static final int META_DATA_PAGES_PER_REGION = CARD_META_PAGES_PER_REGION;
- /*
- * The forwarding process uses three states to deal with a GC race:
- * 1. !GC_FORWARDED: Unforwarded
- * 2. GC_BEING_FORWARDED: Being forwarded (forwarding is underway)
- * 3. GC_FORWARDED: Forwarded
- */
- /** If this bit is set, then forwarding of this object has commenced */
- private static final Word GC_FORWARDED = Word.one().lsh(1); // ...10
- /** If this bit is set, then forwarding of this object is incomplete */
- private static final Word GC_BEING_FORWARDED = Word.one().lsh(2).minus(Word.one()); // ...11
- /** This mask is used to reveal which state this object is in with respect to forwarding */
- private static final Word GC_FORWARDING_MASK = GC_FORWARDED.or(GC_BEING_FORWARDED);
-
- /** A single bit is used to indicate a mark when tracing (but not copying) the space */
- private static final Word GC_MARK_BIT_MASK = Word.one();
/****************************************************************************
*
@@ -68,6 +53,12 @@
return fromSpace;
}
+ /** fromSpace CopySpace can always move, toSpace will not move during current GC */
+ @Override
+ public boolean isMovable() {
+ return fromSpace;
+ }
+
/****************************************************************************
*
* Initialization
@@ -115,7 +106,7 @@
*/
public void release() {
((MonotonePageResource) pr).reset();
- lastDiscontiguousRegion = Address.zero();
+ headDiscontiguousRegion = Address.zero();
fromSpace = false;
}
@@ -177,21 +168,21 @@
if (!fromSpace) return object;
/* Try to forward the object */
- Word forwardingPtr = attemptToForward(object);
+ Word forwardingWord = ForwardingWord.attemptToForward(object);
- if (stateIsForwardedOrBeingForwarded(forwardingPtr)) {
+ if (ForwardingWord.stateIsForwardedOrBeingForwarded(forwardingWord)) {
/* Somebody else got to it first. */
/* We must wait (spin) if the object is not yet fully forwarded */
- while (stateIsBeingForwarded(forwardingPtr))
- forwardingPtr = getForwardingWord(object);
+ while (ForwardingWord.stateIsBeingForwarded(forwardingWord))
+ forwardingWord = VM.objectModel.readAvailableBitsWord(object);
/* Now extract the object reference from the forwarding word and return it */
- return forwardingPtr.and(GC_FORWARDING_MASK.not()).toAddress().toObjectReference();
+ return ForwardingWord.extractForwardingPointer(forwardingWord);
} else {
/* We are the designated copier, so forward it and enqueue it */
ObjectReference newObject = VM.objectModel.copy(object, allocator);
- setForwardingPointer(object, newObject);
+ ForwardingWord.setForwardingPointer(object, newObject);
trace.processNode(newObject); // Scan it later
if (VM.VERIFY_ASSERTIONS && Options.verbose.getValue() >= 9) {
@@ -212,7 +203,7 @@
* @return True if this object is live in this GC (has it been forwarded?)
*/
public boolean isLive(ObjectReference object) {
- return isForwarded(object);
+ return ForwardingWord.isForwarded(object);
}
/**
@@ -223,26 +214,7 @@
* @return True if the object is reachable.
*/
public boolean isReachable(ObjectReference object) {
- return !fromSpace || isForwarded(object);
- }
-
- /****************************************************************************
- *
- * Non-copying tracing (just mark, don't forward)
- */
-
- /**
- * Mark an object as having been traversed, *WITHOUT* forwarding the object.
- * This is only used when
- *
- * @param object The object to be marked
- * @param markState The sense of the mark bit (flips from 0 to 1)
- */
- @Inline
- public static void markObject(TraceLocal trace, ObjectReference object,
- Word markState) {
- if (testAndMark(object, markState))
- trace.processNode(object);
+ return !fromSpace || ForwardingWord.isForwarded(object);
}
/****************************************************************************
@@ -260,148 +232,4 @@
@Inline
public void postAlloc(ObjectReference object) {}
- /**
- * Clear the GC portion of the header for an object.
- *
- * @param object the object ref to the storage to be initialized
- */
- @Inline
- public static void clearGCBits(ObjectReference object) {
- Word header = VM.objectModel.readAvailableBitsWord(object);
- VM.objectModel.writeAvailableBitsWord(object, header.and(GC_FORWARDING_MASK.not()));
- }
-
- /**
- * Has an object been forwarded?
- *
- * @param object The object to be checked
- * @return True if the object has been forwarded
- */
- @Inline
- public static boolean isForwarded(ObjectReference object) {
- return stateIsForwarded(getForwardingWord(object));
- }
-
- /**
- * Has an object been forwarded or being forwarded?
- *
- * @param object The object to be checked
- * @return True if the object has been forwarded or is being forwarded
- */
- @Inline
- public static boolean isForwardedOrBeingForwarded(ObjectReference object) {
- return stateIsForwardedOrBeingForwarded(getForwardingWord(object));
- }
-
- /**
- * Non-atomic read of forwarding pointer word
- *
- * @param object The object whose forwarding word is to be read
- * @return The forwarding word stored in <code>object</code>'s
- * header.
- */
- @Inline
- private static Word getForwardingWord(ObjectReference object) {
- return VM.objectModel.readAvailableBitsWord(object);
- }
-
- /**
- * Non-atomic read of forwarding pointer
- *
- * @param object The object whose forwarding pointer is to be read
- * @return The forwarding pointer stored in <code>object</code>'s
- * header.
- */
- @Inline
- public static ObjectReference getForwardingPointer(ObjectReference object) {
- return getForwardingWord(object).and(GC_FORWARDING_MASK.not()).toAddress().toObjectReference();
- }
-
- /**
- * Used to mark boot image objects during a parallel scan of objects
- * during GC Returns true if marking was done.
- *
- * @param object The object to be marked
- * @param value The value to store in the mark bit
- */
- @Inline
- private static boolean testAndMark(ObjectReference object, Word value) {
- Word oldValue;
- do {
- oldValue = VM.objectModel.prepareAvailableBits(object);
- Word markBit = oldValue.and(GC_MARK_BIT_MASK);
- if (markBit.EQ(value)) return false;
- } while (!VM.objectModel.attemptAvailableBits(object, oldValue,
- oldValue.xor(GC_MARK_BIT_MASK)));
- return true;
- }
-
- /**
- * Either return the forwarding pointer if the object is already
- * forwarded (or being forwarded) or write the bit pattern that
- * indicates that the object is being forwarded
- *
- * @param object The object to be forwarded
- * @return The forwarding pointer for the object if it has already
- * been forwarded.
- */
- @Inline
- private static Word attemptToForward(ObjectReference object) {
- Word oldValue;
- do {
- oldValue = VM.objectModel.prepareAvailableBits(object);
- if (oldValue.and(GC_FORWARDING_MASK).EQ(GC_FORWARDED)) return oldValue;
- } while (!VM.objectModel.attemptAvailableBits(object, oldValue,
- oldValue.or(GC_BEING_FORWARDED)));
- return oldValue;
- }
-
- /**
- * Is the state of the forwarding word being forwarded?
- *
- * @param fword A forwarding word.
- * @return True if the forwarding word's state is being forwarded.
- */
- @Inline
- private static boolean stateIsBeingForwarded(Word fword) {
- return fword.and(GC_FORWARDING_MASK).EQ(GC_BEING_FORWARDED);
- }
-
- /**
- * Is the state of the forwarding word forwarded?
- *
- * @param fword A forwarding word.
- * @return True if the forwarding word's state is forwarded.
- */
- @Inline
- private static boolean stateIsForwarded(Word fword) {
- return fword.and(GC_FORWARDING_MASK).EQ(GC_FORWARDED);
- }
-
- /**
- * Is the state of the forwarding word forwarded or being forwarded?
- *
- * @param fword A forwarding word.
- * @return True if the forwarding word's state is forwarded or being
- * forwarded.
- */
- @Inline
- public static boolean stateIsForwardedOrBeingForwarded(Word fword) {
- return !(fword.and(GC_FORWARDED).isZero());
- }
-
- /**
- * Non-atomic write of forwarding pointer word (assumption, thread
- * doing the set has done attempt to forward and owns the right to
- * copy the object)
- *
- * @param object The object whose forwarding pointer is to be set
- * @param ptr The forwarding pointer to be stored in the object's
- * forwarding word
- */
- @Inline
- private static void setForwardingPointer(ObjectReference object,
- ObjectReference ptr) {
- VM.objectModel.writeAvailableBitsWord(object, ptr.toAddress().toWord().or(GC_FORWARDED));
- }
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/policy/ImmortalSpace.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/policy/ImmortalSpace.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/policy/ImmortalSpace.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/policy/ImmortalSpace.java Sat Aug 14 07:25:41 2010
@@ -17,6 +17,7 @@
import org.mmtk.utility.heap.MonotonePageResource;
import org.mmtk.utility.heap.VMRequest;
import org.mmtk.utility.Constants;
+import org.mmtk.utility.HeaderByte;
import org.mmtk.vm.VM;
@@ -37,14 +38,14 @@
*
* Class variables
*/
- static final Word GC_MARK_BIT_MASK = Word.one();
+ static final byte GC_MARK_BIT_MASK = 1;
private static final int META_DATA_PAGES_PER_REGION = CARD_META_PAGES_PER_REGION;
/****************************************************************************
*
* Instance variables
*/
- private Word markState = Word.zero(); // when GC off, the initialization value
+ private byte markState = 0; // when GC off, the initialization value
/****************************************************************************
*
@@ -71,7 +72,7 @@
/** @return the current mark state */
@Inline
- public Word getMarkState() { return markState; }
+ public Word getMarkState() { return Word.fromIntZeroExtend(markState); }
/****************************************************************************
*
@@ -85,10 +86,10 @@
* @param object The newly allocated object instance whose header we are initializing
*/
public void initializeHeader(ObjectReference object) {
- Word oldValue = VM.objectModel.readAvailableBitsWord(object);
- Word newValue = oldValue.and(GC_MARK_BIT_MASK.not()).or(markState);
- if (Plan.NEEDS_LOG_BIT_IN_HEADER) newValue = newValue.or(Plan.UNLOGGED_BIT);
- VM.objectModel.writeAvailableBitsWord(object, newValue);
+ byte oldValue = VM.objectModel.readAvailableByte(object);
+ byte newValue = (byte) ((oldValue & GC_MARK_BIT_MASK) | markState);
+ if (HeaderByte.NEEDS_UNLOGGED_BIT) newValue |= HeaderByte.UNLOGGED_BIT;
+ VM.objectModel.writeAvailableByte(object, newValue);
}
/**
@@ -96,14 +97,14 @@
* Returns true if marking was done.
*/
@Inline
- private static boolean testAndMark(ObjectReference object, Word value) {
+ private static boolean testAndMark(ObjectReference object, byte value) {
Word oldValue;
do {
oldValue = VM.objectModel.prepareAvailableBits(object);
- Word markBit = oldValue.and(GC_MARK_BIT_MASK);
- if (markBit.EQ(value)) return false;
+ byte markBit = (byte) (oldValue.toInt() & GC_MARK_BIT_MASK);
+ if (markBit == value) return false;
} while (!VM.objectModel.attemptAvailableBits(object, oldValue,
- oldValue.xor(GC_MARK_BIT_MASK)));
+ oldValue.xor(Word.fromIntZeroExtend(GC_MARK_BIT_MASK))));
return true;
}
@@ -129,7 +130,7 @@
* collections.
*/
public void prepare() {
- markState = GC_MARK_BIT_MASK.minus(markState);
+ markState = (byte) (GC_MARK_BIT_MASK - markState);
}
public void release() {}
@@ -166,6 +167,6 @@
if (Plan.SCAN_BOOT_IMAGE && this == Plan.vmSpace)
return true; // ignore boot image "reachabilty" if we're not tracing it
else
- return (VM.objectModel.readAvailableBitsWord(object).and(GC_MARK_BIT_MASK).EQ(markState));
+ return (VM.objectModel.readAvailableByte(object) & GC_MARK_BIT_MASK) == markState;
}
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/policy/LargeObjectSpace.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/policy/LargeObjectSpace.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/policy/LargeObjectSpace.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/policy/LargeObjectSpace.java Sat Aug 14 07:25:41 2010
@@ -12,10 +12,10 @@
*/
package org.mmtk.policy;
-import org.mmtk.plan.Plan;
import org.mmtk.plan.TransitiveClosure;
import org.mmtk.utility.heap.FreeListPageResource;
import org.mmtk.utility.heap.VMRequest;
+import org.mmtk.utility.HeaderByte;
import org.mmtk.utility.Treadmill;
import org.mmtk.vm.VM;
@@ -36,15 +36,15 @@
*/
public static final int LOCAL_GC_BITS_REQUIRED = 2;
public static final int GLOBAL_GC_BITS_REQUIRED = 0;
- private static final Word MARK_BIT = Word.one(); // ...01
- private static final Word NURSERY_BIT = Word.fromIntZeroExtend(2); // ...10
- private static final Word LOS_BIT_MASK = Word.fromIntZeroExtend(3); // ...11
+ private static final byte MARK_BIT = 1; // ...01
+ private static final byte NURSERY_BIT = 2; // ...10
+ private static final byte LOS_BIT_MASK = 3; // ...11
/****************************************************************************
*
* Instance variables
*/
- private Word markState;
+ private byte markState;
private boolean inNurseryGC;
private final Treadmill treadmill;
@@ -66,7 +66,7 @@
public LargeObjectSpace(String name, int pageBudget, VMRequest vmRequest) {
super(name, pageBudget, vmRequest);
treadmill = new Treadmill(LOG_BYTES_IN_PAGE, true);
- markState = Word.zero();
+ markState = 0;
}
/****************************************************************************
@@ -84,7 +84,7 @@
if (VM.VERIFY_ASSERTIONS) {
VM.assertions._assert(treadmill.fromSpaceEmpty());
}
- markState = MARK_BIT.minus(markState);
+ markState = (byte) (MARK_BIT - markState);
}
treadmill.flip(fullHeap);
inNurseryGC = !fullHeap;
@@ -194,11 +194,11 @@
*/
@Inline
public void initializeHeader(ObjectReference object, boolean alloc) {
- Word oldValue = VM.objectModel.readAvailableBitsWord(object);
- Word newValue = oldValue.and(LOS_BIT_MASK.not()).or(markState);
- if (alloc) newValue = newValue.or(NURSERY_BIT);
- if (Plan.NEEDS_LOG_BIT_IN_HEADER) newValue = newValue.or(Plan.UNLOGGED_BIT);
- VM.objectModel.writeAvailableBitsWord(object, newValue);
+ byte oldValue = VM.objectModel.readAvailableByte(object);
+ byte newValue = (byte) ((oldValue & ~LOS_BIT_MASK) | markState);
+ if (alloc) newValue |= NURSERY_BIT;
+ if (HeaderByte.NEEDS_UNLOGGED_BIT) newValue |= HeaderByte.UNLOGGED_BIT;
+ VM.objectModel.writeAvailableByte(object, newValue);
Address cell = VM.objectModel.objectStartRef(object);
treadmill.addToTreadmill(Treadmill.midPayloadToNode(cell), alloc);
}
@@ -211,14 +211,14 @@
* @param value The value to which the mark bit will be set
*/
@Inline
- private boolean testAndMark(ObjectReference object, Word value) {
- Word oldValue, markBit;
+ private boolean testAndMark(ObjectReference object, byte value) {
+ Word oldValue;
do {
oldValue = VM.objectModel.prepareAvailableBits(object);
- markBit = oldValue.and(inNurseryGC ? LOS_BIT_MASK : MARK_BIT);
- if (markBit.EQ(value)) return false;
+ byte markBit = (byte) (oldValue.toInt() & (inNurseryGC ? LOS_BIT_MASK : MARK_BIT));
+ if (markBit == value) return false;
} while (!VM.objectModel.attemptAvailableBits(object, oldValue,
- oldValue.and(LOS_BIT_MASK.not()).or(value)));
+ oldValue.and(Word.fromIntZeroExtend(LOS_BIT_MASK).not()).or(Word.fromIntZeroExtend(value))));
return true;
}
@@ -230,8 +230,8 @@
* @return True if the mark bit for the object has the given value.
*/
@Inline
- private boolean testMarkBit(ObjectReference object, Word value) {
- return VM.objectModel.readAvailableBitsWord(object).and(MARK_BIT).EQ(value);
+ private boolean testMarkBit(ObjectReference object, byte value) {
+ return (byte) (VM.objectModel.readAvailableByte(object) & MARK_BIT) == value;
}
/**
@@ -242,7 +242,7 @@
*/
@Inline
private boolean isInNursery(ObjectReference object) {
- return VM.objectModel.readAvailableBitsWord(object).and(NURSERY_BIT).EQ(NURSERY_BIT);
+ return (byte)(VM.objectModel.readAvailableByte(object) & NURSERY_BIT) == NURSERY_BIT;
}
/**
Added: vmkit/trunk/mmtk/java/src/org/mmtk/policy/MarkCompactCollector.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/policy/MarkCompactCollector.java?rev=111072&view=auto
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/policy/MarkCompactCollector.java (added)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/policy/MarkCompactCollector.java Sat Aug 14 07:25:41 2010
@@ -0,0 +1,544 @@
+/*
+ * This file is part of the Jikes RVM project (http://jikesrvm.org).
+ *
+ * This file is licensed to You under the Eclipse Public License (EPL);
+ * You may not use this file except in compliance with the License. You
+ * may obtain a copy of the License at
+ *
+ * http://www.opensource.org/licenses/eclipse-1.0.php
+ *
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.
+ */
+package org.mmtk.policy;
+
+import org.mmtk.plan.markcompact.MC;
+import org.mmtk.utility.Log;
+import org.mmtk.utility.alloc.Allocator;
+import org.mmtk.utility.alloc.BumpPointer;
+import org.mmtk.vm.VM;
+import org.vmmagic.pragma.Inline;
+import org.vmmagic.pragma.Uninterruptible;
+import org.vmmagic.unboxed.Address;
+import org.vmmagic.unboxed.Extent;
+import org.vmmagic.unboxed.ObjectReference;
+
+/**
+ * This class implements unsynchronized (local) per-collector-thread elements of a
+ * sliding mark-compact collector.
+ *
+ * Specifically, this class provides the methods that
+ * - Calculate the forwarding pointers for heap objects, in a linear pass over
+ * (part of) the heap
+ * - Performs the compaction pass over the heap.
+ *
+ * Each collector thread maintains a private list of the pages that it compacts.
+ * If it runs out of work during the calculateForwardingPointers pass, it requests
+ * a new region from the global MarkCompactSpace. Regions compacted by a collector
+ * remain local to the collector.
+ *
+ * @see MarkCompactSpace
+ * @see MarkCompactLocal
+ */
+ at Uninterruptible
+public final class MarkCompactCollector {
+
+ static final boolean VERBOSE = false;
+
+ static final boolean VERY_VERBOSE = VERBOSE && false;
+
+ private final MarkCompactSpace space;
+
+ /**
+ * This collector's work list
+ */
+ private Address regions = Address.zero();
+
+ private final FromCursor fromCursor = new FromCursor();
+ private final ToCursor toCursor = new ToCursor();
+
+ /**
+ * Constructor
+ *
+ * @param space The space to bump point into.
+ */
+ public MarkCompactCollector(MarkCompactSpace space) {
+ this.space = space;
+ }
+
+ /* ********************************************************************************
+ *
+ * Cursor classes
+ *
+ */
+
+ /**
+ * Both the 'compact' and 'calculate' phases can be thought of as sweeping
+ * a pair of cursors across a linked list of regions. Each cursor requires
+ * maintaining pointers to the current region, the current address and the end of
+ * the region. The regionCursor class maintains these 3 pointers, while the
+ * subclasses ToCursor and FromCursor provide methods specific to the
+ * read and write pointers.
+ */
+ @Uninterruptible
+ private abstract static class RegionCursor {
+
+ /** Name of the cursor - for debugging messages */
+ private final String name;
+
+ /**
+ * The current region, or zero if the cursor is invalid (eg after advancing
+ * past the end of the current work list
+ */
+ protected Address region;
+
+ /**
+ * The limit of the current region. When reading a populated region, this is the
+ * address of the last used byte. When writing to a fresh region, this is the last
+ * byte in the region.
+ */
+ protected Address limit;
+
+ /** The current address */
+ protected Address cursor;
+
+ /**
+ * @param name The name of the region - for debugging messages.
+ */
+ public RegionCursor(String name) {
+ this.name = name;
+ }
+
+ /**
+ * Hook to allow subclasses to initialize the cursor in different ways.
+ *
+ * @param region The region to be processed.
+ */
+ abstract void init(Address region);
+
+ /**
+ * Assert that the cursor is within the bounds of the region. Calls to this
+ * must be guarded by {@code if (VM.VERIFY_ASSERTIONS)}
+ */
+ protected void assertCursorInBounds() {
+ VM.assertions._assert(!region.isZero());
+ VM.assertions._assert(cursor.GE(BumpPointer.getDataStart(region)),
+ "Cursor is below start of region");
+ VM.assertions._assert(cursor.LE(limit),"Cursor beyond end of region");
+ }
+
+ /**
+ * Increment the cursor.
+ * @param size Bytes to increment by
+ */
+ void inc(int size) {
+ this.cursor = cursor.plus(size);
+ if (VM.VERIFY_ASSERTIONS) assertCursorInBounds();
+ }
+
+ /**
+ * Increment the cursor to a specific address
+ * @param cursor Destination address
+ */
+ public void incTo(Address cursor) {
+ if (VM.VERIFY_ASSERTIONS) assertCursorInBounds();
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(cursor.GE(this.cursor));
+ this.cursor = cursor;
+ }
+
+ /**
+ * @param other Other region
+ * @return {@code true} if this cursor points to the same region as {@code other}
+ */
+ boolean sameRegion(RegionCursor other) {
+ return region.EQ(other.getRegion());
+ }
+
+ /**
+ * @param size Size in bytes
+ * @return {@code true} if {@code size} bytes are available in the current region
+ */
+ boolean isAvailable(int size) {
+ return cursor.plus(size).LE(limit);
+ }
+
+ /**
+ * @return The current cursor
+ */
+ public Address get() {
+ return cursor;
+ }
+
+ /**
+ * @return The current region pointer
+ */
+ public Address getRegion() {
+ return region;
+ }
+
+ /**
+ * @return The current region limit
+ */
+ public Address getLimit() {
+ return limit;
+ }
+
+ /**
+ * Follow the linked-list of regions to the next region.
+ */
+ void advanceToNextRegion() {
+ Address nextRegion = MarkCompactLocal.getNextRegion(region);
+ if (nextRegion.isZero()) {
+ region = Address.zero();
+ } else {
+ init(nextRegion);
+ if (VM.VERIFY_ASSERTIONS) assertCursorInBounds();
+ }
+ }
+
+ /**
+ * @return {@code true} if we haven't advanced beyond the end of the region list
+ */
+ boolean isValid() {
+ return !region.isZero();
+ }
+
+ /**
+ * @param ref The object in question
+ * @return {@code true} if the object's start address is in this region
+ */
+ @Inline
+ boolean isInRegion(ObjectReference ref) {
+ Address addr = VM.objectModel.refToAddress(ref);
+ return addr.GE(BumpPointer.getDataStart(region)) && addr.LE(limit);
+ }
+
+ /**
+ * Print the cursor - for debugging
+ */
+ void print() {
+ Log.write(name); Log.write(" cursor:");
+ Log.write(" region="); Log.write(region);
+ Log.write(" limit="); Log.write(limit);
+ Log.write(" cursor="); Log.write(cursor);
+ Log.writeln();
+
+ }
+ }
+
+ /**
+ * Subclass for the read-only cursor that leads the scan of regions.
+ */
+ @Uninterruptible
+ private static final class FromCursor extends RegionCursor {
+ public FromCursor() {
+ super("from");
+ }
+
+ /**
+ * Initialize the cursor - the limit is the end of the allocated data
+ */
+ @Override
+ void init(Address region) {
+ if (VM.VERIFY_ASSERTIONS) BumpPointer.checkRegionMetadata(region);
+ this.region = region;
+ this.cursor = MarkCompactLocal.getDataStart(region);
+ this.limit = MarkCompactLocal.getDataEnd(region);
+ }
+
+ /**
+ * Advance from the cursor to the start of the next object.
+ * @return The object reference of the next object.
+ */
+ @Inline
+ ObjectReference advanceToObject() {
+ ObjectReference current = VM.objectModel.getObjectFromStartAddress(cursor);
+ cursor = VM.objectModel.objectStartRef(current);
+ if (VM.VERIFY_ASSERTIONS) {
+ Address lowBound = BumpPointer.getDataStart(region);
+ VM.assertions._assert(cursor.GE(lowBound) && cursor.LE(limit),"Cursor outside region");
+ }
+ return current;
+ }
+
+ /**
+ * Advance the cursor to the end of the given object.
+ * @return The object reference of the next object.
+ */
+ @Inline
+ void advanceToObjectEnd(ObjectReference current) {
+ cursor = VM.objectModel.getObjectEndAddress(current);
+ if (VM.VERIFY_ASSERTIONS) assertCursorInBounds();
+ }
+
+ /**
+ * Advance the cursor either to the next region in the list,
+ * or to a new region allocated from the global list.
+ * @param m
+ */
+ void advanceToNextForwardableRegion(MarkCompactSpace space) {
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(get().EQ(getLimit()));
+ Address nextRegion = BumpPointer.getNextRegion(region);
+ if (nextRegion.isZero()) {
+ nextRegion = space.getNextRegion();
+ if (nextRegion.isZero()) {
+ region = Address.zero();
+ return;
+ }
+ MarkCompactLocal.setNextRegion(region,nextRegion);
+ MarkCompactLocal.clearNextRegion(nextRegion);
+ }
+ init(nextRegion);
+ if (VM.VERIFY_ASSERTIONS) assertCursorInBounds();
+ }
+
+ /**
+ * Override the superclass with an additional assertion - we only advance
+ * when we have read to the end, and the cursor must point *precisely*
+ * to the last allocated byte in the region.
+ */
+ @Override
+ void advanceToNextRegion() {
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(get().EQ(getLimit()));
+ super.advanceToNextRegion();
+ }
+
+ /**
+ * @return {@code true} if there are more objects in this region
+ */
+ boolean hasMoreObjects() {
+ return cursor.LT(limit);
+ }
+ }
+
+ /**
+ * Subclass for the read-only cursor that follows the 'from' cursor,
+ * writing or calculating the position of copied objects
+ */
+ @Uninterruptible
+ private static final class ToCursor extends RegionCursor {
+ public ToCursor() {
+ super("to");
+ }
+
+ /**
+ * Initialize the cursor to a given region. The limit is the limit of
+ * available space in the region.
+ */
+ @Override
+ void init(Address region) {
+ if (VM.VERIFY_ASSERTIONS) BumpPointer.checkRegionMetadata(region);
+ this.region = region;
+ this.cursor = MarkCompactLocal.getDataStart(region);
+ this.limit = MarkCompactLocal.getRegionLimit(region);
+ if (VM.VERIFY_ASSERTIONS) assertCursorInBounds();
+ }
+
+ /**
+ * Update the metadata of the current region with the current value
+ * of the cursor. Zero the region from here to the end.
+ */
+ void finish() {
+ if (VM.VERIFY_ASSERTIONS) assertCursorInBounds();
+ Extent zeroBytes = limit.diff(cursor).toWord().toExtent();
+ VM.memory.zero(cursor, zeroBytes);
+ MarkCompactLocal.setDataEnd(region, cursor);
+ MarkCompactLocal.checkRegionMetadata(region);
+ }
+
+ /**
+ * Terminate the list of regions here.
+ * @return The address of the (old) next region in the list.
+ */
+ Address snip() {
+ Address nextRegion = BumpPointer.getNextRegion(region);
+ BumpPointer.clearNextRegion(region);
+ finish();
+ return nextRegion;
+ }
+
+ /**
+ * Copy an object to an address within this cursor's region.
+ * @param from The source object
+ * @param to The target object
+ */
+ @Inline
+ void copy(ObjectReference from, ObjectReference to) {
+ if (VM.VERIFY_ASSERTIONS) {
+ VM.assertions._assert(MarkCompactSpace.getForwardingPointer(from).toAddress().EQ(to.toAddress()));
+ VM.assertions._assert(cursor.GT(region) && cursor.LE(limit));
+ }
+ Address savedCursor = Address.zero();
+ if (VM.VERIFY_ASSERTIONS) savedCursor = cursor;
+ cursor = VM.objectModel.copyTo(from, to, cursor);
+ if (VM.VERIFY_ASSERTIONS) {
+ if (cursor.LT(BumpPointer.getDataStart(region)) || cursor.GT(limit)) {
+ Log.write("Copy of "); Log.write(from);
+ Log.write(" to "); Log.write(to);
+ Log.write(" puts cursor at "); Log.write(cursor);
+ Log.write(" (was: "); Log.write(savedCursor);
+ Log.writeln(")");
+ }
+ VM.assertions._assert(cursor.GT(region) && cursor.LE(limit));
+ }
+ MarkCompactSpace.setForwardingPointer(to, ObjectReference.nullReference());
+ if (VM.VERIFY_ASSERTIONS)
+ VM.assertions._assert(VM.objectModel.getObjectEndAddress(to).LE(limit));
+ }
+
+ /**
+ * Move to the next region, updating the metadata with the current 'write' state.
+ */
+ void finishAndAdvanceToNextRegion() {
+ finish();
+ advanceToNextRegion();
+ }
+
+ /**
+ * Move to the next region, in read-only mode. Add the assertion of validity,
+ * since we shouldn't be able to fall off the end of the list while writing.
+ */
+ @Override
+ void advanceToNextRegion() {
+ super.advanceToNextRegion();
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(isValid());
+ }
+ }
+
+ /* ***************************************************************************************** */
+
+ /**
+ * Perform a linear scan through the objects allocated by this bump pointer,
+ * calculating where each live object will be post collection.
+ *
+ * We maintain two cursors, {@code fromCursor} and {@code toCursor}, and simulate
+ * copying live objects from the former to the latter. Initially, the cursors
+ * point to the first region in this collector's local list, and increment in
+ * lockstep until the first dead object is encountered. After that, the to cursor
+ * trails the from cursor.
+ *
+ * The outer loop advances the 'from' pointer
+ */
+ public void calculateForwardingPointers() {
+ if (regions.isZero()) {
+ regions = space.getNextRegion();
+ }
+
+ if (regions.isZero())
+ return;
+
+ fromCursor.init(regions);
+ toCursor.init(regions);
+
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(true);
+
+ /* Loop through active regions or until the last region */
+ while (fromCursor.isValid()) {
+ if (VERBOSE) {
+ fromCursor.print();
+ toCursor.print();
+ }
+
+ /* Loop through the objects in the current 'from' region */
+ while (fromCursor.hasMoreObjects()) {
+ ObjectReference current = fromCursor.advanceToObject();
+ fromCursor.advanceToObjectEnd(current);
+
+ if (MarkCompactSpace.toBeCompacted(current)) {
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(MarkCompactSpace.getForwardingPointer(current).isNull());
+
+ // Fake - allocate it.
+ int size = VM.objectModel.getSizeWhenCopied(current);
+ int align = VM.objectModel.getAlignWhenCopied(current);
+ int offset = VM.objectModel.getAlignOffsetWhenCopied(current);
+ // Move to the (aligned) start of the next object
+ toCursor.incTo(Allocator.alignAllocationNoFill(toCursor.get(), align, offset));
+
+ /*
+ * If we're allocating into separate regions, and we've allocated beyond the end of the
+ * current region, advance to the next one. We always allocate into regions we have
+ * scanned in this collector.
+ */
+ if (!toCursor.sameRegion(fromCursor) && !toCursor.isAvailable(size)) {
+ // The 'to' pointer always trails the 'from' pointer, guaranteeing that
+ // there's a next region to advance to.
+ toCursor.advanceToNextRegion();
+ toCursor.incTo(Allocator.alignAllocationNoFill(toCursor.get(), align, offset));
+ }
+
+ ObjectReference target = VM.objectModel.getReferenceWhenCopiedTo(current, toCursor.get());
+ if (toCursor.sameRegion(fromCursor) && target.toAddress().GE(current.toAddress())) {
+ // Don't move the object.
+ MarkCompactSpace.setForwardingPointer(current, current);
+ toCursor.incTo(VM.objectModel.getObjectEndAddress(current));
+ } else {
+ MarkCompactSpace.setForwardingPointer(current, target);
+ toCursor.inc(size);
+ }
+ }
+ }
+ fromCursor.advanceToNextForwardableRegion(space);
+ }
+ }
+
+
+ /**
+ * Perform the compacting phase of the collection.
+ */
+ public void compact() {
+ if (regions.isZero()) return;
+
+ toCursor.init(regions);
+ fromCursor.init(regions);
+
+ /* Loop through active regions or until the last region */
+ while (fromCursor.isValid()) {
+ if (VERBOSE) {
+ Log.write("Compacting from region "); Log.write(fromCursor.getRegion());
+ Log.write(" to region "); Log.writeln(toCursor.getRegion());
+ }
+
+ /* Loop through the objects in the region */
+ while (fromCursor.hasMoreObjects()) {
+ ObjectReference current = fromCursor.advanceToObject();
+ fromCursor.advanceToObjectEnd(current);
+
+ ObjectReference copyTo = MarkCompactSpace.getForwardingPointer(current);
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!copyTo.toAddress().EQ(Address.fromIntZeroExtend(VM.ALIGNMENT_VALUE)));
+
+ if (!copyTo.isNull() && Space.isInSpace(MC.MARK_COMPACT, copyTo)) {
+ if (VM.VERIFY_ASSERTIONS) {
+ if (MarkCompactSpace.isMarked(current)) {
+ Log.write("Object "); Log.write(current);
+ Log.writeln(" is marked during the compact phase");
+ }
+ VM.assertions._assert(!MarkCompactSpace.isMarked(current));
+ }
+ if (!toCursor.isInRegion(copyTo)) {
+ // Update metadata and move on
+ toCursor.finishAndAdvanceToNextRegion();
+ }
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(toCursor.isInRegion(copyTo));
+ toCursor.copy(current, copyTo);
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(toCursor.isInRegion(copyTo));
+ MarkCompactSpace.setForwardingPointer(copyTo, ObjectReference.nullReference());
+ }
+ }
+ fromCursor.advanceToNextRegion();
+ }
+
+ /* Fix up the last object pointer etc */
+ toCursor.finish();
+
+
+ /*
+ * Return unused pages to the global page resource
+ */
+ Address region = toCursor.snip();
+ while (!region.isZero()) {
+ Address nextRegion = MarkCompactLocal.getNextRegion(region);
+ space.release(region);
+ region = nextRegion;
+ }
+ }
+}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/policy/MarkCompactLocal.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/policy/MarkCompactLocal.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/policy/MarkCompactLocal.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/policy/MarkCompactLocal.java Sat Aug 14 07:25:41 2010
@@ -12,16 +12,9 @@
*/
package org.mmtk.policy;
-import org.mmtk.plan.markcompact.MC;
-import org.mmtk.utility.Conversions;
-import org.mmtk.utility.alloc.Allocator;
import org.mmtk.utility.alloc.BumpPointer;
-import org.mmtk.vm.VM;
-
-import org.vmmagic.pragma.*;
-import org.vmmagic.unboxed.Address;
+import org.vmmagic.pragma.Uninterruptible;
import org.vmmagic.unboxed.Extent;
-import org.vmmagic.unboxed.ObjectReference;
/**
* This class implements unsynchronized (local) elements of a
@@ -31,7 +24,8 @@
* @see BumpPointer
* @see MarkCompactSpace
*/
- at Uninterruptible public final class MarkCompactLocal extends BumpPointer {
+ at Uninterruptible
+public final class MarkCompactLocal extends BumpPointer {
/**
* Constructor
@@ -42,163 +36,28 @@
super(space, true);
}
- /**
- * Perform the compacting phase of the collection.
- */
- public void compact() {
- /* Has this allocator ever allocated anything? */
- if (initialRegion.isZero()) return;
-
- /* Loop through active regions or until the last region */
- Address start = initialRegion;
- Address allocStart = initialRegion;
- Address allocEnd = initialRegion.plus(REGION_LIMIT_OFFSET).loadAddress();
- Address allocCursor = allocStart.plus(DATA_START_OFFSET);
-
- /* Keep track of which regions are being used */
- int oldPages = 0;
- int newPages = Conversions.bytesToPages(allocEnd.diff(allocStart).plus(BYTES_IN_ADDRESS));
-
- while (!start.isZero()) {
- /* Get the end of this region */
- Address end = start.plus(REGION_LIMIT_OFFSET).loadAddress();
- Address dataEnd = start.plus(DATA_END_OFFSET).loadAddress();
- Address nextRegion = start.plus(NEXT_REGION_OFFSET).loadAddress();
- oldPages += Conversions.bytesToPages(end.diff(start).plus(BYTES_IN_ADDRESS));
-
- /* dataEnd = zero represents the current region. */
- Address currentLimit = (dataEnd.isZero() ? cursor : dataEnd);
- ObjectReference current =
- VM.objectModel.getObjectFromStartAddress(start.plus(DATA_START_OFFSET));
-
- while (VM.objectModel.refToAddress(current).LT(currentLimit) && !current.isNull()) {
- ObjectReference next = VM.objectModel.getNextObject(current);
-
- ObjectReference copyTo = MarkCompactSpace.getForwardingPointer(current);
-
- if (!copyTo.isNull() && Space.isInSpace(MC.MARK_COMPACT, copyTo)) {
- if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!MarkCompactSpace.isMarked(current));
- // To be copied.
- if (copyTo.toAddress().GT(allocEnd) || copyTo.toAddress().LT(allocStart)) {
- // changed regions.
-
- VM.memory.zero(allocCursor, allocEnd.diff(allocCursor).toWord().toExtent().plus(BYTES_IN_ADDRESS));
-
- allocStart.store(allocCursor, DATA_END_OFFSET);
- allocStart = allocStart.plus(NEXT_REGION_OFFSET).loadAddress();
- allocEnd = allocStart.plus(REGION_LIMIT_OFFSET).loadAddress();
- allocCursor = allocStart.plus(DATA_START_OFFSET);
-
- newPages += Conversions.bytesToPages(allocEnd.diff(allocStart).plus(BYTES_IN_ADDRESS));
-
- if (VM.VERIFY_ASSERTIONS) {
- VM.assertions._assert(allocCursor.LT(allocEnd) && allocCursor.GE(allocStart));
- }
- }
- allocCursor = VM.objectModel.copyTo(current, copyTo, allocCursor);
- MarkCompactSpace.setForwardingPointer(copyTo, ObjectReference.nullReference());
- }
- current = next;
- }
- if (dataEnd.isZero()) {
- break;
- }
- start = nextRegion;
- }
- Extent zeroBytes = allocEnd.diff(allocCursor).toWord().toExtent().plus(BYTES_IN_ADDRESS);
- VM.memory.zero(allocCursor, zeroBytes);
-
- allocStart.store(Address.zero(), DATA_END_OFFSET);
- region = allocStart;
- cursor = allocCursor;
- updateLimit(allocEnd, region, 0);
- if (oldPages > newPages) {
- ((MarkCompactSpace) space).unusePages((oldPages - newPages));
- }
-
- // Zero during GC to help debugging.
- allocStart = allocStart.loadAddress(NEXT_REGION_OFFSET);
- while (!allocStart.isZero()) {
- allocStart.store(Address.zero(), DATA_END_OFFSET);
- if (VM.VERIFY_ASSERTIONS) {
- Address low = allocStart.plus(DATA_START_OFFSET);
- Extent size = allocStart.loadAddress(REGION_LIMIT_OFFSET).diff(allocStart).toWord().toExtent().minus(2 * BYTES_IN_ADDRESS);
- VM.memory.zero(low, size);
- }
- allocStart = allocStart.loadAddress(NEXT_REGION_OFFSET);
- }
+ private MarkCompactSpace mcSpace() {
+ return (MarkCompactSpace)space;
}
/**
- * Perform a linear scan through the objects allocated by this bump pointer,
- * calculating where each live object will be post collection.
+ * Prepare for collection: update the metadata for the current region, and flush
+ * this bump-pointer's allocations to the global page list.
*/
- public void calculateForwardingPointers() {
- /* Has this allocator ever allocated anything? */
- if (initialRegion.isZero()) return;
-
- /* Loop through active regions or until the last region */
- Address start = initialRegion;
- Address allocStart = initialRegion;
- Address allocDataEnd = initialRegion.plus(DATA_END_OFFSET).loadAddress();
- Address allocLimit = (allocDataEnd.isZero() ? cursor : allocDataEnd);
- Address allocCursor = start.plus(DATA_START_OFFSET);
-
- while (!start.isZero()) {
- /* Get the end of this region */
- Address dataEnd = start.plus(DATA_END_OFFSET).loadAddress();
-
- /* dataEnd = zero represents the current region. */
- Address currentLimit = (dataEnd.isZero() ? cursor : dataEnd);
- ObjectReference current =
- VM.objectModel.getObjectFromStartAddress(start.plus(DATA_START_OFFSET));
-
- while (VM.objectModel.refToAddress(current).LT(currentLimit) && !current.isNull()) {
- ObjectReference next = VM.objectModel.getNextObject(current);
-
- if (MarkCompactSpace.toBeCompacted(current)) {
- if (VM.VERIFY_ASSERTIONS)
- VM.assertions._assert(MarkCompactSpace.getForwardingPointer(current).isNull());
-
- // Fake - allocate it.
- int size = VM.objectModel.getSizeWhenCopied(current);
- int align = VM.objectModel.getAlignWhenCopied(current);
- int offset = VM.objectModel.getAlignOffsetWhenCopied(current);
- allocCursor = Allocator.alignAllocationNoFill(allocCursor, align, offset);
-
- boolean sameRegion = allocStart.EQ(start);
-
- if (!sameRegion && allocCursor.plus(size).GT(allocLimit)) {
- allocStart = allocStart.plus(NEXT_REGION_OFFSET).loadAddress();
- allocDataEnd = allocStart.plus(DATA_END_OFFSET).loadAddress();
- allocLimit = (allocDataEnd.isZero() ? cursor : allocDataEnd);
- allocCursor = Allocator.alignAllocationNoFill(allocStart.plus(DATA_START_OFFSET), align, offset);
- }
-
- ObjectReference target = VM.objectModel.getReferenceWhenCopiedTo(current, allocCursor);
- if (sameRegion && target.toAddress().GE(current.toAddress())) {
- MarkCompactSpace.setForwardingPointer(current, current);
- allocCursor = VM.objectModel.getObjectEndAddress(current);
- } else {
- MarkCompactSpace.setForwardingPointer(current, target);
- allocCursor = allocCursor.plus(size);
- }
- }
- current = next;
- }
- if (dataEnd.isZero()) {
- break;
- }
- start = start.plus(NEXT_REGION_OFFSET).loadAddress(); // Move on to next
+ public void prepare() {
+ if (!initialRegion.isZero()) {
+ setDataEnd(region,cursor);
+ mcSpace().append(initialRegion);
}
+ reset();
}
/**
- * Some pages are about to be re-used to satisfy a slow path request.
- * @param pages The number of pages.
+ * Flush this thread-local component in preparation for the mutator thread
+ * to die.
*/
- protected void reusePages(int pages) {
- ((MarkCompactSpace)space).reusePages(pages);
+ public void flush() {
+ prepare();
}
/**
@@ -206,5 +65,7 @@
* load balancing or increments based on region size.
* @return the maximum region size
*/
+ @Override
protected Extent maximumRegionSize() { return Extent.fromIntZeroExtend(4 << LOG_BLOCK_SIZE) ; }
+
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/policy/MarkCompactSpace.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/policy/MarkCompactSpace.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/policy/MarkCompactSpace.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/policy/MarkCompactSpace.java Sat Aug 14 07:25:41 2010
@@ -14,9 +14,12 @@
import org.mmtk.plan.TraceLocal;
import org.mmtk.plan.TransitiveClosure;
+import org.mmtk.utility.alloc.BumpPointer;
import org.mmtk.utility.heap.*;
import org.mmtk.utility.Constants;
+import org.mmtk.utility.Log;
+import org.mmtk.vm.Lock;
import org.mmtk.vm.VM;
import org.vmmagic.unboxed.*;
@@ -40,6 +43,14 @@
private static final Word GC_MARK_BIT_MASK = Word.one();
private static final Offset FORWARDING_POINTER_OFFSET = VM.objectModel.GC_HEADER_OFFSET();
+ private static final Lock lock = VM.newLock("mcSpace");
+
+ /** The list of occupied regions */
+ private Address regionList = Address.zero();
+
+ // TODO - maintain a separate list of partially allocated regions
+ // for threads to allocate into immediately after a collection.
+
/****************************************************************************
*
* Instance variables
@@ -63,9 +74,9 @@
public MarkCompactSpace(String name, int pageBudget, VMRequest vmRequest) {
super(name, true, false, vmRequest);
if (vmRequest.isDiscontiguous()) {
- pr = new MonotonePageResource(pageBudget, this, 0);
+ pr = new FreeListPageResource(pageBudget, this, 0);
} else {
- pr = new MonotonePageResource(pageBudget, this, start, extent, 0);
+ pr = new FreeListPageResource(pageBudget, this, start, extent, 0);
}
}
@@ -73,7 +84,6 @@
* Prepare for a collection
*/
public void prepare() {
- // nothing to do
}
/**
@@ -85,33 +95,15 @@
/**
- * Notify that several pages are no longer in use.
- *
- * @param pages The number of pages
- */
- public void unusePages(int pages) {
- ((MonotonePageResource) pr).unusePages(pages);
- }
-
- /**
- * Notify that several pages are no longer in use.
- *
- * @param pages The number of pages
- */
- public void reusePages(int pages) {
- ((MonotonePageResource) pr).reusePages(pages);
- }
-
- /**
* Release an allocated page or pages. In this case we do nothing
* because we only release pages enmasse.
*
* @param start The address of the start of the page or pages
*/
+ @Override
@Inline
public void release(Address start) {
- if (VM.VERIFY_ASSERTIONS)
- VM.assertions._assert(false); // this policy only releases pages enmasse
+ ((FreeListPageResource)pr).releasePages(start);
}
/**
@@ -124,6 +116,7 @@
* @param object The object to be forwarded.
* @return The forwarded object.
*/
+ @Override
@Inline
public ObjectReference traceObject(TransitiveClosure trace, ObjectReference object) {
if (VM.VERIFY_ASSERTIONS)
@@ -143,11 +136,20 @@
*/
@Inline
public ObjectReference traceMarkObject(TraceLocal trace, ObjectReference object) {
+ if (MarkCompactCollector.VERY_VERBOSE) {
+ Log.write("marking "); Log.write(object);
+ }
if (testAndMark(object)) {
trace.processNode(object);
} else if (!getForwardingPointer(object).isNull()) {
+ if (MarkCompactCollector.VERY_VERBOSE) {
+ Log.write(" -> "); Log.writeln(getForwardingPointer(object));
+ }
return getForwardingPointer(object);
}
+ if (MarkCompactCollector.VERY_VERBOSE) {
+ Log.writeln();
+ }
return object;
}
@@ -167,6 +169,10 @@
trace.processNode(object);
}
ObjectReference newObject = getForwardingPointer(object);
+ if (MarkCompactCollector.VERY_VERBOSE) {
+ Log.write("forwarding "); Log.write(object);
+ Log.write(" -> "); Log.writeln(newObject);
+ }
if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!newObject.isNull());
return getForwardingPointer(object);
}
@@ -177,6 +183,7 @@
* @param object The object
* @return True if the object is live
*/
+ @Override
public boolean isLive(ObjectReference object) {
return isMarked(object);
}
@@ -188,6 +195,7 @@
* @param object The object reference.
* @return True if the object is reachable.
*/
+ @Override
public boolean isReachable(ObjectReference object) {
return isMarked(object);
}
@@ -332,4 +340,49 @@
public static void clearForwardingPointer(ObjectReference object) {
object.toAddress().store(Address.zero(), FORWARDING_POINTER_OFFSET);
}
+
+ /**
+ * @return A region of this space that has net yet been compacted during
+ * the current collection
+ */
+ public Address getNextRegion() {
+ lock.acquire();
+ if (regionList.isZero()) {
+ lock.release();
+ return Address.zero();
+ }
+ Address result = regionList;
+ regionList = BumpPointer.getNextRegion(regionList);
+ BumpPointer.clearNextRegion(result);
+ lock.release();
+ return result;
+ }
+
+ /**
+ * Append a region or list of regions to the global list
+ * @param region
+ */
+ public void append(Address region) {
+ lock.acquire();
+ if (MarkCompactCollector.VERBOSE) {
+ Log.write("Appending region "); Log.write(region);
+ Log.writeln(" to global list");
+ }
+ if (regionList.isZero()) {
+ regionList = region;
+ } else {
+ appendRegion(regionList,region);
+ }
+ lock.release();
+ }
+
+ public static void appendRegion(Address listHead, Address region) {
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!listHead.isZero());
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!region.isZero());
+ Address cursor = listHead;
+ while (!BumpPointer.getNextRegion(cursor).isZero()) {
+ cursor = BumpPointer.getNextRegion(cursor);
+ }
+ BumpPointer.setNextRegion(cursor,region);
+ }
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/policy/MarkSweepSpace.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/policy/MarkSweepSpace.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/policy/MarkSweepSpace.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/policy/MarkSweepSpace.java Sat Aug 14 07:25:41 2010
@@ -12,13 +12,13 @@
*/
package org.mmtk.policy;
-import org.mmtk.plan.Plan;
import org.mmtk.plan.TransitiveClosure;
import org.mmtk.utility.heap.*;
import org.mmtk.utility.options.Options;
import org.mmtk.utility.options.MarkSweepMarkBits;
import org.mmtk.utility.options.EagerCompleteSweep;
import org.mmtk.utility.Constants;
+import org.mmtk.utility.HeaderByte;
import org.mmtk.vm.VM;
@@ -48,21 +48,20 @@
*/
public static final boolean HEADER_MARK_BITS = VM.config.HEADER_MARK_BITS;
/** highest bit bits we may use */
- private static final int MAX_BITS = 4;
+ private static final int AVAILABLE_LOCAL_BITS = 8 - HeaderByte.USED_GLOBAL_BITS;
/* mark bits */
private static final int COUNT_BASE = 0;
- public static final int DEFAULT_MARKCOUNT_BITS = 2;
- public static final int MAX_MARKCOUNT_BITS = Plan.NEEDS_LOG_BIT_IN_HEADER ? MAX_BITS - 1 : MAX_BITS;
- public static final Word UNLOGGED_BIT = Word.one().lsh(MAX_BITS - 1).lsh(COUNT_BASE);
- private static final Word MARK_COUNT_INCREMENT = Word.one().lsh(COUNT_BASE);
- private static final Word MARK_COUNT_MASK = Word.one().lsh(MAX_MARKCOUNT_BITS).minus(Word.one()).lsh(COUNT_BASE);
- private static final Word MARK_BITS_MASK = Word.one().lsh(MAX_BITS).minus(Word.one());
- private static final boolean EAGER_MARK_CLEAR = Plan.NEEDS_LOG_BIT_IN_HEADER;
+ public static final int DEFAULT_MARKCOUNT_BITS = 4;
+ public static final int MAX_MARKCOUNT_BITS = AVAILABLE_LOCAL_BITS - COUNT_BASE;
+ private static final byte MARK_COUNT_INCREMENT = (byte) (1<<COUNT_BASE);
+ private static final byte MARK_COUNT_MASK = (byte) (((1<<MAX_MARKCOUNT_BITS)-1) << COUNT_BASE);
+
+ private static final boolean EAGER_MARK_CLEAR = HeaderByte.NEEDS_UNLOGGED_BIT;
/* header requirements */
- public static final int LOCAL_GC_BITS_REQUIRED = MAX_BITS;
+ public static final int LOCAL_GC_BITS_REQUIRED = MAX_MARKCOUNT_BITS;
public static final int GLOBAL_GC_BITS_REQUIRED = 0;
public static final int GC_HEADER_WORDS_REQUIRED = 0;
@@ -71,8 +70,8 @@
*
* Instance variables
*/
- private Word markState = Word.one();
- private Word allocState = Word.zero();
+ private byte markState = 1;
+ private byte allocState = 0;
private boolean inMSCollection;
private static final boolean usingStickyMarkBits = VM.activePlan.constraints().needsLogBitInHeader(); /* are sticky mark bits in use? */
private boolean isAgeSegregated = false; /* is this space a nursery space? */
@@ -99,17 +98,17 @@
*/
public MarkSweepSpace(String name, int pageBudget, VMRequest vmRequest) {
super(name, pageBudget, 0, vmRequest);
- if (usingStickyMarkBits) allocState = allocState.or(UNLOGGED_BIT);
+ if (usingStickyMarkBits) allocState |= HeaderByte.UNLOGGED_BIT;
}
/**
* This instance will be age-segregated using the sticky mark bits
* algorithm. Perform appropriate initialization
*/
- public void isAgeSegregatedSpace() {
+ public void makeAgeSegregatedSpace() {
/* we must be using sticky mark bits */
if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(usingStickyMarkBits);
- allocState = allocState.and(UNLOGGED_BIT.not()); /* clear the unlogged bit for nursery allocs */
+ allocState &= ~HeaderByte.UNLOGGED_BIT; /* clear the unlogged bit for nursery allocs */
isAgeSegregated = true;
}
@@ -193,13 +192,13 @@
if (gcWholeMS) {
allocState = markState;
if (usingStickyMarkBits && !isAgeSegregated) /* if true, we allocate as "mature", not nursery */
- allocState = allocState.or(UNLOGGED_BIT);
+ allocState |= HeaderByte.UNLOGGED_BIT;
markState = deltaMarkState(true);
if (EAGER_MARK_CLEAR)
clearAllBlockMarks();
}
} else {
- zeroLiveBits(start, ((FreeListPageResource) pr).getHighWater());
+ zeroLiveBits();
}
inMSCollection = true;
}
@@ -235,7 +234,7 @@
if (!HEADER_MARK_BITS) {
return super.isCellLive(object);
}
- return testMarkState(object, markState);
+ return testMarkState(object);
}
/****************************************************************************
@@ -259,8 +258,7 @@
@Inline
public ObjectReference traceObject(TransitiveClosure trace, ObjectReference object) {
if (HEADER_MARK_BITS) {
- Word markValue = Plan.NEEDS_LOG_BIT_IN_HEADER ? markState.or(Plan.UNLOGGED_BIT) : markState;
- if (testAndMark(object, markValue)) {
+ if (testAndMark(object)) {
markBlock(object);
trace.processNode(object);
}
@@ -280,30 +278,19 @@
@Inline
public boolean isLive(ObjectReference object) {
if (HEADER_MARK_BITS) {
- return testMarkState(object, markState);
+ return testMarkState(object);
} else {
return liveBitSet(object);
}
}
/**
- * Get the current mark state
- *
- * @return The current mark state.
- */
- @Inline
- public Word getMarkState() {
- if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(markState.and(MARK_COUNT_MASK.not()).isZero());
- return markState;
- }
-
- /**
* Get the previous mark state.
*
* @return The previous mark state.
*/
@Inline
- public Word getPreviousMarkState() {
+ public byte getPreviousMarkState() {
return deltaMarkState(false);
}
@@ -313,11 +300,11 @@
* @param increment If true, then return the incremented value else return the decremented value
* @return the mark state incremented or decremented by one.
*/
- private Word deltaMarkState(boolean increment) {
- Word mask = Word.fromIntZeroExtend((1 << Options.markSweepMarkBits.getValue()) - 1).lsh(COUNT_BASE);
- Word rtn = increment ? markState.plus(MARK_COUNT_INCREMENT) : markState.minus(MARK_COUNT_INCREMENT);
- rtn = rtn.and(mask);
- if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(markState.and(MARK_COUNT_MASK.not()).isZero());
+ private byte deltaMarkState(boolean increment) {
+ byte mask = (byte) (((1 << Options.markSweepMarkBits.getValue()) - 1)<<COUNT_BASE);
+ byte rtn = (byte) (increment ? markState + MARK_COUNT_INCREMENT : markState - MARK_COUNT_INCREMENT);
+ rtn &= mask;
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert((markState & ~MARK_COUNT_MASK) == 0);
return rtn;
}
@@ -362,12 +349,12 @@
@Inline
public void initializeHeader(ObjectReference object, boolean alloc) {
if (HEADER_MARK_BITS) {
- if (alloc) {
- writeAllocState(object);
- } else {
- writeMarkState(object);
- }
- }
+ byte oldValue = VM.objectModel.readAvailableByte(object);
+ byte newValue = (byte) ((oldValue & ~MARK_COUNT_MASK) | (alloc ? allocState : markState));
+ if (HeaderByte.NEEDS_UNLOGGED_BIT) newValue |= HeaderByte.UNLOGGED_BIT;
+ VM.objectModel.writeAvailableByte(object, newValue);
+ } else if (HeaderByte.NEEDS_UNLOGGED_BIT)
+ HeaderByte.markAsUnlogged(object);
}
/**
@@ -378,12 +365,12 @@
* @param value The value to which the mark bits will be set
*/
@Inline
- private static boolean testAndMark(ObjectReference object, Word value) {
- int oldValue, markBits;
+ private boolean testAndMark(ObjectReference object) {
+ byte oldValue, markBits;
oldValue = VM.objectModel.readAvailableByte(object);
- markBits = oldValue & MARK_BITS_MASK.toInt();
- if (markBits == value.toInt()) return false;
- VM.objectModel.writeAvailableByte(object, (byte)(oldValue & ~MARK_BITS_MASK.toInt() | value.toInt()));
+ markBits = (byte) (oldValue & MARK_COUNT_MASK);
+ if (markBits == markState) return false;
+ VM.objectModel.writeAvailableByte(object, (byte)((oldValue & ~MARK_COUNT_MASK) | markState));
return true;
}
@@ -395,34 +382,8 @@
* @return True if the mark bit for the object has the given value.
*/
@Inline
- public static boolean testMarkState(ObjectReference object, Word value) {
- if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(value.and(MARK_COUNT_MASK.not()).isZero());
- return VM.objectModel.readAvailableBitsWord(object).and(MARK_COUNT_MASK).EQ(value);
- }
-
- /**
- * Write the allocState into the mark state fields of an object non-atomically.
- * This is appropriate for allocation time initialization.
- *
- * @param object The object whose mark state is to be written
- */
- @Inline
- private void writeAllocState(ObjectReference object) {
- Word oldValue = VM.objectModel.readAvailableBitsWord(object);
- Word newValue = oldValue.and(MARK_BITS_MASK.not()).or(allocState);
- VM.objectModel.writeAvailableBitsWord(object, newValue);
- }
-
- /**
- * Write the markState into the mark state fields of an object non-atomically.
- * This is appropriate for collection time initialization.
- *
- * @param object The object whose mark state is to be written
- */
- @Inline
- private void writeMarkState(ObjectReference object) {
- Word oldValue = VM.objectModel.readAvailableBitsWord(object);
- Word newValue = oldValue.and(MARK_BITS_MASK.not()).or(markState);
- VM.objectModel.writeAvailableBitsWord(object, newValue);
+ private boolean testMarkState(ObjectReference object) {
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert((markState & ~MARK_COUNT_MASK) == 0);
+ return (VM.objectModel.readAvailableByte(object) & MARK_COUNT_MASK) == markState;
}
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/policy/SegregatedFreeListSpace.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/policy/SegregatedFreeListSpace.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/policy/SegregatedFreeListSpace.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/policy/SegregatedFreeListSpace.java Sat Aug 14 07:25:41 2010
@@ -15,6 +15,7 @@
import org.mmtk.utility.alloc.BlockAllocator;
import org.mmtk.utility.alloc.EmbeddedMetaData;
import org.mmtk.utility.heap.FreeListPageResource;
+import org.mmtk.utility.heap.Map;
import org.mmtk.utility.heap.VMRequest;
import org.mmtk.utility.Constants;
import org.mmtk.utility.Conversions;
@@ -536,7 +537,13 @@
*/
protected final void consumeBlocks() {
for (int sizeClass = 0; sizeClass < sizeClassCount(); sizeClass++) {
- while (!getAllocationBlock(sizeClass, null).isZero());
+ while (!availableBlockHead.get(sizeClass).isZero()) {
+ Address block = availableBlockHead.get(sizeClass);
+ availableBlockHead.set(sizeClass, BlockAllocator.getNext(block));
+ advanceToBlock(block, sizeClass);
+ BlockAllocator.setNext(block, consumedBlockHead.get(sizeClass));
+ consumedBlockHead.set(sizeClass, block);
+ }
}
}
@@ -936,15 +943,21 @@
}
}
- /**
- * Clear all live bits
- */
- protected static void zeroLiveBits(Address start, Address end) {
+ protected void zeroLiveBits() {
Extent bytes = Extent.fromIntSignExtend(EmbeddedMetaData.BYTES_IN_REGION>>LOG_LIVE_COVERAGE);
- while (start.LT(end)) {
- Address metadata = EmbeddedMetaData.getMetaDataBase(start).plus(META_DATA_OFFSET);
- VM.memory.zero(metadata, bytes);
- start = start.plus(EmbeddedMetaData.BYTES_IN_REGION);
+ if (contiguous) {
+ Address end = ((FreeListPageResource)pr).getHighWater();
+ Address cursor = start;
+ while (cursor.LT(end)) {
+ Address metadata = EmbeddedMetaData.getMetaDataBase(cursor).plus(META_DATA_OFFSET);
+ VM.memory.zero(metadata, bytes);
+ cursor = cursor.plus(EmbeddedMetaData.BYTES_IN_REGION);
+ }
+ } else {
+ for(Address cursor = headDiscontiguousRegion; !cursor.isZero(); cursor = Map.getNextContiguousRegion(cursor)) {
+ Address metadata = EmbeddedMetaData.getMetaDataBase(cursor).plus(META_DATA_OFFSET);
+ VM.memory.zero(metadata, bytes);
+ }
}
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/policy/Space.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/policy/Space.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/policy/Space.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/policy/Space.java Sat Aug 14 07:25:41 2010
@@ -98,7 +98,7 @@
protected PageResource pr;
protected final Address start;
protected final Extent extent;
- protected Address lastDiscontiguousRegion;
+ protected Address headDiscontiguousRegion;
private boolean allocationFailed;
@@ -133,7 +133,7 @@
this.descriptor = SpaceDescriptor.createDescriptor();
this.start = Address.zero();
this.extent = Extent.zero();
- this.lastDiscontiguousRegion = Address.zero();
+ this.headDiscontiguousRegion = Address.zero();
VM.memory.setHeapRange(index, HEAP_START, HEAP_END); // this should really be refined! Once we have a code space, we can be a lot more specific about what is a valid code heap area
return;
}
@@ -219,7 +219,7 @@
public final boolean isImmortal() { return immortal; }
/** Movable getter @return True if objects in this space may move */
- public final boolean isMovable() { return movable; }
+ public boolean isMovable() { return movable; }
/** Allocationfailed getter @return true if an allocation has failed since GC */
public final boolean allocationFailed() { return allocationFailed; }
@@ -354,6 +354,18 @@
return Map.getSpaceForAddress(VM.objectModel.refToAddress(object));
}
+ /**
+ * Return the space for a given address, not necessarily the
+ * start address of an object.
+ *
+ * @param addr The address in question
+ * @return The space containing the address
+ */
+ public static Space getSpaceForAddress(Address addr) {
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!addr.isZero());
+ return Map.getSpaceForAddress(addr);
+ }
+
/****************************************************************************
*
* Page management
@@ -420,8 +432,7 @@
* @return The address of the new discontiguous space.
*/
public Address growDiscontiguousSpace(int chunks) {
- this.lastDiscontiguousRegion = Map.allocateContiguousChunks(descriptor, this, chunks, lastDiscontiguousRegion);
- return lastDiscontiguousRegion;
+ return headDiscontiguousRegion = Map.allocateContiguousChunks(descriptor, this, chunks, headDiscontiguousRegion);
}
/**
@@ -455,8 +466,8 @@
*/
public int releaseDiscontiguousChunks(Address chunk) {
if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(chunk.EQ(chunkAlign(chunk, true)));
- if (chunk.EQ(lastDiscontiguousRegion)) {
- lastDiscontiguousRegion = Map.getNextContiguousRegion(chunk);
+ if (chunk.EQ(headDiscontiguousRegion)) {
+ headDiscontiguousRegion = Map.getNextContiguousRegion(chunk);
}
return Map.freeContiguousChunks(chunk);
}
@@ -534,7 +545,7 @@
Log.writeln();
} else {
Log.write("D [");
- for(Address a = space.lastDiscontiguousRegion; !a.isZero(); a = Map.getNextContiguousRegion(a)) {
+ for(Address a = space.headDiscontiguousRegion; !a.isZero(); a = Map.getNextContiguousRegion(a)) {
Log.write(a); Log.write("->");
Log.write(a.plus(Map.getContiguousRegionSize(a).minus(1)));
if (Map.getNextContiguousRegion(a) != Address.zero())
@@ -573,6 +584,17 @@
*/
@Interruptible
public static void eagerlyMmapMMTkSpaces() {
+ eagerlyMmapMMTkContiguousSpaces();
+ eagerlyMmapMMTkDiscontiguousSpaces();
+ }
+
+
+ /**
+ * Ensure that all contiguous MMTk spaces are mapped. Demand zero map
+ * all of them if they are not already mapped.
+ */
+ @Interruptible
+ public static void eagerlyMmapMMTkContiguousSpaces() {
for (int i = 0; i < spaceCount; i++) {
Space space = spaces[i];
if (space != VM.memory.getVMSpace()) {
@@ -590,6 +612,22 @@
}
/**
+ * Ensure that all discontiguous MMTk spaces are mapped. Demand zero map
+ * all of them if they are not already mapped.
+ */
+ @Interruptible
+ public static void eagerlyMmapMMTkDiscontiguousSpaces() {
+ Address regionStart = Space.getDiscontigStart();
+ Address regionEnd = Space.getDiscontigEnd();
+ int pages = regionEnd.diff(regionStart).toInt()>>LOG_BYTES_IN_PAGE;
+ Log.write("Mapping discontiguous spaces ");
+ Log.write(regionStart);
+ Log.write("->");
+ Log.writeln(regionEnd.minus(1));
+ Mmapper.ensureMapped(getDiscontigStart(), pages);
+ }
+
+ /**
* Print out the memory used by all spaces in either megabytes or
* pages.
*
@@ -670,6 +708,7 @@
* @param addr The address to be aligned
* @param down If true the address will be rounded down, otherwise
* it will rounded up.
+ * @return The chunk-aligned address
*/
public static Address chunkAlign(Address addr, boolean down) {
if (!down) addr = addr.plus(BYTES_IN_CHUNK - 1);
@@ -680,8 +719,9 @@
* Align an extent to a space chunk
*
* @param bytes The extent to be aligned
- * @param down If true the address will be rounded down, otherwise
+ * @param down If true the extent will be rounded down, otherwise
* it will rounded up.
+ * @return The chunk-aligned extent
*/
public static Extent chunkAlign(Extent bytes, boolean down) {
if (!down) bytes = bytes.plus(BYTES_IN_CHUNK - 1);
@@ -692,10 +732,10 @@
* Convert a fraction into a number of bytes according to the
* fraction of available bytes.
*
- * @param frac The fraction of avialable virtual memory desired
+ * @param frac The fraction of available virtual memory desired
* @return The corresponding number of bytes, chunk-aligned.
*/
- private static Extent getFracAvailable(float frac) {
+ public static Extent getFracAvailable(float frac) {
long bytes = (long) (frac * AVAILABLE_BYTES.toLong());
Word mb = Word.fromIntSignExtend((int) (bytes >> LOG_BYTES_IN_MBYTE));
Extent rtn = mb.lsh(LOG_BYTES_IN_MBYTE).toExtent();
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/policy/immix/ImmixSpace.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/policy/immix/ImmixSpace.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/policy/immix/ImmixSpace.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/policy/immix/ImmixSpace.java Sat Aug 14 07:25:41 2010
@@ -21,6 +21,8 @@
import org.mmtk.utility.options.LineReuseRatio;
import org.mmtk.utility.options.Options;
import org.mmtk.utility.Constants;
+import org.mmtk.utility.ForwardingWord;
+import org.mmtk.utility.HeaderByte;
import org.mmtk.utility.Log;
import org.mmtk.vm.Lock;
@@ -52,7 +54,7 @@
*
* Instance variables
*/
- private Word markState = ObjectHeader.MARK_BASE_VALUE;
+ private byte markState = ObjectHeader.MARK_BASE_VALUE;
byte lineMarkState = RESET_LINE_MARK_STATE;
private byte lineUnavailState = RESET_LINE_MARK_STATE;
private boolean inCollection;
@@ -136,7 +138,7 @@
if (allocBlockCursor.isZero()) allocBlockCursor = chunkMap.getHeadChunk();
allocBlockSentinel = allocBlockCursor;
if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(isRecycleAllocChunkAligned(allocBlockSentinel));
- exhaustedReusableSpace = false;
+ exhaustedReusableSpace = allocBlockCursor.isZero();
if (VM.VERIFY_ASSERTIONS && Options.verbose.getValue() >= 9) {
Log.write("gr[allocBlockCursor: "); Log.write(allocBlockCursor); Log.write(" allocBlockSentinel: "); Log.write(allocBlockSentinel); Log.writeln("]");
}
@@ -341,7 +343,7 @@
if (bytes > BYTES_IN_LINE)
ObjectHeader.markAsStraddling(object);
if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(ObjectHeader.isNewObject(object));
- if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!ObjectHeader.isForwardedOrBeingForwarded(object));
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!ForwardingWord.isForwardedOrBeingForwarded(object));
}
/**
@@ -356,8 +358,8 @@
public void postCopy(ObjectReference object, int bytes, boolean majorGC) {
ObjectHeader.writeMarkState(object, markState, bytes > BYTES_IN_LINE);
if (!MARK_LINE_AT_SCAN_TIME && majorGC) markLines(object);
- if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!ObjectHeader.isForwardedOrBeingForwarded(object));
- if (VM.VERIFY_ASSERTIONS && Plan.NEEDS_LOG_BIT_IN_HEADER) VM.assertions._assert(ObjectHeader.isUnloggedObject(object));
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!ForwardingWord.isForwardedOrBeingForwarded(object));
+ if (VM.VERIFY_ASSERTIONS && HeaderByte.NEEDS_UNLOGGED_BIT) VM.assertions._assert(HeaderByte.isUnlogged(object));
}
/****************************************************************************
@@ -452,16 +454,16 @@
*/
@Inline
private void traceObjectWithoutMoving(TransitiveClosure trace, ObjectReference object) {
- Word markValue = Plan.NEEDS_LOG_BIT_IN_HEADER ? markState.or(ObjectHeader.UNLOGGED_BIT) : markState;
- Word oldMarkState = ObjectHeader.testAndMark(object, markValue);
+ byte markValue = markState;
+ byte oldMarkState = ObjectHeader.testAndMark(object, markValue);
if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!defrag.inDefrag() || defrag.spaceExhausted() || !isDefragSource(object));
if (oldMarkState != markValue) {
if (!MARK_LINE_AT_SCAN_TIME)
markLines(object);
trace.processNode(object);
}
- if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!ObjectHeader.isForwardedOrBeingForwarded(object));
- if (VM.VERIFY_ASSERTIONS && Plan.NEEDS_LOG_BIT_IN_HEADER) VM.assertions._assert(ObjectHeader.isUnloggedObject(object));
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!ForwardingWord.isForwardedOrBeingForwarded(object));
+ if (VM.VERIFY_ASSERTIONS && HeaderByte.NEEDS_UNLOGGED_BIT) VM.assertions._assert(HeaderByte.isUnlogged(object));
}
/**
@@ -479,36 +481,38 @@
if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(nurseryCollection || (defrag.determined(true) && isDefragSource(object)));
/* now race to be the (potential) forwarder */
- Word priorForwardingWord = ObjectHeader.attemptToBeForwarder(object);
- if (ObjectHeader.isForwardedOrBeingForwarded(priorForwardingWord)) {
+ Word priorStatusWord = ForwardingWord.attemptToForward(object);
+ if (ForwardingWord.stateIsForwardedOrBeingForwarded(priorStatusWord)) {
/* We lost the race; the object is either forwarded or being forwarded by another thread. */
/* Note that the concurrent attempt to forward the object may fail, so the object may remain in-place */
- ObjectReference rtn = ObjectHeader.spinAndGetForwardedObject(object, priorForwardingWord);
+ ObjectReference rtn = ForwardingWord.spinAndGetForwardedObject(object, priorStatusWord);
if (VM.VERIFY_ASSERTIONS && rtn == object) VM.assertions._assert((nurseryCollection && ObjectHeader.testMarkState(object, markState)) || defrag.spaceExhausted() || ObjectHeader.isPinnedObject(object));
if (VM.VERIFY_ASSERTIONS && rtn != object) VM.assertions._assert(nurseryCollection || !isDefragSource(rtn));
- if (VM.VERIFY_ASSERTIONS && Plan.NEEDS_LOG_BIT_IN_HEADER) VM.assertions._assert(ObjectHeader.isUnloggedObject(rtn));
+ if (VM.VERIFY_ASSERTIONS && HeaderByte.NEEDS_UNLOGGED_BIT) VM.assertions._assert(HeaderByte.isUnlogged(rtn));
return rtn;
} else {
+ byte priorState = (byte) (priorStatusWord.toInt() & 0xFF);
/* the object is unforwarded, either because this is the first thread to reach it, or because the object can't be forwarded */
- if (ObjectHeader.testMarkState(priorForwardingWord, markState)) {
+ if (ObjectHeader.testMarkState(priorState, markState)) {
/* the object has not been forwarded, but has the correct mark state; unlock and return unmoved object */
/* Note that in a sticky mark bits collector, the mark state does not change at each GC, so correct mark state does not imply another thread got there first */
if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(nurseryCollection || defrag.spaceExhausted() || ObjectHeader.isPinnedObject(object));
- ObjectHeader.setForwardingWordAndEnsureUnlogged(object, priorForwardingWord); // return to uncontested state
- if (VM.VERIFY_ASSERTIONS && Plan.NEEDS_LOG_BIT_IN_HEADER) VM.assertions._assert(ObjectHeader.isUnloggedObject(object));
+ ObjectHeader.returnToPriorStateAndEnsureUnlogged(object, priorState); // return to uncontested state
+ if (VM.VERIFY_ASSERTIONS && Plan.NEEDS_LOG_BIT_IN_HEADER) VM.assertions._assert(HeaderByte.isUnlogged(object));
return object;
} else {
/* we are the first to reach the object; either mark in place or forward it */
ObjectReference newObject;
if (ObjectHeader.isPinnedObject(object) || defrag.spaceExhausted()) {
/* mark in place */
- ObjectHeader.setMarkStateUnlogAndUnlock(object, priorForwardingWord, markState);
+ ObjectHeader.setMarkStateUnlogAndUnlock(object, priorState, markState);
newObject = object;
- if (VM.VERIFY_ASSERTIONS && Plan.NEEDS_LOG_BIT_IN_HEADER) VM.assertions._assert(ObjectHeader.isUnloggedObject(newObject));
+ if (VM.VERIFY_ASSERTIONS && Plan.NEEDS_LOG_BIT_IN_HEADER) VM.assertions._assert(HeaderByte.isUnlogged(newObject));
} else {
/* forward */
- newObject = ObjectHeader.forwardObject(object, allocator);
- if (VM.VERIFY_ASSERTIONS && Plan.NEEDS_LOG_BIT_IN_HEADER) VM.assertions._assert(ObjectHeader.isUnloggedObject(newObject));
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!ObjectHeader.isPinnedObject(object));
+ newObject = ForwardingWord.forwardObject(object, allocator);
+ if (VM.VERIFY_ASSERTIONS && Plan.NEEDS_LOG_BIT_IN_HEADER) VM.assertions._assert(HeaderByte.isUnlogged(newObject));
}
if (VM.VERIFY_ASSERTIONS && Options.verbose.getValue() >= 9) {
Log.write("C["); Log.write(object); Log.write("/");
@@ -657,7 +661,7 @@
@Inline
public boolean isLive(ObjectReference object) {
if (defrag.inDefrag() && isDefragSource(object))
- return ObjectHeader.isForwardedOrBeingForwarded(object) || ObjectHeader.testMarkState(object, markState);
+ return ForwardingWord.isForwardedOrBeingForwarded(object) || ObjectHeader.testMarkState(object, markState);
else
return ObjectHeader.testMarkState(object, markState);
}
@@ -670,7 +674,7 @@
*/
@Inline
public boolean copyNurseryIsLive(ObjectReference object) {
- return ObjectHeader.isForwardedOrBeingForwarded(object) || ObjectHeader.testMarkState(object, markState);
+ return ForwardingWord.isForwardedOrBeingForwarded(object) || ObjectHeader.testMarkState(object, markState);
}
/**
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/policy/immix/Line.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/policy/immix/Line.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/policy/immix/Line.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/policy/immix/Line.java Sat Aug 14 07:25:41 2010
@@ -52,7 +52,7 @@
Address line = Line.align(start.plus(BYTES_IN_LINE));
while (line.LT(endLine)) {
if (VM.VERIFY_ASSERTIONS)
- VM.assertions._assert(Block.align(start) == Block.align(line));
+ VM.assertions._assert(Block.align(start).EQ(Block.align(line)));
mark(line, markValue);
line = line.plus(BYTES_IN_LINE);
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/policy/immix/ObjectHeader.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/policy/immix/ObjectHeader.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/policy/immix/ObjectHeader.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/policy/immix/ObjectHeader.java Sat Aug 14 07:25:41 2010
@@ -12,54 +12,39 @@
*/
package org.mmtk.policy.immix;
-import org.mmtk.plan.Plan;
+import org.mmtk.utility.ForwardingWord;
+import org.mmtk.utility.HeaderByte;
import org.mmtk.vm.VM;
import org.vmmagic.pragma.Inline;
import org.vmmagic.pragma.Uninterruptible;
import org.vmmagic.unboxed.ObjectReference;
-import org.vmmagic.unboxed.Word;
@Uninterruptible
public class ObjectHeader {
/** number of header bits we may use */
- static final int MAX_BITS = 8;
+ static final int AVAILABLE_LOCAL_BITS = 8 - HeaderByte.USED_GLOBAL_BITS;
/* header requirements */
- public static final int LOCAL_GC_BITS_REQUIRED = MAX_BITS;
+ public static final int LOCAL_GC_BITS_REQUIRED = AVAILABLE_LOCAL_BITS;
public static final int GLOBAL_GC_BITS_REQUIRED = 0;
public static final int GC_HEADER_WORDS_REQUIRED = 0;
- /* stolen bits */
- static final Word NEW_OBJECT_MARK = Word.fromIntZeroExtend(0); // using zero means no need for explicit initialization on allocation
- private static final Word BEING_FORWARDED = Word.fromIntZeroExtend(2); // second bit indicates an object is in the process of being forwarded
- private static final Word FORWARDED = Word.fromIntZeroExtend(3); // second bit indicates an object is in the process of being forwarded
- private static final Word FORWARDING_MASK = Word.fromIntZeroExtend(3);
-
- private static final int UNLOGGED_BIT_NUMBER = 3;
- public static final Word UNLOGGED_BIT = Word.one().lsh(UNLOGGED_BIT_NUMBER);
- public static final Word LOG_SET_MASK = UNLOGGED_BIT;
+ /* local status bits */
+ static final byte NEW_OBJECT_MARK = 0; // using zero means no need for explicit initialization on allocation
- private static final int STOLEN_LO_BITS = UNLOGGED_BIT_NUMBER + 1; // both used for forwarding, also the all zero state is used to represent new objects
- private static final int STOLEN_HI_BITS = 2;
-
- static final int MAX_MARKCOUNT_BITS = MAX_BITS-(STOLEN_LO_BITS+STOLEN_HI_BITS);
- private static final int FIRST_STOLEN_HI_BIT_NUMBER = STOLEN_LO_BITS + MAX_MARKCOUNT_BITS;
-
- public static final int PINNED_BIT_NUMBER = FIRST_STOLEN_HI_BIT_NUMBER;
- public static final Word PINNED_BIT = Word.one().lsh(PINNED_BIT_NUMBER);
+ public static final int PINNED_BIT_NUMBER = ForwardingWord.FORWARDING_BITS;
+ public static final byte PINNED_BIT = 1<<PINNED_BIT_NUMBER;
private static final int STRADDLE_BIT_NUMBER = PINNED_BIT_NUMBER + 1;
- public static final Word STRADDLE_BIT = Word.one().lsh(STRADDLE_BIT_NUMBER);
+ public static final byte STRADDLE_BIT = 1<<STRADDLE_BIT_NUMBER;
/* mark bits */
- private static final int MARK_BASE = STOLEN_LO_BITS;
- private static final Word MARK_INCREMENT = Word.one().lsh(MARK_BASE);
- public static final Word MARK_MASK = Word.one().lsh(MAX_MARKCOUNT_BITS).minus(Word.one()).lsh(MARK_BASE);
- public static final Word MARK_AND_LOG_BITS_MASK = Word.one().lsh(MAX_BITS-STOLEN_HI_BITS).minus(Word.one());
- public static final Word MARK_BITS_MASK = MARK_AND_LOG_BITS_MASK.xor(UNLOGGED_BIT);
-
- public static final Word MARK_BASE_VALUE = MARK_INCREMENT;
-
+ private static final int MARK_BASE = STRADDLE_BIT_NUMBER+1;
+ static final int MAX_MARKCOUNT_BITS = AVAILABLE_LOCAL_BITS-MARK_BASE;
+ private static final byte MARK_INCREMENT = 1<<MARK_BASE;
+ public static final byte MARK_MASK = (byte) (((1<<MAX_MARKCOUNT_BITS)-1)<<MARK_BASE);
+ private static final byte MARK_AND_FORWARDING_MASK = (byte) (MARK_MASK | ForwardingWord.FORWARDING_MASK);
+ public static final byte MARK_BASE_VALUE = MARK_INCREMENT;
/****************************************************************************
@@ -74,25 +59,28 @@
* @param object The object whose mark bit is to be written
* @param markState The value to which the mark bits will be set
*/
- static Word testAndMark(ObjectReference object, Word markState) {
- int oldValue, newValue, oldMarkState;
+ static byte testAndMark(ObjectReference object, byte markState) {
+ byte oldValue, newValue, oldMarkState;
oldValue = VM.objectModel.readAvailableByte(object);
- oldMarkState = oldValue & MARK_AND_LOG_BITS_MASK.toInt();
- if (oldMarkState != markState.toInt()) {
- newValue = (oldValue & ~MARK_AND_LOG_BITS_MASK.toInt()) | markState.toInt();
- VM.objectModel.writeAvailableByte(object, (byte) newValue);
+ oldMarkState = (byte) (oldValue & MARK_MASK);
+ if (oldMarkState != markState) {
+ newValue = (byte) ((oldValue & ~MARK_MASK) | markState);
+ if (HeaderByte.NEEDS_UNLOGGED_BIT)
+ newValue |= HeaderByte.UNLOGGED_BIT;
+ VM.objectModel.writeAvailableByte(object, newValue);
}
- return Word.fromIntZeroExtend(oldMarkState);
+ return oldMarkState;
}
- static void setMarkStateUnlogAndUnlock(ObjectReference object, Word originalForwardingWord, Word markState) {
- Word markValue = Plan.NEEDS_LOG_BIT_IN_HEADER ? markState.or(ObjectHeader.UNLOGGED_BIT) : markState;
- int oldValue = originalForwardingWord.toInt();
- int newValue = (oldValue & (MARK_AND_LOG_BITS_MASK.or(FORWARDING_MASK)).not().toInt()) | markValue.toInt();
- VM.objectModel.writeAvailableByte(object, (byte) newValue);
+ static void setMarkStateUnlogAndUnlock(ObjectReference object, byte originalHeaderByte, byte markState) {
+ byte oldValue = originalHeaderByte;
+ byte newValue = (byte) ((oldValue & ~MARK_AND_FORWARDING_MASK) | markState);
+ if (HeaderByte.NEEDS_UNLOGGED_BIT)
+ newValue |= HeaderByte.UNLOGGED_BIT;
+ VM.objectModel.writeAvailableByte(object, newValue);
if (VM.VERIFY_ASSERTIONS)
- VM.assertions._assert((oldValue & MARK_AND_LOG_BITS_MASK.toInt()) != markValue.toInt());
+ VM.assertions._assert((oldValue & MARK_MASK) != markState);
}
/**
@@ -102,68 +90,47 @@
* @param value The value against which the mark bit will be tested
* @return True if the mark bit for the object has the given value.
*/
- static boolean testMarkState(ObjectReference object, Word value) {
- if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(value.and(MARK_MASK).EQ(value));
- return testMarkState(VM.objectModel.readAvailableBitsWord(object), value);
- }
-
- static boolean testMarkState(Word forwardingWord, Word value) {
- if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(value.and(MARK_MASK).EQ(value));
- return forwardingWord.and(MARK_MASK).EQ(value);
+ static boolean testMarkState(ObjectReference object, byte value) {
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert((value & MARK_MASK) == value);
+ return (VM.objectModel.readAvailableByte(object) & MARK_MASK) == value;
+ }
+
+ static boolean testMarkState(byte forwardingWord, byte value) {
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert((value & MARK_MASK) == value);
+ return (forwardingWord & MARK_MASK) == value;
}
static boolean isNewObject(ObjectReference object) {
- Word markBits = VM.objectModel.readAvailableBitsWord(object).and(MARK_AND_LOG_BITS_MASK);
- return markBits.EQ(NEW_OBJECT_MARK);
+ return (VM.objectModel.readAvailableByte(object) & MARK_AND_FORWARDING_MASK) == NEW_OBJECT_MARK;
}
static boolean isMatureObject(ObjectReference object) {
- Word markBits = VM.objectModel.readAvailableBitsWord(object).and(MARK_AND_LOG_BITS_MASK);
- boolean unforwarded = markBits.and(FORWARDING_MASK).isZero();
- boolean newObj = markBits.EQ(NEW_OBJECT_MARK);
+ byte status = (byte) (VM.objectModel.readAvailableByte(object) & MARK_AND_FORWARDING_MASK);
+ boolean unforwarded = (status & ForwardingWord.FORWARDING_MASK) == 0;
+ boolean newObj = (status == NEW_OBJECT_MARK);
return unforwarded && !newObj;
}
@Inline
static void markAsStraddling(ObjectReference object) {
- Word old = VM.objectModel.readAvailableBitsWord(object);
- VM.objectModel.writeAvailableBitsWord(object, old.or(STRADDLE_BIT));
+ byte old = VM.objectModel.readAvailableByte(object);
+ VM.objectModel.writeAvailableByte(object, (byte) (old | STRADDLE_BIT));
}
@Inline
static boolean isStraddlingObject(ObjectReference object) {
- return isStraddleBitSet(VM.objectModel.readAvailableBitsWord(object));
- }
-
- @Inline
- private static boolean isStraddleBitSet(Word header) {
- return header.and(STRADDLE_BIT).EQ(STRADDLE_BIT);
- }
-
- @Inline
- static boolean isUnloggedObject(ObjectReference object) {
- return isUnloggedBitSet(VM.objectModel.readAvailableBitsWord(object));
- }
-
- @Inline
- static boolean isUnloggedBitSet(Word header) {
- return header.and(UNLOGGED_BIT).EQ(UNLOGGED_BIT);
+ return (VM.objectModel.readAvailableByte(object) & STRADDLE_BIT) == STRADDLE_BIT;
}
@Inline
public static void pinObject(ObjectReference object) {
- byte header = VM.objectModel.readAvailableByte(object);
- VM.objectModel.writeAvailableByte(object, (byte)(header | PINNED_BIT.toInt()));
+ byte old = VM.objectModel.readAvailableByte(object);
+ VM.objectModel.writeAvailableByte(object, (byte) (old | PINNED_BIT));
}
@Inline
static boolean isPinnedObject(ObjectReference object) {
- return isPinnedBitSet(VM.objectModel.readAvailableBitsWord(object));
- }
-
- @Inline
- private static boolean isPinnedBitSet(Word header) {
- return header.and(PINNED_BIT).EQ(PINNED_BIT);
+ return (VM.objectModel.readAvailableByte(object) & PINNED_BIT) == PINNED_BIT;
}
/**
@@ -174,69 +141,21 @@
* @param markState TODO: what am I?
* @param straddle TODO: what am I?
*/
- static void writeMarkState(ObjectReference object, Word markState, boolean straddle) {
- Word oldValue = VM.objectModel.readAvailableBitsWord(object);
- Word markValue = Plan.NEEDS_LOG_BIT_IN_HEADER ? markState.or(ObjectHeader.UNLOGGED_BIT) : markState;
- Word newValue = oldValue.and(MARK_AND_LOG_BITS_MASK.not()).or(markValue);
+ static void writeMarkState(ObjectReference object, byte markState, boolean straddle) {
+ byte oldValue = VM.objectModel.readAvailableByte(object);
+ byte markValue = markState;
+ byte newValue = (byte) (oldValue & ~MARK_AND_FORWARDING_MASK);
+ if (HeaderByte.NEEDS_UNLOGGED_BIT)
+ newValue |= HeaderByte.UNLOGGED_BIT;
+ newValue |= markValue;
if (straddle)
- newValue = newValue.or(STRADDLE_BIT);
- VM.objectModel.writeAvailableBitsWord(object, newValue);
+ newValue |= STRADDLE_BIT;
+ VM.objectModel.writeAvailableByte(object, newValue);
}
- /****************************************************************************
- *
- * Forwarding
- */
-
- /**
- * Either return the forwarding pointer if the object is already
- * forwarded (or being forwarded) or write the bit pattern that
- * indicates that the object is being forwarded
- *
- * @param object The object to be forwarded
- * @return The forwarding pointer for the object if it has already
- * been forwarded.
- */
- static Word attemptToBeForwarder(ObjectReference object) {
- Word oldValue;
- do {
- oldValue = VM.objectModel.prepareAvailableBits(object);
- if (oldValue.and(FORWARDING_MASK).EQ(FORWARDED))
- return oldValue;
- } while (!VM.objectModel.attemptAvailableBits(object, oldValue, oldValue.or(BEING_FORWARDED)));
- return oldValue;
- }
-
- static ObjectReference forwardObject(ObjectReference object, int allocator) {
- if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!isPinnedObject(object));
- ObjectReference newObject = VM.objectModel.copy(object, allocator);
- VM.objectModel.writeAvailableBitsWord(object, newObject.toAddress().toWord().or(FORWARDED));
- return newObject;
- }
-
- static void setForwardingWordAndEnsureUnlogged(ObjectReference object, Word forwardingWord) {
- if (Plan.NEEDS_LOG_BIT_IN_HEADER) forwardingWord = forwardingWord.or(UNLOGGED_BIT);
- VM.objectModel.writeAvailableBitsWord(object, forwardingWord);
- }
-
- static boolean isForwardedOrBeingForwarded(ObjectReference object) {
- return isForwardedOrBeingForwarded(VM.objectModel.readAvailableBitsWord(object));
- }
-
- static boolean isForwardedOrBeingForwarded(Word forwardingWord) {
- return !forwardingWord.and(FORWARDING_MASK).isZero();
- }
-
- static ObjectReference spinAndGetForwardedObject(ObjectReference object, Word forwardingWord) {
- /* We must wait (spin) if the object is not yet fully forwarded */
- while (forwardingWord.and(FORWARDING_MASK).EQ(BEING_FORWARDED))
- forwardingWord = VM.objectModel.readAvailableBitsWord(object);
-
- /* Now extract the object reference from the forwarding word and return it */
- if (forwardingWord.and(FORWARDING_MASK).EQ(FORWARDED))
- return forwardingWord.and(FORWARDING_MASK.not()).toAddress().toObjectReference();
- else
- return object;
+ static void returnToPriorStateAndEnsureUnlogged(ObjectReference object, byte status) {
+ if (HeaderByte.NEEDS_UNLOGGED_BIT) status |= HeaderByte.UNLOGGED_BIT;
+ VM.objectModel.writeAvailableByte(object, status);
}
/**
@@ -245,13 +164,13 @@
* @param increment If true, then return the incremented value else return the decremented value
* @return the mark state incremented or decremented by one.
*/
- static Word deltaMarkState(Word state, boolean increment) {
- Word rtn = state;
+ static byte deltaMarkState(byte state, boolean increment) {
+ byte rtn = state;
do {
- rtn = increment ? rtn.plus(MARK_INCREMENT) : rtn.minus(MARK_INCREMENT);
- rtn = rtn.and(MARK_MASK);
- } while (rtn.LT(MARK_BASE_VALUE));
- if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(rtn.NE(state));
+ rtn = (byte) (increment ? rtn + MARK_INCREMENT : rtn - MARK_INCREMENT);
+ rtn &= MARK_MASK;
+ } while (rtn < MARK_BASE_VALUE);
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(rtn != state);
return rtn;
}
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/utility/Constants.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/utility/Constants.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/utility/Constants.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/utility/Constants.java Sat Aug 14 07:25:41 2010
@@ -32,12 +32,8 @@
*
* MMTk constants
*/
- int PUTFIELD_WRITE_BARRIER = 0;
- int GETFIELD_READ_BARRIER = 0;
- int PUTSTATIC_WRITE_BARRIER = 1;
- int GETSTATIC_READ_BARRIER = 1;
- int AASTORE_WRITE_BARRIER = 2;
- int AALOAD_READ_BARRIER = 2;
+ int INSTANCE_FIELD = 0;
+ int ARRAY_ELEMENT = 1;
/****************************************************************************
@@ -76,6 +72,11 @@
*
* TODO MMTk should really become independent of these Java types
*/
+ byte LOG_BYTES_IN_CHAR= 1;
+ int BYTES_IN_CHAR = 1 << LOG_BYTES_IN_CHAR;
+ byte LOG_BITS_IN_CHAR = LOG_BITS_IN_BYTE + LOG_BYTES_IN_CHAR;
+ int BITS_IN_CHAR = 1 << LOG_BITS_IN_CHAR;
+
byte LOG_BYTES_IN_SHORT = 1;
int BYTES_IN_SHORT = 1 << LOG_BYTES_IN_SHORT;
byte LOG_BITS_IN_SHORT = LOG_BITS_IN_BYTE + LOG_BYTES_IN_SHORT;
Added: vmkit/trunk/mmtk/java/src/org/mmtk/utility/ForwardingWord.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/utility/ForwardingWord.java?rev=111072&view=auto
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/utility/ForwardingWord.java (added)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/utility/ForwardingWord.java Sat Aug 14 07:25:41 2010
@@ -0,0 +1,163 @@
+/*
+ * This file is part of the Jikes RVM project (http://jikesrvm.org).
+ *
+ * This file is licensed to You under the Eclipse Public License (EPL);
+ * You may not use this file except in compliance with the License. You
+ * may obtain a copy of the License at
+ *
+ * http://www.opensource.org/licenses/eclipse-1.0.php
+ *
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.
+ */
+package org.mmtk.utility;
+
+import org.mmtk.vm.VM;
+import org.vmmagic.pragma.Inline;
+import org.vmmagic.pragma.Uninterruptible;
+import org.vmmagic.unboxed.ObjectReference;
+import org.vmmagic.unboxed.Word;
+
+/**
+ * This class provides generic support for object forwarding, which is specific
+ * to a few policies that support copying. The broad idea is two-fold: 1) the
+ * two low-order bits of the GC byte (which are also the two low-order bits of
+ * the header word) are used to indicate whether an object has been forwarded
+ * or is being forwarded, and 2) if an object has been forwarded then the entire
+ * header word of the dead object is used to store a pointer to the forwarded
+ * pointer. This is a standard implementation of forwarding.<p>
+ *
+ * The two lowest order bits are used for object forwarding because forwarding
+ * generally must steal the unused two low order bits of the forwarding pointer.
+ */
+ at Uninterruptible
+public class ForwardingWord {
+ /*
+ * The forwarding process uses three states to deal with a GC race:
+ * 1. !FORWARDED: Unforwarded
+ * 2. BEING_FORWARDED: Being forwarded (forwarding is underway)
+ * 3. FORWARDED: Forwarded
+ */
+ /** If this bit is set, then forwarding of this object is incomplete */
+ private static final byte BEING_FORWARDED = 2; // ...10
+ /** If this bit is set, then forwarding of this object has commenced */
+ private static final byte FORWARDED = 3; // ...11
+ /** This mask is used to reveal which state this object is in with respect to forwarding */
+ public static final byte FORWARDING_MASK = 3; // ...11
+
+ public static final int FORWARDING_BITS = 2;
+
+
+ /**
+ * Either return the forwarding pointer if the object is already
+ * forwarded (or being forwarded) or write the bit pattern that
+ * indicates that the object is being forwarded
+ *
+ * @param object The object to be forwarded
+ * @return The forwarding pointer for the object if it has already
+ * been forwarded.
+ */
+ @Inline
+ public static Word attemptToForward(ObjectReference object) {
+ Word oldValue;
+ do {
+ oldValue = VM.objectModel.prepareAvailableBits(object);
+ if ((byte) (oldValue.toInt() & FORWARDING_MASK) == FORWARDED)
+ return oldValue;
+ } while (!VM.objectModel.attemptAvailableBits(object, oldValue,
+ oldValue.or(Word.fromIntZeroExtend(BEING_FORWARDED))));
+ return oldValue;
+ }
+
+ public static ObjectReference spinAndGetForwardedObject(ObjectReference object, Word statusWord) {
+ /* We must wait (spin) if the object is not yet fully forwarded */
+ while ((statusWord.toInt() & FORWARDING_MASK) == BEING_FORWARDED)
+ statusWord = VM.objectModel.readAvailableBitsWord(object);
+
+ /* Now extract the object reference from the forwarding word and return it */
+ if ((statusWord.toInt() & FORWARDING_MASK) == FORWARDED)
+ return statusWord.and(Word.fromIntZeroExtend(FORWARDING_MASK).not()).toAddress().toObjectReference();
+ else
+ return object;
+ }
+
+ public static ObjectReference forwardObject(ObjectReference object, int allocator) {
+ ObjectReference newObject = VM.objectModel.copy(object, allocator);
+ VM.objectModel.writeAvailableBitsWord(object, newObject.toAddress().toWord().or(Word.fromIntZeroExtend(FORWARDED)));
+ return newObject;
+ }
+
+ /**
+ * Non-atomic write of forwarding pointer word (assumption, thread
+ * doing the set has done attempt to forward and owns the right to
+ * copy the object)
+ *
+ * @param object The object whose forwarding pointer is to be set
+ * @param ptr The forwarding pointer to be stored in the object's
+ * forwarding word
+ */
+ @Inline
+ public static void setForwardingPointer(ObjectReference object,
+ ObjectReference ptr) {
+ VM.objectModel.writeAvailableBitsWord(object, ptr.toAddress().toWord().or(Word.fromIntZeroExtend(FORWARDED)));
+ }
+
+ /**
+ * Has an object been forwarded?
+ *
+ * @param object The object to be checked
+ * @return True if the object has been forwarded
+ */
+ @Inline
+ public static boolean isForwarded(ObjectReference object) {
+ return (VM.objectModel.readAvailableByte(object) & FORWARDING_MASK) == FORWARDED;
+ }
+
+ /**
+ * Has an object been forwarded or is it being forwarded?
+ *
+ * @param object The object to be checked
+ * @return True if the object has been forwarded
+ */
+ @Inline
+ public static boolean isForwardedOrBeingForwarded(ObjectReference object) {
+ return (VM.objectModel.readAvailableByte(object) & FORWARDING_MASK) != 0;
+ }
+
+ /**
+ * Has an object been forwarded or being forwarded?
+ *
+ * @param object The object to be checked
+ * @return True if the object has been forwarded
+ */
+ @Inline
+ public static boolean stateIsForwardedOrBeingForwarded(Word header) {
+ return (header.toInt() & FORWARDING_MASK) != 0;
+ }
+
+ /**
+ * Has an object been forwarded or being forwarded?
+ *
+ * @param object The object to be checked
+ * @return True if the object has been forwarded
+ */
+ @Inline
+ public static boolean stateIsBeingForwarded(Word header) {
+ return (header.toInt() & FORWARDING_MASK) == BEING_FORWARDED;
+ }
+
+ /**
+ * Clear the GC forwarding portion of the header for an object.
+ *
+ * @param object the object ref to the storage to be initialized
+ */
+ @Inline
+ public static void clearForwardingBits(ObjectReference object) {
+ VM.objectModel.writeAvailableByte(object, (byte) (VM.objectModel.readAvailableByte(object) & ~FORWARDING_MASK));
+ }
+
+ @Inline
+ public static ObjectReference extractForwardingPointer(Word forwardingWord) {
+ return forwardingWord.and(Word.fromIntZeroExtend(FORWARDING_MASK).not()).toAddress().toObjectReference();
+ }
+}
Added: vmkit/trunk/mmtk/java/src/org/mmtk/utility/HeaderByte.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/utility/HeaderByte.java?rev=111072&view=auto
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/utility/HeaderByte.java (added)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/utility/HeaderByte.java Sat Aug 14 07:25:41 2010
@@ -0,0 +1,89 @@
+/*
+ * This file is part of the Jikes RVM project (http://jikesrvm.org).
+ *
+ * This file is licensed to You under the Eclipse Public License (EPL);
+ * You may not use this file except in compliance with the License. You
+ * may obtain a copy of the License at
+ *
+ * http://www.opensource.org/licenses/eclipse-1.0.php
+ *
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.
+ */
+package org.mmtk.utility;
+
+import org.mmtk.vm.VM;
+import org.vmmagic.pragma.Uninterruptible;
+import org.vmmagic.unboxed.Address;
+import org.vmmagic.unboxed.ObjectReference;
+
+/**
+ * This class provides generic support for operations over the GC byte
+ * within each object's header word. Specifically this class manages
+ * global status bits which cut across policies (for example the logging bit).<p>
+ *
+ * The general pattern for use of the GC byte is that the high order bits
+ * successively reserved for global use, as necessary. Any GC policy may use
+ * those bits that are not reserved for global use.<p>
+ */
+ at Uninterruptible
+public class HeaderByte {
+ private static final int TOTAL_BITS = 8;
+
+ public static final boolean NEEDS_UNLOGGED_BIT = VM.activePlan.constraints().needsLogBitInHeader();
+ private static final int UNLOGGED_BIT_NUMBER = TOTAL_BITS - (NEEDS_UNLOGGED_BIT ? 1 : 0);
+ public static final byte UNLOGGED_BIT = (byte) (1<<UNLOGGED_BIT_NUMBER);
+ public static final int USED_GLOBAL_BITS = TOTAL_BITS - UNLOGGED_BIT_NUMBER;
+
+
+ /**
+ * Perform any required initialization of the GC portion of the header.
+ * Called for objects created at boot time.
+ *
+ * @param ref the object ref to the storage to be initialized
+ * @param typeRef the type reference for the instance being created
+ * @param size the number of bytes allocated by the GC system for
+ * this object.
+ * @param status the initial value of the status word
+ * @return The new value of the status word
+ */
+ public static byte setBuildTimeGCByte(Address object, ObjectReference typeRef, int size) {
+ byte status = 0;
+
+ if (NEEDS_UNLOGGED_BIT)
+ status |= UNLOGGED_BIT;
+ return status;
+ }
+
+
+ public static void markAsUnlogged(ObjectReference object) {
+ byte value = VM.objectModel.readAvailableByte(object);
+ VM.objectModel.writeAvailableByte(object, (byte) (value | UNLOGGED_BIT));
+ }
+
+ /**
+ * Mark an object as logged. Since duplicate logging does
+ * not raise any correctness issues, we do <i>not</i> worry
+ * about synchronization and allow threads to race to log the
+ * object, potentially including it twice (unlike reference
+ * counting where duplicates would lead to incorrect reference
+ * counts).
+ *
+ * @param object The object to be marked as logged
+ */
+ public static void markAsLogged(ObjectReference object) {
+ byte value = VM.objectModel.readAvailableByte(object);
+ VM.objectModel.writeAvailableByte(object, (byte) (value & ~UNLOGGED_BIT));
+ }
+
+ /**
+ * Return true if the specified object needs to be logged.
+ *
+ * @param object The object in question
+ * @return True if the object in question needs to be logged (remembered).
+ */
+ public static boolean isUnlogged(ObjectReference object) {
+ byte value = VM.objectModel.readAvailableByte(object);
+ return (value & UNLOGGED_BIT) == UNLOGGED_BIT;
+ }
+}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/utility/alloc/BumpPointer.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/utility/alloc/BumpPointer.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/utility/alloc/BumpPointer.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/utility/alloc/BumpPointer.java Sat Aug 14 07:25:41 2010
@@ -13,12 +13,19 @@
package org.mmtk.utility.alloc;
import org.mmtk.policy.Space;
-import org.mmtk.utility.*;
+import org.mmtk.utility.Constants;
+import org.mmtk.utility.Conversions;
+import org.mmtk.utility.Log;
import org.mmtk.utility.gcspy.drivers.LinearSpaceDriver;
import org.mmtk.vm.VM;
-
-import org.vmmagic.unboxed.*;
-import org.vmmagic.pragma.*;
+import org.vmmagic.pragma.Inline;
+import org.vmmagic.pragma.NoInline;
+import org.vmmagic.pragma.Uninterruptible;
+import org.vmmagic.unboxed.Address;
+import org.vmmagic.unboxed.Extent;
+import org.vmmagic.unboxed.ObjectReference;
+import org.vmmagic.unboxed.Offset;
+import org.vmmagic.unboxed.Word;
/**
* This class implements a bump pointer allocator that allows linearly
@@ -65,6 +72,8 @@
private static final int STEP_SIZE = 1<<(SUPPORT_CARD_SCANNING ? LOG_CARD_BYTES : LOG_DEFAULT_STEP_SIZE);
protected static final int LOG_BLOCK_SIZE = LOG_BYTES_IN_PAGE + 3;
protected static final Word BLOCK_MASK = Word.one().lsh(LOG_BLOCK_SIZE).minus(Word.one());
+ private static final int BLOCK_SIZE = (1<<LOG_BLOCK_SIZE);
+
// Offsets into header
protected static final Offset REGION_LIMIT_OFFSET = Offset.zero();
@@ -79,6 +88,10 @@
Address.zero().plus(DATA_END_OFFSET.plus(BYTES_IN_ADDRESS)),
MAX_ALIGNMENT, 0).toWord().toOffset();
+ public static final int MINIMUM_DATA_SIZE = (1 << LOG_BLOCK_SIZE) - MAX_DATA_START_OFFSET.toInt();
+
+ private static final boolean VERBOSE = false;
+
/****************************************************************************
*
* Instance variables
@@ -243,6 +256,7 @@
* @return The address of the first byte of the allocated region or
* zero on failure
*/
+ @Override
protected final Address allocSlowOnce(int bytes, int align, int offset) {
/* Check we have been bound to a space */
if (space == null) {
@@ -251,7 +265,7 @@
/* Check if we already have a block to use */
if (allowScanning && !region.isZero()) {
- Address nextRegion = region.loadAddress(NEXT_REGION_OFFSET);
+ Address nextRegion = getNextRegion(region);
if (!nextRegion.isZero()) {
return consumeNextRegion(nextRegion, bytes, align, offset);
}
@@ -295,7 +309,7 @@
}
/**
- * A bump pointer chuck/region has been consumed but the contiguous region
+ * A bump pointer chunk/region has been consumed but the contiguous region
* is available, so consume it and then return the address of the start
* of a memory region satisfying the outstanding allocation request. This
* is relevant when re-using memory, as in a mark-compact collector.
@@ -309,17 +323,145 @@
*/
private Address consumeNextRegion(Address nextRegion, int bytes, int align,
int offset) {
- region.plus(DATA_END_OFFSET).store(cursor);
+ setNextRegion(region,cursor);
region = nextRegion;
- cursor = nextRegion.plus(DATA_START_OFFSET);
- updateLimit(nextRegion.loadAddress(REGION_LIMIT_OFFSET), nextRegion, bytes);
- nextRegion.store(Address.zero(), DATA_END_OFFSET);
+ cursor = getDataStart(nextRegion);
+ updateLimit(getRegionLimit(nextRegion), nextRegion, bytes);
+ setDataEnd(nextRegion,Address.zero());
VM.memory.zero(cursor, limit.diff(cursor).toWord().toExtent());
reusePages(Conversions.bytesToPages(limit.diff(region)));
return alloc(bytes, align, offset);
}
+ /******************************************************************************
+ *
+ * Accessor methods for the region metadata fields.
+ *
+ */
+
+ /**
+ * The first offset in a region after the header
+ * @param region The region
+ * @return The lowest address at which data can be stored
+ */
+ @Inline
+ public static Address getDataStart(Address region) {
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!region.isZero());
+ return region.plus(DATA_START_OFFSET);
+ }
+
+ /**
+ * The next region in the linked-list of regions
+ * @param region The region
+ * @return The next region in the list
+ */
+ @Inline
+ public static Address getNextRegion(Address region) {
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!region.isZero());
+ Address result = region.plus(NEXT_REGION_OFFSET).loadAddress();
+ return result;
+ }
+
+ /**
+ * Set the next region in the linked-list of regions
+ * @param region The region
+ * @param the next region in the list
+ */
+ @Inline
+ public static void setNextRegion(Address region, Address nextRegion) {
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!region.isZero());
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!nextRegion.EQ(Address.fromIntZeroExtend(0xdeadbeef)));
+ region.store(nextRegion,NEXT_REGION_OFFSET);
+ }
+
+ /**
+ * Clear the next region pointer in the linked-list of regions
+ * @param region The region
+ */
+ @Inline
+ public static void clearNextRegion(Address region) {
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!region.isZero());
+ region.store(Address.zero(),NEXT_REGION_OFFSET);
+ }
+
+ /**
+ * @param region The bump-pointer region
+ * @return The DATA_END address from the region header
+ */
+ @Inline
+ public static Address getDataEnd(Address region) {
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!region.isZero());
+ return region.plus(DATA_END_OFFSET).loadAddress();
+ }
+
+ /**
+ * @param region The bump-pointer region
+ * @param endAddress The new DATA_END address from the region header
+ */
+ public static void setDataEnd(Address region, Address endAddress) {
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!region.isZero());
+ region.store(endAddress, DATA_END_OFFSET);
+ if (VERBOSE) {
+ Log.write("setDataEnd(");
+ Log.write(region);
+ Log.write(",");
+ Log.write(endAddress);
+ Log.writeln(")");
+ }
+ }
+
+ /**
+ * Return the end address of the given region.
+ * @param region The region.
+ * @return the allocation limit of the region.
+ */
+ public static Address getRegionLimit(Address region) {
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!region.isZero());
+ return region.plus(REGION_LIMIT_OFFSET).loadAddress();
+ }
+
+ /**
+ * Return the end address of the given region.
+ * @param region The region.
+ * @return the allocation limit of the region.
+ */
+ public static void setRegionLimit(Address region, Address limit) {
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!region.isZero());
+ region.plus(REGION_LIMIT_OFFSET).store(limit);
+ }
+
+ /**
+ * @param region The region.
+ * @return {@code true} if the address is region-aligned
+ */
+ public static boolean isRegionAligned(Address region) {
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(!region.isZero());
+ return region.toWord().and(BLOCK_MASK).isZero();
+ }
+
+ /**
+ * Sanity check a region header
+ * @param region Region to check
+ */
+ public static void checkRegionMetadata(Address region) {
+ if (VM.VERIFY_ASSERTIONS) {
+ Address nextRegion = getNextRegion(region);
+ Address dataStart = getDataStart(region);
+ Address dataEnd = getDataEnd(region);
+ Address regionLimit = getRegionLimit(region);
+
+ VM.assertions._assert(nextRegion.isZero() || isRegionAligned(nextRegion));
+ VM.assertions._assert(dataEnd.GE(dataStart));
+ if (dataEnd.GT(regionLimit)) {
+ Log.write("dataEnd="); Log.write(dataEnd);
+ Log.write(", regionLimit="); Log.writeln(regionLimit);
+ }
+ VM.assertions._assert(dataEnd.LE(regionLimit));
+ VM.assertions._assert(regionLimit.EQ(region.plus(BLOCK_SIZE)));
+ }
+
+ }
/**
* Update the metadata to reflect the addition of a new region.
*
@@ -336,13 +478,13 @@
} else if (limit.NE(start) ||
region.diff(start.plus(size)).toWord().toExtent().GT(maximumRegionSize())) {
/* non contiguous or over-size, initialize new region */
- region.plus(NEXT_REGION_OFFSET).store(start);
- region.plus(DATA_END_OFFSET).store(cursor);
+ setNextRegion(region,start);
+ setDataEnd(region,cursor);
region = start;
cursor = start.plus(DATA_START_OFFSET);
}
updateLimit(start.plus(size), start, bytes);
- region.plus(REGION_LIMIT_OFFSET).store(limit);
+ setRegionLimit(region,limit);
}
/**
@@ -399,7 +541,7 @@
Address start = initialRegion;
while (!start.isZero()) {
scanRegion(scanner, start); // Scan this region
- start = start.plus(NEXT_REGION_OFFSET).loadAddress(); // Move on to next
+ start = getNextRegion(start); // Move on to next
}
}
@@ -416,14 +558,30 @@
/* dataEnd = zero represents the current region. */
Address currentLimit = (dataEnd.isZero() ? cursor : dataEnd);
- ObjectReference current =
- VM.objectModel.getObjectFromStartAddress(start.plus(DATA_START_OFFSET));
+ if (currentLimit.EQ(start.plus(DATA_END_OFFSET).plus(BYTES_IN_ADDRESS))) {
+ /* Empty region, so we can not call getObjectFromStartAddress() */
+ return;
+ }
- while (VM.objectModel.refToAddress(current).LT(currentLimit) && !current.isNull()) {
- ObjectReference next = VM.objectModel.getNextObject(current);
- scanner.scan(current); // Scan this object.
+ ObjectReference current = VM.objectModel.getObjectFromStartAddress(start.plus(DATA_START_OFFSET));
+
+ /* Loop through each object up to the limit */
+ do {
+ /* Read end address first, as scan may be destructive */
+ Address currentObjectEnd = VM.objectModel.getObjectEndAddress(current);
+ scanner.scan(current);
+ if (currentObjectEnd.GE(currentLimit)) {
+ /* We have scanned the last object */
+ break;
+ }
+ /* Find the next object from the start address (dealing with alignment gaps, etc.) */
+ ObjectReference next = VM.objectModel.getObjectFromStartAddress(currentObjectEnd);
+ if (VM.VERIFY_ASSERTIONS) {
+ /* Must be monotonically increasing */
+ VM.assertions._assert(next.toAddress().GT(current.toAddress()));
+ }
current = next;
- }
+ } while (true);
}
/**
@@ -444,6 +602,7 @@
/** @return the current cursor value */
public final Address getCursor() { return cursor; }
/** @return the space associated with this bump pointer */
+ @Override
public final Space getSpace() { return space; }
/**
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/utility/heap/FreeListPageResource.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/utility/heap/FreeListPageResource.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/utility/heap/FreeListPageResource.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/utility/heap/FreeListPageResource.java Sat Aug 14 07:25:41 2010
@@ -159,7 +159,7 @@
} else {
pagesCurrentlyOnFreeList -= pages;
if (pageOffset > highWaterMark) {
- if ((pageOffset ^ highWaterMark) > EmbeddedMetaData.PAGES_IN_REGION) {
+ if (highWaterMark == 0 || (pageOffset ^ highWaterMark) > EmbeddedMetaData.PAGES_IN_REGION) {
int regions = 1 + ((pageOffset - highWaterMark) >> EmbeddedMetaData.LOG_PAGES_IN_REGION);
int metapages = regions * metaDataPagesPerRegion;
reserved += metapages;
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/utility/heap/Map.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/utility/heap/Map.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/utility/heap/Map.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/utility/heap/Map.java Sat Aug 14 07:25:41 2010
@@ -39,7 +39,8 @@
* Class variables
*/
private static final int[] descriptorMap;
- private static final int[] linkageMap;
+ private static final int[] prevLink;
+ private static final int[] nextLink;
private static final Space[] spaceMap;
private static final GenericFreeList regionMap;
public static final GenericFreeList globalPageMap;
@@ -59,7 +60,8 @@
*/
static {
descriptorMap = new int[Space.MAX_CHUNKS];
- linkageMap = new int[Space.MAX_CHUNKS];
+ prevLink = new int[Space.MAX_CHUNKS];
+ nextLink = new int[Space.MAX_CHUNKS];
spaceMap = new Space[Space.MAX_CHUNKS];
regionMap = new GenericFreeList(Space.MAX_CHUNKS);
globalPageMap = new GenericFreeList(1, 1, Space.MAX_SPACES);
@@ -97,7 +99,7 @@
VM.assertions.fail("exiting");
}
descriptorMap[index] = descriptor;
- VM.barriers.setArrayNoBarrier(spaceMap, index, space);
+ VM.barriers.objectArrayStoreNoGCBarrier(spaceMap, index, space);
e = e.plus(Space.BYTES_IN_CHUNK);
}
}
@@ -108,10 +110,10 @@
* @param descriptor The descriptor for the space to which these chunks will be assigned
* @param space The space to which these chunks will be assigned
* @param chunks The number of chunks required
- * @param previous The previous contgiuous set of chunks for this space (to create a linked list of contiguous regions for each space)
+ * @param head The previous contgiuous set of chunks for this space (to create a linked list of contiguous regions for each space)
* @return The address of the assigned memory. This always succeeds. If the request fails we fail right here.
*/
- public static Address allocateContiguousChunks(int descriptor, Space space, int chunks, Address previous) {
+ public static Address allocateContiguousChunks(int descriptor, Space space, int chunks, Address head) {
lock.acquire();
int chunk = regionMap.alloc(chunks);
if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(chunk != 0);
@@ -126,7 +128,13 @@
totalAvailableDiscontiguousChunks -= chunks;
Address rtn = addressForChunkIndex(chunk);
insert(rtn, Extent.fromIntZeroExtend(chunks<<Space.LOG_BYTES_IN_CHUNK), descriptor, space);
- linkageMap[chunk] = previous.isZero() ? 0 : getChunkIndex(previous);
+ if (head.isZero()) {
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(nextLink[chunk] == 0);
+ } else {
+ nextLink[chunk] = getChunkIndex(head);
+ prevLink[getChunkIndex(head)] = chunk;
+ }
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(prevLink[chunk] == 0);
lock.release();
return rtn;
}
@@ -140,7 +148,7 @@
public static Address getNextContiguousRegion(Address start) {
if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(start.EQ(Space.chunkAlign(start, true)));
int chunk = getChunkIndex(start);
- return (chunk == 0) ? Address.zero() : (linkageMap[chunk] == 0) ? Address.zero() : addressForChunkIndex(linkageMap[chunk]);
+ return (chunk == 0) ? Address.zero() : (nextLink[chunk] == 0) ? Address.zero() : addressForChunkIndex(nextLink[chunk]);
}
/**
@@ -167,18 +175,22 @@
/**
* Free all chunks in a linked list of contiguous chunks. This means starting
- * with lastChunk and then walking the chain of contiguous regions, freeing each.
+ * with one and then walking the chains of contiguous regions, freeing each.
*
- * @param lastChunk The last chunk in the linked list of chunks to be freed
+ * @param anyChunk Any chunk in the linked list of chunks to be freed
*/
- public static void freeAllChunks(Address lastChunk) {
+ public static void freeAllChunks(Address anyChunk) {
lock.acquire();
- if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(lastChunk.EQ(Space.chunkAlign(lastChunk, true)));
- int chunk = getChunkIndex(lastChunk);
- while (chunk != 0) {
- int next = linkageMap[chunk];
+ if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(anyChunk.EQ(Space.chunkAlign(anyChunk, true)));
+ if (!anyChunk.isZero()) {
+ int chunk = getChunkIndex(anyChunk);
+ while (nextLink[chunk] != 0) {
+ freeContiguousChunks(nextLink[chunk]);
+ }
+ while (prevLink[chunk] != 0) {
+ freeContiguousChunks(prevLink[chunk]);
+ }
freeContiguousChunks(chunk);
- chunk = next;
}
lock.release();
}
@@ -206,10 +218,14 @@
private static int freeContiguousChunks(int chunk) {
int chunks = regionMap.free(chunk);
totalAvailableDiscontiguousChunks += chunks;
+ int next = nextLink[chunk];
+ int prev = prevLink[chunk];
+ if (next != 0) prevLink[next] = prev;
+ if (prev != 0) nextLink[prev] = next;
+ nextLink[chunk] = prevLink[chunk] = 0;
for (int offset = 0; offset < chunks; offset++) {
descriptorMap[chunk + offset] = 0;
- VM.barriers.setArrayNoBarrier(spaceMap, chunk + offset, null);
- linkageMap[chunk + offset] = 0;
+ VM.barriers.objectArrayStoreNoGCBarrier(spaceMap, chunk + offset, null);
}
return chunks;
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/utility/heap/Mmapper.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/utility/heap/Mmapper.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/utility/heap/Mmapper.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/utility/heap/Mmapper.java Sat Aug 14 07:25:41 2010
@@ -129,7 +129,7 @@
lock.release();
Log.write("ensureMapped failed with errno "); Log.write(errno);
Log.write(" on address "); Log.writeln(mmapStart);
- if (VM.VERIFY_ASSERTIONS) VM.assertions._assert(false);
+ VM.assertions.fail("Can't get more space with mmap()");
} else {
if (verbose) {
Log.write("mmap succeeded at chunk "); Log.write(chunk); Log.write(" "); Log.write(mmapStart);
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/utility/options/Options.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/utility/options/Options.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/utility/options/Options.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/utility/options/Options.java Sat Aug 14 07:25:41 2010
@@ -53,7 +53,7 @@
public static NoFinalizer noFinalizer;
public static NoReferenceTypes noReferenceTypes;
public static NurserySize nurserySize;
- public static PerfMetric perfMetric;
+ public static PerfEvents perfEvents;
public static PrintPhaseStats printPhaseStats;
public static ProtectOnRelease protectOnRelease;
public static SanityCheck sanityCheck;
Added: vmkit/trunk/mmtk/java/src/org/mmtk/utility/options/PerfEvents.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/utility/options/PerfEvents.java?rev=111072&view=auto
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/utility/options/PerfEvents.java (added)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/utility/options/PerfEvents.java Sat Aug 14 07:25:41 2010
@@ -0,0 +1,27 @@
+/*
+ * This file is part of the Jikes RVM project (http://jikesrvm.org).
+ *
+ * This file is licensed to You under the Eclipse Public License (EPL);
+ * You may not use this file except in compliance with the License. You
+ * may obtain a copy of the License at
+ *
+ * http://www.opensource.org/licenses/eclipse-1.0.php
+ *
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.
+ */
+package org.mmtk.utility.options;
+
+/**
+ * Performance counter options.
+ */
+public class PerfEvents extends org.vmutil.options.StringOption {
+ /**
+ * Create the option.
+ */
+ public PerfEvents() {
+ super(Options.set, "Perf Events",
+ "Use this to specify a comma seperated list of performance events to measure",
+ "");
+ }
+}
Removed: vmkit/trunk/mmtk/java/src/org/mmtk/utility/options/PerfMetric.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/utility/options/PerfMetric.java?rev=111071&view=auto
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/utility/options/PerfMetric.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/utility/options/PerfMetric.java (removed)
@@ -1,28 +0,0 @@
-/*
- * This file is part of the Jikes RVM project (http://jikesrvm.org).
- *
- * This file is licensed to You under the Eclipse Public License (EPL);
- * You may not use this file except in compliance with the License. You
- * may obtain a copy of the License at
- *
- * http://www.opensource.org/licenses/eclipse-1.0.php
- *
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.
- */
-package org.mmtk.utility.options;
-
-/**
- * Performance counter options.
- */
-public class PerfMetric extends org.vmutil.options.EnumOption {
- /**
- * Create the option.
- */
- public PerfMetric() {
- super(Options.set, "Perf Metric",
- "Use this to select a performance metric to measure",
- new String[] {"RI", "L1D_MISS", "L2_MISS", "DTLB_MISS", "ITLB_MISS", "ITLB_HIT", "BPU_TC", "TC_FLUSH", "L1I_MISS", "BRANCHES", "BRANCH_MISS"},
- "RI");
- }
-}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/utility/statistics/Counter.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/utility/statistics/Counter.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/utility/statistics/Counter.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/utility/statistics/Counter.java Sat Aug 14 07:25:41 2010
@@ -156,6 +156,12 @@
String getName() { return name; }
/**
+ * Return the (option) suffix to be used when reporting this counter
+ * @return The suffix
+ */
+ String getColumnSuffix() { return ""; }
+
+ /**
* Return true if this counter is implicitly started when
* <code>startAll()</code> is called.
* @return True if this counter is implicitly started when
Removed: vmkit/trunk/mmtk/java/src/org/mmtk/utility/statistics/PerfCounter.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/utility/statistics/PerfCounter.java?rev=111071&view=auto
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/utility/statistics/PerfCounter.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/utility/statistics/PerfCounter.java (removed)
@@ -1,78 +0,0 @@
-/*
- * This file is part of the Jikes RVM project (http://jikesrvm.org).
- *
- * This file is licensed to You under the Eclipse Public License (EPL);
- * You may not use this file except in compliance with the License. You
- * may obtain a copy of the License at
- *
- * http://www.opensource.org/licenses/eclipse-1.0.php
- *
- * See the COPYRIGHT.txt file distributed with this work for information
- * regarding copyright ownership.
- */
-package org.mmtk.utility.statistics;
-
-import org.mmtk.vm.VM;
-
-import org.vmmagic.pragma.*;
-
-/**
- * This class implements a simple performance counter, used to gather
- * data from hardware performance counters.
- */
- at Uninterruptible
-public class PerfCounter extends LongCounter {
-
- /****************************************************************************
- *
- * Initialization
- */
-
- /**
- * Constructor
- *
- * @param name The name to be associated with this counter
- */
- public PerfCounter(String name) {
- this(name, true, false);
- }
-
- /**
- * Constructor
- *
- * @param name The name to be associated with this counter
- * @param start True if this counter is to be implicitly started at
- * boot time (otherwise the counter must be explicitly started).
- */
- public PerfCounter(String name, boolean start) {
- this(name, start, false);
- }
-
- /**
- * Constructor
- *
- * @param name The name to be associated with this counter
- * @param start True if this counter is to be implicitly started at
- * boot time (otherwise the counter must be explicitly started).
- * @param gconly True if this counter only pertains to (and
- * therefore functions during) GC phases.
- */
- public PerfCounter(String name, boolean start, boolean gconly) {
- super(name, start, gconly);
- }
-
- /****************************************************************************
- *
- * Counter-specific methods
- */
-
- /**
- * Get the current value for this counter
- *
- * @return The current value for this counter
- */
- @Inline
- protected final long getCurrentValue() {
- return VM.statistics.perfCtrReadMetric();
- }
-}
Added: vmkit/trunk/mmtk/java/src/org/mmtk/utility/statistics/PerfEvent.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/utility/statistics/PerfEvent.java?rev=111072&view=auto
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/utility/statistics/PerfEvent.java (added)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/utility/statistics/PerfEvent.java Sat Aug 14 07:25:41 2010
@@ -0,0 +1,116 @@
+/*
+ * This file is part of the Jikes RVM project (http://jikesrvm.org).
+ *
+ * This file is licensed to You under the Eclipse Public License (EPL);
+ * You may not use this file except in compliance with the License. You
+ * may obtain a copy of the License at
+ *
+ * http://www.opensource.org/licenses/eclipse-1.0.php
+ *
+ * See the COPYRIGHT.txt file distributed with this work for information
+ * regarding copyright ownership.
+ */
+package org.mmtk.utility.statistics;
+
+import org.mmtk.utility.Log;
+import org.mmtk.vm.VM;
+import org.vmmagic.pragma.Uninterruptible;
+
+/**
+ * This class represents a perf event, such as cache misses, etc.
+ */
+ at Uninterruptible
+public final class PerfEvent extends LongCounter {
+ /** True if the counter did not run due to contention for a physical counter */
+ private boolean contended;
+
+ /** True if the counter did not run all of the time and has been scaled appropriately */
+ private boolean scaled;
+
+ /** True if the counter overflowed */
+ private boolean overflowed;
+
+ /** The index of the counter in the native array */
+ private int index;
+
+ /** The previously read value of the counter (used to detect overflow) */
+ private long previousValue;
+
+ /** A buffer passed to the native code when reading values, returns the tuple RAW_COUNT, TIME_ENABLED, TIME_RUNNING */
+ private final long[] readBuffer = new long[3];
+ private static final int RAW_COUNT = 0;
+ private static final int TIME_ENABLED = 1;
+ private static final int TIME_RUNNING = 2;
+
+ /** Three 64 bit values is 24 bytes */
+ private static final int BYTES_TO_READ = 24;
+
+ /** True if any data was scaled */
+ public static boolean dataWasScaled = false;
+
+ public PerfEvent(int index, String name) {
+ super(name, true, false);
+ this.index = index;
+ }
+
+ /**
+ * Counters are 64 bit unsigned in the kernel but only 63 bits are available in Java
+ */
+ @Override
+ protected long getCurrentValue() {
+ VM.statistics.perfEventRead(index, readBuffer);
+ if (readBuffer[RAW_COUNT] < 0 || readBuffer[TIME_ENABLED] < 0 || readBuffer[TIME_RUNNING] < 0) {
+ // Negative implies they have exceeded 63 bits.
+ overflowed = true;
+ }
+ if (readBuffer[TIME_ENABLED] == 0) {
+ // Counter never run (assume contention)
+ contended = true;
+ }
+ // Was the counter scaled?
+ if (readBuffer[TIME_ENABLED] != readBuffer[TIME_RUNNING]) {
+ scaled = true;
+ dataWasScaled = true;
+ double scaleFactor;
+ if (readBuffer[TIME_RUNNING] == 0) {
+ scaleFactor = 0;
+ } else {
+ scaleFactor = readBuffer[TIME_ENABLED] / readBuffer[TIME_RUNNING];
+ }
+ readBuffer[RAW_COUNT] = (long) (readBuffer[RAW_COUNT] * scaleFactor);
+ }
+ if (readBuffer[RAW_COUNT] < previousValue) {
+ // value should monotonically increase
+ overflowed = true;
+ }
+ previousValue = readBuffer[RAW_COUNT];
+ return readBuffer[RAW_COUNT];
+ }
+
+ /**
+ * Print the given value
+ * @param value The value to be printed
+ */
+ @Override
+ void printValue(long value) {
+ if (overflowed) {
+ Log.write("OVERFLOWED");
+ } else if (contended) {
+ Log.write("CONTENDED");
+ } else {
+ Log.write(value);
+ if (scaled) {
+ Log.write(" (SCALED)");
+ }
+ }
+ }
+
+ public String getColumnSuffix() {
+ return
+ overflowed ? "overflowed" :
+ contended ? "contended" :
+ scaled ? ".scaled" :
+ "";
+ }
+}
+
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/utility/statistics/Stats.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/utility/statistics/Stats.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/utility/statistics/Stats.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/utility/statistics/Stats.java Sat Aug 14 07:25:41 2010
@@ -127,6 +127,7 @@
if (counter[c].getStart())
counter[c].start();
}
+
if (Options.xmlStats.getValue()) {
Xml.begin();
Xml.openTag("mmtk-stats");
@@ -232,11 +233,14 @@
for (int c = 0; c < counters; c++) {
if (counter[c].mergePhases()) {
Log.write(counter[c].getName());
+ Log.write(counter[c].getColumnSuffix());
Log.write("\t");
} else {
Log.write(counter[c].getName());
+ Log.write(counter[c].getColumnSuffix());
Log.write(".mu\t");
Log.write(counter[c].getName());
+ Log.write(counter[c].getColumnSuffix());
Log.write(".gc\t");
}
}
@@ -310,6 +314,7 @@
@Interruptible
private static void printTotalXml(Counter c, Phase phase) {
openStatXml(c.getName());
+ Xml.attribute("suffix", c.getColumnSuffix());
Xml.openAttribute("value");
if (phase == Phase.COMBINED) {
c.printTotal();
@@ -333,6 +338,7 @@
@Interruptible
private static void printPhaseStatXml(Counter c, int p, Phase phase) {
openStatXml(c.getName());
+ Xml.attribute("suffix", c.getColumnSuffix());
Xml.openAttribute("value");
if (phase == Phase.COMBINED) {
c.printCount(p);
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/vm/Barriers.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/vm/Barriers.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/vm/Barriers.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/vm/Barriers.java Sat Aug 14 07:25:41 2010
@@ -18,132 +18,404 @@
@Uninterruptible
public abstract class Barriers {
/**
- * Sets an element of an object array without invoking any write
- * barrier. This method is called by the Map class to ensure
- * potentially-allocation-triggering write barriers do not occur in
- * allocation slow path code.
+ * Perform the actual write of a boolean write barrier.
*
- * @param dst the destination array
- * @param index the index of the element to set
- * @param value the new value for the element
+ * @param ref The object that has the boolean field
+ * @param value The value that the slot will be updated to
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
*/
- public abstract void setArrayNoBarrier(Object [] dst, int index, Object value);
+ public abstract void booleanWrite(ObjectReference ref, boolean value, Word metaDataA, Word metaDataB, int mode);
/**
- * Perform the actual write of the write barrier.
+ * Perform the actual read of a boolean read barrier.
*
- * @param ref The object that has the reference field
- * @param slot The slot that holds the reference
- * @param target The value that the slot will be updated to
- * @param metaDataA VM specific meta data
- * @param metaDataB VM specific meta data
- * @param mode The context in which the write is occuring
- */
- public abstract void performWriteInBarrier(ObjectReference ref, Address slot,
- ObjectReference target, Word metaDataA,
- Word metaDataB, int mode);
+ * @param ref The object that has the boolean field
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ * @return the read value
+ */
+ public abstract boolean booleanRead(ObjectReference ref, Word metaDataA, Word metaDataB, int mode);
/**
- * Perform the actual write of the write barrier, writing the value as a raw Word.
+ * Perform the actual write of a byte write barrier.
*
- * @param ref The object that has the reference field
- * @param slot The slot that holds the reference
- * @param rawTarget The value that the slot will be updated to
- * @param metaDataA VM specific meta data
- * @param metaDataB VM specific meta data
- * @param mode The context in which the write is occuring
- */
- public abstract void performRawWriteInBarrier(ObjectReference ref, Address slot,
- Word rawTarget, Word metaDataA,
- Word metaDataB, int mode);
+ * @param ref The object that has the byte field
+ * @param value The value that the slot will be updated to
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ */
+ public abstract void byteWrite(ObjectReference ref, byte value, Word metaDataA, Word metaDataB, int mode);
/**
- * Perform the actual read of the read barrier.
+ * Perform the actual read of a byte read barrier.
*
- * @param ref The object that has the reference field
- * @param slot The slot that holds the reference
- * @param metaDataA VM specific meta data
- * @param metaDataB VM specific meta data
- * @param mode The context in which the write is occuring
+ * @param ref The object that has the byte field
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
* @return the read value
*/
- public abstract ObjectReference performReadInBarrier(ObjectReference ref, Address slot,
- Word metaDataA, Word metaDataB, int mode);
+ public abstract byte byteRead(ObjectReference ref, Word metaDataA, Word metaDataB, int mode);
/**
- * Perform the actual read of the read barrier, returning the value as a raw Word.
+ * Perform the actual write of a char write barrier.
+ *
+ * @param ref The object that has the char field
+ * @param value The value that the slot will be updated to
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ */
+ public abstract void charWrite(ObjectReference ref, char value, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Perform the actual read of a char read barrier.
+ *
+ * @param ref The object that has the char field
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ * @return the read value
+ */
+ public abstract char charRead(ObjectReference ref, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Perform the actual write of a short write barrier.
+ *
+ * @param ref The object that has the short field
+ * @param value The value that the slot will be updated to
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ */
+ public abstract void shortWrite(ObjectReference ref, short value, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Perform the actual read of a short read barrier.
+ *
+ * @param ref The object that has the short field
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ * @return the read value
+ */
+ public abstract short shortRead(ObjectReference ref, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Perform the actual write of a int write barrier.
+ *
+ * @param ref The object that has the int field
+ * @param value The value that the slot will be updated to
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ */
+ public abstract void intWrite(ObjectReference ref, int value, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Perform the actual read of a int read barrier.
+ *
+ * @param ref The object that has the int field
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ * @return the read value
+ */
+ public abstract int intRead(ObjectReference ref, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Attempt an atomic compare and exchange in a write barrier sequence.
+ *
+ * @param objref The object that has the int field
+ * @param old The old int to be swapped out
+ * @param value the new int
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ * @return True if the compare and swap was successful
+ */
+ public abstract boolean intTryCompareAndSwap(ObjectReference objref, int old, int value, Word metaDataA, Word metaDataB, int mode);
+
+
+ /**
+ * Perform the actual write of a long write barrier.
+ *
+ * @param ref The object that has the long field
+ * @param value The value that the slot will be updated to
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ */
+ public abstract void longWrite(ObjectReference ref, long value, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Perform the actual read of a long read barrier.
+ *
+ * @param ref The object that has the long field
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ * @return the read value
+ */
+ public abstract long longRead(ObjectReference ref, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Attempt an atomic compare and exchange in a write barrier sequence.
+ *
+ * @param objref The object that has the long field
+ * @param old The old long to be swapped out
+ * @param value the new long
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ * @return True if the compare and swap was successful
+ */
+ public abstract boolean longTryCompareAndSwap(ObjectReference objref, long old, long value, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Perform the actual write of a float write barrier.
+ *
+ * @param ref The object that has the float field
+ * @param value The value that the slot will be updated to
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ */
+ public abstract void floatWrite(ObjectReference ref, float value, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Perform the actual read of a float read barrier.
+ *
+ * @param ref The object that has the float field
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ * @return the read value
+ */
+ public abstract float floatRead(ObjectReference ref, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Perform the actual write of a double write barrier.
+ *
+ * @param ref The object that has the double field
+ * @param value The value that the slot will be updated to
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ */
+ public abstract void doubleWrite(ObjectReference ref, double value, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Perform the actual read of a double read barrier.
+ *
+ * @param ref The object that has the double field
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ * @return the read value
+ */
+ public abstract double doubleRead(ObjectReference ref, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Perform the actual write of an object reference write barrier.
+ *
+ * @param ref The object that has the reference field
+ * @param value The value that the slot will be updated to
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ */
+ public abstract void objectReferenceWrite(ObjectReference ref, ObjectReference value, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Perform the actual read of a read barrier.
*
* @param ref The object that has the reference field
- * @param slot The slot that holds the reference
- * @param metaDataA VM specific meta data
- * @param metaDataB VM specific meta data
- * @param mode The context in which the write is occuring
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
* @return the read value
*/
- public abstract Word performRawReadInBarrier(ObjectReference ref, Address slot,
- Word metaDataA, Word metaDataB, int mode);
+ public abstract ObjectReference objectReferenceRead(ObjectReference ref, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Perform the actual write of the non-heap write barrier. This is
+ * used when the store is not to an object, but to a non-heap location
+ * such as statics or the stack.
+ *
+ * @param slot The address that contains the reference field
+ * @param target The value that the slot will be updated to
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ */
+ public abstract void objectReferenceNonHeapWrite(Address slot, ObjectReference target, Word metaDataA, Word metaDataB);
/**
* Atomically write a reference field of an object or array and return
* the old value of the reference field.
*
* @param ref The object that has the reference field
- * @param slot The slot that holds the reference
* @param target The value that the slot will be updated to
- * @param metaDataA VM specific meta data
- * @param metaDataB VM specific meta data
- * @param mode The context in which the write is occuring
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
* @return The value that was replaced by the write.
*/
- public abstract ObjectReference performWriteInBarrierAtomic(ObjectReference ref, Address slot,
- ObjectReference target, Word metaDataA,
- Word metaDataB, int mode);
+ public abstract ObjectReference objectReferenceAtomicWrite(ObjectReference ref, ObjectReference target, Word metaDataA, Word metaDataB, int mode);
/**
- * Atomically write a reference field of an object or array and return
- * the old value of the reference field.
+ * Attempt an atomic compare and exchange in a write barrier sequence.
*
* @param ref The object that has the reference field
- * @param slot The slot that holds the reference
- * @param rawTarget The raw value that the slot will be updated to
- * @param metaDataA VM specific meta data
- * @param metaDataB VM specific meta data
- * @param mode The context in which the write is occuring
+ * @param old The old reference to be swapped out
+ * @param target The value that the slot will be updated to
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ * @return True if the compare and swap was successful
+ */
+ public abstract boolean objectReferenceTryCompareAndSwap(ObjectReference ref, ObjectReference old, ObjectReference target, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Perform the actual write of the write barrier, writing the value as a raw Word.
+ *
+ * @param ref The object that has the Word field
+ * @param target The value that the slot will be updated to
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ */
+ public abstract void wordWrite(ObjectReference ref, Word target, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Atomically write a Word field of an object or array and return
+ * the old value of the Word field.
+ *
+ * @param ref The object that has the Word field
+ * @param target The value that the slot will be updated to
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
* @return The raw value that was replaced by the write.
*/
- public abstract Word performRawWriteInBarrierAtomic(ObjectReference ref, Address slot,
- Word rawTarget, Word metaDataA,
- Word metaDataB, int mode);
+ public abstract Word wordAtomicWrite(ObjectReference ref, Word rawTarget, Word metaDataA, Word metaDataB, int mode);
/**
* Attempt an atomic compare and exchange in a write barrier sequence.
*
- * @param ref The object that has the reference field
- * @param slot The slot that holds the reference
- * @param old The old reference to be swapped out
+ * @param ref The object that has the Word field
+ * @param old The old Word to be swapped out
* @param target The value that the slot will be updated to
- * @param metaDataA VM specific meta data
- * @param metaDataB VM specific meta data
- * @param mode The context in which the write is occuring
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
* @return True if the compare and swap was successful
*/
- public abstract boolean tryCompareAndSwapWriteInBarrier(ObjectReference ref, Address slot,
- ObjectReference old, ObjectReference target,
- Word metaDataA, Word metaDataB, int mode);
+ public abstract boolean wordTryCompareAndSwap(ObjectReference ref, Word old, Word target, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Perform the actual read of the read barrier, returning the value as a raw Word.
+ *
+ * @param ref The object that has the Word field
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ * @return the read value
+ */
+ public abstract Word wordRead(ObjectReference ref, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Perform the actual write of the write barrier, writing the value as a raw Address.
+ *
+ * @param ref The object that has the Address field
+ * @param target The value that the slot will be updated to
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ */
+ public abstract void addressWrite(ObjectReference ref, Address target, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Perform the actual read of the read barrier, returning the value as a raw Address.
+ *
+ * @param ref The object that has the Address field
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ * @return the read value
+ */
+ public abstract Address addressRead(ObjectReference ref, Word metaDataA, Word metaDataB, int mode);
/**
* Attempt an atomic compare and exchange in a write barrier sequence.
*
- * @param ref The object that has the reference field
- * @param slot The slot that holds the reference
- * @param rawOld The old reference to be swapped out
- * @param rawTarget The value that the slot will be updated to
- * @param metaDataA VM specific meta data
- * @param metaDataB VM specific meta data
- * @param mode The context in which the write is occuring
+ * @param ref The object that has the Address field
+ * @param old The old address to be swapped out
+ * @param target The value that the slot will be updated to
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
* @return True if the compare and swap was successful
*/
- public abstract boolean tryRawCompareAndSwapWriteInBarrier(ObjectReference ref, Address slot,
- Word rawOld, Word rawTarget,
- Word metaDataA, Word metaDataB, int mode);
+ public abstract boolean addressTryCompareAndSwap(ObjectReference ref, Address old, Address target, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Perform the actual write of the write barrier, writing the value as a raw Offset.
+ *
+ * @param ref The object that has the Offset field
+ * @param target The value that the slot will be updated to
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ */
+ public abstract void offsetWrite(ObjectReference ref, Offset target, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Perform the actual read of the read barrier, returning the value as a raw Offset.
+ *
+ * @param ref The object that has the Offset field
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ * @return the read value
+ */
+ public abstract Offset offsetRead(ObjectReference ref, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Perform the actual write of the write barrier, writing the value as a raw Extent.
+ *
+ * @param ref The object that has the Extent field
+ * @param target The value that the slot will be updated to
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ */
+ public abstract void extentWrite(ObjectReference ref, Extent target, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Perform the actual read of the read barrier, returning the value as a raw Extent.
+ *
+ * @param ref The object that has the Extent field
+ * @param metaDataA Opaque, VM-specific, meta-data identifying the slot
+ * @param metaDataB Opaque, VM-specific, meta-data identifying the slot
+ * @param mode The context in which the write is occurring
+ * @return the read value
+ */
+ public abstract Extent extentRead(ObjectReference ref, Word metaDataA, Word metaDataB, int mode);
+
+ /**
+ * Sets an element of an object array without invoking any write
+ * barrier. This method is called by the Map class to ensure
+ * potentially-allocation-triggering write barriers do not occur in
+ * allocation slow path code.
+ *
+ * @param dst the destination array
+ * @param index the index of the element to set
+ * @param value the new value for the element
+ */
+ public abstract void objectArrayStoreNoGCBarrier(Object [] dst, int index, Object value);
}
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/vm/Debug.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/vm/Debug.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/vm/Debug.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/vm/Debug.java Sat Aug 14 07:25:41 2010
@@ -12,6 +12,7 @@
*/
package org.mmtk.vm;
+import org.mmtk.plan.TraceLocal;
import org.vmmagic.pragma.Uninterruptible;
import org.vmmagic.unboxed.Address;
import org.vmmagic.unboxed.ObjectReference;
@@ -31,14 +32,14 @@
/**
* A modbuf (object remembering barrier) entry has been
* traced during collection.
- * @param object
+ * @param object The modbuf entry
*/
public void modbufEntry(ObjectReference object) { }
/**
* A remset (slot remembering barrier) entry has been
* traced during collection.
- * @param slot
+ * @param slot The remset entry
*/
public void remsetEntry(Address slot) { }
@@ -46,8 +47,8 @@
* An array remset entry has been traced during collection. Implicitly
* the slots from start (inclusive) through to guard (non-inclusive)
* are traced as remset entries
- * @param start
- * @param guard
+ * @param start The entry start address
+ * @param guard The guard
*/
public void arrayRemsetEntry(Address start, Address guard) { }
@@ -74,6 +75,58 @@
*/
public void mutatorPhase(short phaseId, int ordinal, boolean before) { }
+ /**
+ * Trace an object during GC
+ *
+ * *** Non-standard, requires plumbing into a collector during debugging ***
+ *
+ * @param trace The trace being performed
+ * @param object The object
+ */
+ public void traceObject(TraceLocal trace, ObjectReference object) { }
+
+ /**
+ * An entry has been inserted at the head of a queue
+ *
+ * *** Non-standard, requires plumbing into a collector during debugging ***
+ *
+ * @param queueName The name of the queue
+ * @param value The value
+ */
+ public void queueHeadInsert(String queueName, Address value) {
+ }
+
+ /**
+ * An entry has been inserted at the head of a queue
+ *
+ * *** Non-standard, requires plumbing into a collector during debugging ***
+ *
+ * @param queueName The name of the queue
+ * @param value The value
+ */
+ public void queueTailInsert(String queueName, Address value) {
+ }
+
+ /**
+ * An entry has been inserted at the head of a queue
+ *
+ * *** Non-standard, requires plumbing into a collector during debugging ***
+ *
+ * @param queueName The name of the queue
+ * @param value The value
+ */
+ public void queueHeadRemove(String queueName, Address value) { }
+
+ /**
+ * An entry has been inserted at the head of a queue
+ *
+ * *** Non-standard, requires plumbing into a collector during debugging ***
+ *
+ * @param queueName The name of the queue
+ * @param value The value
+ */
+ public void queueTailRemove(String queueName, Address value) { }
+
/*
* NOTE: These methods should not be called by anything other than the
* reflective mechanisms in org.mmtk.vm.VM, and are not implemented by
Modified: vmkit/trunk/mmtk/java/src/org/mmtk/vm/Statistics.java
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/java/src/org/mmtk/vm/Statistics.java?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/java/src/org/mmtk/vm/Statistics.java (original)
+++ vmkit/trunk/mmtk/java/src/org/mmtk/vm/Statistics.java Sat Aug 14 07:25:41 2010
@@ -12,10 +12,12 @@
*/
package org.mmtk.vm;
+import org.vmmagic.pragma.Interruptible;
import org.vmmagic.pragma.Uninterruptible;
- at Uninterruptible public abstract class Statistics {
+ at Uninterruptible
+public abstract class Statistics {
/**
* Returns the number of collections that have occurred.
*
@@ -54,26 +56,13 @@
public abstract long cycles();
/**
- * Initialize performance counters
- *
- * @param metric An integer identifying the metric being read
+ * Initialize performance events
*/
- public abstract void perfCtrInit(int metric);
+ @Interruptible
+ public abstract void perfEventInit(String events);
/**
- * Read the current cycle count from the perfctr libraries
- *
- * @return the current cycle count from the perfctr libraries
+ * Read a performance event value
*/
- public abstract long perfCtrReadCycles();
-
- /**
- * Read the current event count for the metric being measured by the
- * perfctr libraries
- *
- * @return the current event count for the metric being measured by the
- * perfctr libraries
- */
- public abstract long perfCtrReadMetric();
-
+ public abstract void perfEventRead(int counter, long[] values);
}
Modified: vmkit/trunk/mmtk/mmtk-j3/Statistics.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/Statistics.cpp?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/mmtk-j3/Statistics.cpp (original)
+++ vmkit/trunk/mmtk/mmtk-j3/Statistics.cpp Sat Aug 14 07:25:41 2010
@@ -15,10 +15,6 @@
using namespace j3;
-extern "C" void Java_org_j3_mmtk_Statistics_perfCtrInit__I (JavaObject* S, sint32 val) {
- // Implement me
-}
-
extern "C" int64_t Java_org_j3_mmtk_Statistics_cycles__ (JavaObject* S) {
return 0;
}
@@ -43,10 +39,8 @@
return 0;
}
-extern "C" int64_t Java_org_j3_mmtk_Statistics_perfCtrReadCycles__ (JavaObject* S) {
- return 0;
+extern "C" void Java_org_j3_mmtk_Statistics_perfEventInit__Ljava_lang_String_2(JavaObject* S, JavaObject* Str) {
}
-extern "C" int64_t Java_org_j3_mmtk_Statistics_perfCtrReadMetric__ (JavaObject* S) {
- return 0;
+extern "C" void Java_org_j3_mmtk_Statistics_perfEventRead__I_3J(JavaObject* S, int id, int64_t* values) {
}
Modified: vmkit/trunk/mmtk/mmtk-j3/VM.cpp
URL: http://llvm.org/viewvc/llvm-project/vmkit/trunk/mmtk/mmtk-j3/VM.cpp?rev=111072&r1=111071&r2=111072&view=diff
==============================================================================
--- vmkit/trunk/mmtk/mmtk-j3/VM.cpp (original)
+++ vmkit/trunk/mmtk/mmtk-j3/VM.cpp Sat Aug 14 07:25:41 2010
@@ -58,9 +58,5 @@
}
extern "C" bool Java_org_j3_runtime_VM_verifyAssertions__ () {
-#ifdef DEBUG
return true;
-#else
- return false;
-#endif
}
More information about the vmkit-commits
mailing list