Search in sources :

Example 1 with Constraints

use of org.jikesrvm.mm.mminterface.Selected.Constraints in project JikesRVM by JikesRVM.

the class BarrierSize method main.

public static void main(String[] args) throws Exception {
    RVMClass barrierSize = JikesRVMSupport.getTypeForClass(BarrierSize.class).asClass();
    barrierSize.prepareForFirstUse();
    thisClass = Class.forName("BarrierSize");
    emptySize = methodInstructionCount("emptyInstanceMethod", (Class[]) null);
    Constraints constraints = Selected.Constraints.get();
    printHeader("reference barriers");
    int oFieldWriteSize = methodInstructionCount("writeToObjectField", Object.class);
    int oFieldReadSize = methodInstructionCount("readFromObjectField", (Class[]) null);
    printBarrierRequirement("object reference write", constraints.needsObjectReferenceWriteBarrier());
    printSizeForMethod("object reference write", oFieldWriteSize);
    printBarrierRequirement("object reference read", constraints.needsObjectReferenceReadBarrier());
    printSizeForMethod("object reference read", oFieldReadSize);
    System.out.println();
    printHeader("primitive barriers");
    int booleanWriteSize = methodInstructionCount("writeToBooleanField", boolean.class);
    printBarrierRequirement("boolean write", constraints.needsBooleanWriteBarrier());
    printSizeForMethod("boolean write", booleanWriteSize);
    int booleanReadSize = methodInstructionCount("readFromBooleanField", (Class[]) null);
    printBarrierRequirement("boolean read", constraints.needsBooleanWriteBarrier());
    printSizeForMethod("boolean read", booleanReadSize);
    int byteWriteSize = methodInstructionCount("writeToByteField", byte.class);
    printBarrierRequirement("byte write", constraints.needsByteWriteBarrier());
    printSizeForMethod("byte write", byteWriteSize);
    int byteReadSize = methodInstructionCount("readFromByteField", (Class[]) null);
    printBarrierRequirement("byte read", constraints.needsByteWriteBarrier());
    printSizeForMethod("byte read", byteReadSize);
    int charWriteSize = methodInstructionCount("writeToCharField", char.class);
    printBarrierRequirement("char write", constraints.needsCharWriteBarrier());
    printSizeForMethod("char write", charWriteSize);
    int charReadSize = methodInstructionCount("readFromCharField", (Class[]) null);
    printBarrierRequirement("char read", constraints.needsCharWriteBarrier());
    printSizeForMethod("char read", charReadSize);
    int shortWriteSize = methodInstructionCount("writeToShortField", short.class);
    printBarrierRequirement("short write", constraints.needsShortWriteBarrier());
    printSizeForMethod("short write", shortWriteSize);
    int shortReadSize = methodInstructionCount("readFromShortField", (Class[]) null);
    printBarrierRequirement("short read", constraints.needsShortWriteBarrier());
    printSizeForMethod("short read", shortReadSize);
    int intWriteSize = methodInstructionCount("writeToIntField", int.class);
    printBarrierRequirement("int write", constraints.needsIntWriteBarrier());
    printSizeForMethod("int write", intWriteSize);
    int intReadSize = methodInstructionCount("readFromIntField", (Class[]) null);
    printBarrierRequirement("int read", constraints.needsIntWriteBarrier());
    printSizeForMethod("int read", intReadSize);
    int floatWriteSize = methodInstructionCount("writeToFloatField", float.class);
    printBarrierRequirement("float write", constraints.needsFloatWriteBarrier());
    printSizeForMethod("float write", floatWriteSize);
    int floatReadSize = methodInstructionCount("readFromFloatField", (Class[]) null);
    printBarrierRequirement("float read", constraints.needsFloatWriteBarrier());
    printSizeForMethod("float read", floatReadSize);
    int doubleWriteSize = methodInstructionCount("writeToDoubleField", double.class);
    printBarrierRequirement("double write", constraints.needsDoubleWriteBarrier());
    printSizeForMethod("double write", doubleWriteSize);
    int doubleReadSize = methodInstructionCount("readFromDoubleField", (Class[]) null);
    printBarrierRequirement("double read", constraints.needsDoubleWriteBarrier());
    printSizeForMethod("double read", doubleReadSize);
    int longWriteSize = methodInstructionCount("writeToLongField", long.class);
    printBarrierRequirement("long write", constraints.needsLongWriteBarrier());
    printSizeForMethod("long write", longWriteSize);
    int longReadSize = methodInstructionCount("readFromLongField", (Class[]) null);
    printBarrierRequirement("long read", constraints.needsLongWriteBarrier());
    printSizeForMethod("long read", longReadSize);
    System.out.println();
    printHeader("primitive array store barriers");
    int booleanArrayWriteSize = methodInstructionCount("writeToBooleanArray", boolean.class);
    printBarrierRequirement("boolean array write", constraints.needsBooleanWriteBarrier());
    printSizeForMethod("boolean array write", booleanArrayWriteSize);
    int booleanArrayReadSize = methodInstructionCount("readFromBooleanArray", (Class[]) null);
    printBarrierRequirement("boolean array read", constraints.needsBooleanWriteBarrier());
    printSizeForMethod("boolean array read", booleanArrayReadSize);
    int byteArrayWriteSize = methodInstructionCount("writeToByteArray", byte.class);
    printBarrierRequirement("byte array write", constraints.needsByteWriteBarrier());
    printSizeForMethod("byte array write", byteArrayWriteSize);
    int byteArrayReadSize = methodInstructionCount("readFromByteArray", (Class[]) null);
    printBarrierRequirement("byte array read", constraints.needsByteWriteBarrier());
    printSizeForMethod("byte array read", byteArrayReadSize);
    int charArrayWriteSize = methodInstructionCount("writeToCharArray", char.class);
    printBarrierRequirement("char array write", constraints.needsCharWriteBarrier());
    printSizeForMethod("char array write", charArrayWriteSize);
    int charArrayReadSize = methodInstructionCount("readFromCharArray", (Class[]) null);
    printBarrierRequirement("char array read", constraints.needsCharWriteBarrier());
    printSizeForMethod("char array read", charArrayReadSize);
    int shortArrayWriteSize = methodInstructionCount("writeToShortArray", short.class);
    printBarrierRequirement("short array write", constraints.needsShortWriteBarrier());
    printSizeForMethod("short array write", shortArrayWriteSize);
    int shortArrayReadSize = methodInstructionCount("readFromShortArray", (Class[]) null);
    printBarrierRequirement("short array read", constraints.needsShortWriteBarrier());
    printSizeForMethod("short array read", shortArrayReadSize);
    int intArrayWriteSize = methodInstructionCount("writeToIntArray", int.class);
    printBarrierRequirement("int array write", constraints.needsIntWriteBarrier());
    printSizeForMethod("int array write", intArrayWriteSize);
    int intArrayReadSize = methodInstructionCount("readFromIntArray", (Class[]) null);
    printBarrierRequirement("int array read", constraints.needsIntWriteBarrier());
    printSizeForMethod("int array read", intArrayReadSize);
    int floatArrayWriteSize = methodInstructionCount("writeToFloatArray", float.class);
    printBarrierRequirement("float array write", constraints.needsFloatWriteBarrier());
    printSizeForMethod("float array write", floatArrayWriteSize);
    int floatArrayReadSize = methodInstructionCount("readFromFloatArray", (Class[]) null);
    printBarrierRequirement("float array read", constraints.needsFloatWriteBarrier());
    printSizeForMethod("float array read", floatArrayReadSize);
    int doubleArrayWriteSize = methodInstructionCount("writeToDoubleArray", double.class);
    printBarrierRequirement("double array write", constraints.needsDoubleWriteBarrier());
    printSizeForMethod("double array write", doubleArrayWriteSize);
    int doubleArrayReadSize = methodInstructionCount("readFromDoubleArray", (Class[]) null);
    printBarrierRequirement("double array read", constraints.needsDoubleWriteBarrier());
    printSizeForMethod("double array read", doubleArrayReadSize);
    int longArrayWriteSize = methodInstructionCount("writeToLongArray", long.class);
    printBarrierRequirement("long array write", constraints.needsLongWriteBarrier());
    printSizeForMethod("long array write", longArrayWriteSize);
    int longArrayReadSize = methodInstructionCount("readFromLongArray", (Class[]) null);
    printBarrierRequirement("long array read", constraints.needsLongWriteBarrier());
    printSizeForMethod("long array read", longArrayReadSize);
    System.out.println();
    printHeader("unboxed barriers");
    int addressWriteSize = methodInstructionCount("writeToAddressField", Address.class);
    printBarrierRequirement("address write", constraints.needsAddressWriteBarrier());
    printSizeForMethod("address write", addressWriteSize);
    int addressReadSize = methodInstructionCount("readFromAddressField", (Class[]) null);
    printBarrierRequirement("address read", constraints.needsAddressWriteBarrier());
    printSizeForMethod("address read", addressReadSize);
    int wordWriteSize = methodInstructionCount("writeToWordField", Word.class);
    printBarrierRequirement("word write", constraints.needsWordWriteBarrier());
    printSizeForMethod("word write", wordWriteSize);
    int wordReadSize = methodInstructionCount("readFromWordField", (Class[]) null);
    printBarrierRequirement("word read", constraints.needsWordWriteBarrier());
    printSizeForMethod("word read", wordReadSize);
    int extentWriteSize = methodInstructionCount("writeToExtentField", Extent.class);
    printBarrierRequirement("extent write", constraints.needsExtentWriteBarrier());
    printSizeForMethod("extent write", extentWriteSize);
    int extentReadSize = methodInstructionCount("readFromExtentField", (Class[]) null);
    printBarrierRequirement("extent read", constraints.needsExtentWriteBarrier());
    printSizeForMethod("extent read", extentReadSize);
    int offsetWriteSize = methodInstructionCount("writeToOffsetField", Offset.class);
    printBarrierRequirement("offset write", constraints.needsOffsetWriteBarrier());
    printSizeForMethod("offset write", offsetWriteSize);
    int offsetReadSize = methodInstructionCount("readFromOffsetField", (Class[]) null);
    printBarrierRequirement("offset read", constraints.needsOffsetWriteBarrier());
    printSizeForMethod("offset read", offsetReadSize);
}
Also used : Constraints(org.jikesrvm.mm.mminterface.Selected.Constraints) RVMClass(org.jikesrvm.classloader.RVMClass) RVMClass(org.jikesrvm.classloader.RVMClass)

Aggregations

RVMClass (org.jikesrvm.classloader.RVMClass)1 Constraints (org.jikesrvm.mm.mminterface.Selected.Constraints)1