diff --git a/MMTk/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriers.java b/MMTk/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriers.java new file mode 100644 index 0000000..92dd225 --- /dev/null +++ b/MMTk/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriers.java @@ -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 + */ +@Uninterruptible +public class UsePrimitiveWriteBarriers extends SS { + +} diff --git a/MMTk/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersCollector.java b/MMTk/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersCollector.java new file mode 100644 index 0000000..773e9a5 --- /dev/null +++ b/MMTk/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersCollector.java @@ -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} + */ +@Uninterruptible +public class UsePrimitiveWriteBarriersCollector extends SSCollector { +} diff --git a/MMTk/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersConstraints.java b/MMTk/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersConstraints.java new file mode 100644 index 0000000..128406b --- /dev/null +++ b/MMTk/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersConstraints.java @@ -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.plan.semispace.usePrimitiveWriteBarriers; + +import org.mmtk.plan.semispace.SSConstraints; +import org.vmmagic.pragma.*; + +/** + * UsePrimitiveWriteBarriers common constants. + */ +@Uninterruptible +public class UsePrimitiveWriteBarriersConstraints extends SSConstraints { + + /** @return True if this Plan requires primitive write barriers. */ + @Override + public boolean needsPrimitiveWriteBarrier() { return true; } +} diff --git a/MMTk/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersMutator.java b/MMTk/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersMutator.java new file mode 100644 index 0000000..8df47a5 --- /dev/null +++ b/MMTk/src/org/mmtk/plan/semispace/usePrimitiveWriteBarriers/UsePrimitiveWriteBarriersMutator.java @@ -0,0 +1,168 @@ +/* + * 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. + */ +@Uninterruptible +public class UsePrimitiveWriteBarriersMutator extends SSMutator { + + /**************************************************************************** + * + * Primitive Write Barrier specific + */ + + /** + * A boolean needs to be written into an object + * @param src The object into which the new primitive will be stored + * @param slot The address into which the new primitive will be stored. + * @param value The new boolean (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 mode of the store (eg putfield, putstatic etc) + */ + @Inline + public final void writeBarrier(ObjectReference src, Address slot, + boolean value, Word metaDataA, Word metaDataB, int mode) { + VM.barriers.performWriteInBarrier(src, slot, value, metaDataA, metaDataB, mode); + } + + /** + * A byte needs to be written into an object + * @param src The object into which the new primitive will be stored + * @param slot The address into which the new primitive will be stored. + * @param value 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 mode of the store (eg putfield, putstatic etc) + */ + @Inline + public final void writeBarrier(ObjectReference src, Address slot, + byte value, Word metaDataA, Word metaDataB, int mode) { + VM.barriers.performWriteInBarrier(src, slot, value, metaDataA, metaDataB, mode); + } + + /** + * A char needs to be written into an object + * @param src The object into which the new primitive will be stored + * @param slot The address into which the new primitive will be stored. + * @param value 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 mode of the store (eg putfield, putstatic etc) + */ + @Inline + public final void writeBarrier(ObjectReference src, Address slot, + char value, Word metaDataA, Word metaDataB, int mode) { + VM.barriers.performWriteInBarrier(src, slot, value, metaDataA, metaDataB, mode); + } + + /** + * A double needs to be written into an object + * @param src The object into which the new primitive will be stored + * @param slot The address into which the new primitive will be stored. + * @param value 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 mode of the store (eg putfield, putstatic etc) + */ + @Inline + public final void writeBarrier(ObjectReference src, Address slot, + double value, Word metaDataA, Word metaDataB, int mode) { + VM.barriers.performWriteInBarrier(src, slot, value, metaDataA, metaDataB, mode); + } + + /** + * A float needs to be written into an object + * @param src The object into which the new primitive will be stored + * @param slot The address into which the new primitive will be stored. + * @param value 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 mode of the store (eg putfield, putstatic etc) + */ + @Inline + public final void writeBarrier(ObjectReference src, Address slot, + float value, Word metaDataA, Word metaDataB, int mode) { + VM.barriers.performWriteInBarrier(src, slot, value, metaDataA, metaDataB, mode); + } + + /** + * An integer needs to be written into an object + * @param src The object into which the new primitive will be stored + * @param slot The address into which the new primitive will be stored. + * @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 mode of the store (eg putfield, putstatic etc) + */ + @Inline + public final void writeBarrier(ObjectReference src, Address slot, + int value, Word metaDataA, Word metaDataB, int mode) { + VM.barriers.performWriteInBarrier(src, slot, value, metaDataA, metaDataB, mode); + } + + /** + * A long needs to be written into an object + * @param src The object into which the new primitive will be stored + * @param slot The address into which the new primitive will be stored. + * @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 mode of the store (eg putfield, putstatic etc) + */ + @Inline + public final void writeBarrier(ObjectReference src, Address slot, + long value, Word metaDataA, Word metaDataB, int mode) { + VM.barriers.performWriteInBarrier(src, slot, value, metaDataA, metaDataB, mode); + } + + /** + * A short needs to be written into an object + * @param src The object into which the new primitive will be stored + * @param slot The address into which the new primitive will be stored. + * @param value 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 mode of the store (eg putfield, putstatic etc) + */ + @Inline + public final void writeBarrier(ObjectReference src, Address slot, + short value, Word metaDataA, Word metaDataB, int mode) { + VM.barriers.performWriteInBarrier(src, slot, value, metaDataA, metaDataB, mode); + } + + /** + * A unboxed {@link Word} needs to be written into an object + * @param src The object into which the new Word will be stored + * @param slot The address into which the new Word will be stored. + * @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 mode of the store (eg putfield, putstatic etc) + */ + @Inline + public final void writeBarrier(ObjectReference src, Address slot, + Word value, Word metaDataA, Word metaDataB, int mode) { + VM.barriers.performRawWriteInBarrier(src, slot, value, metaDataA, metaDataB, mode); + } +} diff --git a/build/configs/ExtremeAssertionsBaseBaseUsePrimitiveWriteBarriers.properties b/build/configs/ExtremeAssertionsBaseBaseUsePrimitiveWriteBarriers.properties new file mode 100644 index 0000000..fb949ba --- /dev/null +++ b/build/configs/ExtremeAssertionsBaseBaseUsePrimitiveWriteBarriers.properties @@ -0,0 +1,14 @@ +# +# 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. +# +config.mmtk.plan=org.mmtk.plan.semispace.usePrimitiveWriteBarriers.UsePrimitiveWriteBarriers +config.assertions=extreme diff --git a/build/configs/ExtremeAssertionsOptAdaptiveUsePrimitiveWriteBarriers.properties b/build/configs/ExtremeAssertionsOptAdaptiveUsePrimitiveWriteBarriers.properties new file mode 100644 index 0000000..5abedd9 --- /dev/null +++ b/build/configs/ExtremeAssertionsOptAdaptiveUsePrimitiveWriteBarriers.properties @@ -0,0 +1,18 @@ +# +# 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. +# +config.mmtk.plan=org.mmtk.plan.semispace.usePrimitiveWriteBarriers.UsePrimitiveWriteBarriers +config.assertions=extreme +config.include.aos=true +config.runtime.compiler=opt +config.bootimage.compiler=opt +config.bootimage.compiler.args=-X:bc:O2