Search in sources :

Example 1 with J9MethodParameterPointer

use of com.ibm.j9ddr.vm29.pointer.generated.J9MethodParameterPointer in project openj9 by eclipse.

the class RomClassWalker method allSlotsInMethodParametersDataDo.

private long allSlotsInMethodParametersDataDo(U32Pointer cursor) throws CorruptDataException {
    J9MethodParametersDataPointer methodParametersData = J9MethodParametersDataPointer.cast(cursor);
    J9MethodParameterPointer parameters = methodParametersData.parameters();
    long methodParametersSize = ROMHelp.J9_METHOD_PARAMS_SIZE_FROM_NUMBER_OF_PARAMS(methodParametersData.parameterCount().longValue());
    long padding = U32.SIZEOF - (methodParametersSize % U32.SIZEOF);
    long size = 0;
    if (padding == U32.SIZEOF) {
        padding = 0;
    }
    size = methodParametersSize + padding;
    classWalkerCallback.addSlot(clazz, SlotType.J9_SRP, methodParametersData.parameterCountEA(), "parameterCount");
    for (int i = 0; i < methodParametersData.parameterCount().longValue(); i++) {
        classWalkerCallback.addSlot(clazz, SlotType.J9_SRP, parameters.nameEA(), "methodParameterName");
        classWalkerCallback.addSlot(clazz, SlotType.J9_U16, parameters.flagsEA(), "methodParameterFlag");
    }
    cursor = cursor.addOffset(methodParametersSize);
    for (; padding > 0; padding--) {
        classWalkerCallback.addSlot(clazz, SlotType.J9_U8, cursor, "MethodParameters padding");
        cursor.addOffset(1);
    }
    classWalkerCallback.addSection(clazz, methodParametersData, size, "Method Parameters", true);
    return size / U32.SIZEOF;
}
Also used : J9MethodParametersDataPointer(com.ibm.j9ddr.vm29.pointer.generated.J9MethodParametersDataPointer) J9MethodParameterPointer(com.ibm.j9ddr.vm29.pointer.generated.J9MethodParameterPointer)

Example 2 with J9MethodParameterPointer

use of com.ibm.j9ddr.vm29.pointer.generated.J9MethodParameterPointer in project openj9 by eclipse.

the class J9BCUtil method dumpMethodParameters.

private static void dumpMethodParameters(PrintStream out, J9ROMClassPointer romclass, J9ROMMethodPointer romMethod, long flags) throws CorruptDataException {
    J9MethodParametersDataPointer methodParameters = ROMHelp.getMethodParametersFromROMMethod(romMethod);
    if (methodParameters != J9MethodParametersDataPointer.NULL) {
        J9MethodParameterPointer parameters = methodParameters.parameters();
        out.println(String.format("  Method Parameters (%d):\n", methodParameters.parameterCount().longValue()));
        for (int i = 0; i < methodParameters.parameterCount().longValue(); i++) {
            J9UTF8Pointer name = J9UTF8Pointer.cast(parameters.nameEA().get());
            long parameterFlags = parameters.flags().longValue();
            if (name.isNull()) {
                out.print("    <no name>");
            } else {
                out.print("    " + J9UTF8Helper.stringValue(name));
            }
            out.print(String.format("    0x%x ( ", parameterFlags));
            dumpModifiers(out, parameterFlags, ONLY_SPEC_MODIFIERS, MODIFIERSOURCE_METHODPARAMETER);
            out.println(" )\n");
        }
        out.println("\n");
    }
}
Also used : J9MethodParametersDataPointer(com.ibm.j9ddr.vm29.pointer.generated.J9MethodParametersDataPointer) J9MethodParameterPointer(com.ibm.j9ddr.vm29.pointer.generated.J9MethodParameterPointer) J9UTF8Pointer(com.ibm.j9ddr.vm29.pointer.generated.J9UTF8Pointer)

Aggregations

J9MethodParameterPointer (com.ibm.j9ddr.vm29.pointer.generated.J9MethodParameterPointer)2 J9MethodParametersDataPointer (com.ibm.j9ddr.vm29.pointer.generated.J9MethodParametersDataPointer)2 J9UTF8Pointer (com.ibm.j9ddr.vm29.pointer.generated.J9UTF8Pointer)1