當前位置: 首頁>>代碼示例>>Java>>正文


Java FieldActor類代碼示例

本文整理匯總了Java中com.sun.max.vm.actor.member.FieldActor的典型用法代碼示例。如果您正苦於以下問題:Java FieldActor類的具體用法?Java FieldActor怎麽用?Java FieldActor使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


FieldActor類屬於com.sun.max.vm.actor.member包,在下文中一共展示了FieldActor類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initOptionalSupportFields

import com.sun.max.vm.actor.member.FieldActor; //導入依賴的package包/類
@SUBSTITUTE
private static void initOptionalSupportFields() {
    try {
        final Class<?> klass = Class.forName("sun.management.VMManagementImpl");
        final Object staticTuple = ClassActor.fromJava(klass).staticTuple();
        final Field[] fields = klass.getDeclaredFields();
        for (int i = 0; i < fields.length; i++) {
            final Field field = fields[i];
            final String fieldName = field.getName();
            if (fieldName.endsWith("Support")) {
                FieldActor.fromJava(field).setBoolean(staticTuple, isSupported(fieldName));
            }
        }
    } catch (Exception ex) {
        VEError.unexpected("problem initializing sun.management.VMManagementImpl " + ex);
    }
}
 
開發者ID:SnakeDoc,項目名稱:GuestVM,代碼行數:18,代碼來源:JDK_sun_management_VMManagementImpl.java

示例2: doClass

import com.sun.max.vm.actor.member.FieldActor; //導入依賴的package包/類
@Override
public boolean doClass(ClassActor classActor) {
    MaxSimInterface.ClassInfo.Kind kind = classActorToTypeKind(classActor);
    int classId = UnsafeCast.asInt(classActor.getMaxSimTag());

    if (classId > maxClassInfoId) {
        maxClassInfoId = classId;
    }
    classInfo.clear();
    classInfo.setId(classId);
    classInfo.setDesc(classActor.name());
    classInfo.setKind(kind);
    if (kind == MaxSimInterface.ClassInfo.Kind.ARRAY) {
        classInfo.setComponentId(UnsafeCast.asInt(classActor.componentClassActor().getMaxSimTag()));
    } else if (kind == MaxSimInterface.ClassInfo.Kind.TUPLE ||
               kind == MaxSimInterface.ClassInfo.Kind.HYBRID) {
        ClassActor currentClassActor = classActor;
        do {
            for (FieldActor fieldActor : currentClassActor.localInstanceFieldActors()) {
                if (!(fieldActor.descriptor().isResolvableWithoutClassLoading(fieldActor.holder().classLoader)) &&
                    !(fieldActor instanceof InjectedFieldActor)) {
                    continue;
                }
                fieldInfo.clear();
                fieldInfo.setName(fieldActor.name());
                fieldInfo.setOffset(fieldActor.offset());
                fieldInfo.setClassId(UnsafeCast.asInt(fieldActor.type().getMaxSimTag()));
                if (fieldActor.isFinal()) {
                    fieldInfo.addProperty(MaxSimInterface.FieldInfo.Property.FINAL);
                }
                classInfo.addFieldInfo(fieldInfo);
            }
            currentClassActor = currentClassActor.superClassActor;
        } while (currentClassActor != null);
    }
    maxineInfo.addClassInfo(classInfo);

    return true;
}
 
開發者ID:arodchen,項目名稱:MaxSim,代碼行數:40,代碼來源:MaxSimMaxineInfoBuilder.java

示例3: staticFieldOffset

import com.sun.max.vm.actor.member.FieldActor; //導入依賴的package包/類
/**
 * Gets the offset of a declared static field from the start of its class.
 * @see Unsafe#staticFieldOffset(Field)
 * @param field the field for which to get offset
 * @return the offset for the field from the beginning of its class's static fields
 */
@SUBSTITUTE
public long staticFieldOffset(Field field) {
    return FieldActor.fromJava(field).offset();
}
 
開發者ID:beehive-lab,項目名稱:Maxine-VM,代碼行數:11,代碼來源:JDK_sun_misc_Unsafe.java

示例4: objectFieldOffset

import com.sun.max.vm.actor.member.FieldActor; //導入依賴的package包/類
/**
 * Gets the offset of a declared field from the start of an object of its type.
 * @see Unsafe#objectFieldOffset(Field)
 * @param field the field for which to get offset
 * @return the offset for the field from the beginning of an object of the appropriate type
 */
@SUBSTITUTE
public long objectFieldOffset(Field field) {
    return FieldActor.fromJava(field).offset();
}
 
開發者ID:beehive-lab,項目名稱:Maxine-VM,代碼行數:11,代碼來源:JDK_sun_misc_Unsafe.java

示例5: staticFieldBase

import com.sun.max.vm.actor.member.FieldActor; //導入依賴的package包/類
/**
 * Gets the base address for static fields.
 * @see Unsafe#staticFieldBase(Field)
 * @param field the field for which to get the base
 * @return an address representing the base for a static field's offset
 */
@SUBSTITUTE
public Object staticFieldBase(Field field) {
    return FieldActor.fromJava(field).holder().staticTuple();
}
 
開發者ID:beehive-lab,項目名稱:Maxine-VM,代碼行數:11,代碼來源:JDK_sun_misc_Unsafe.java


注:本文中的com.sun.max.vm.actor.member.FieldActor類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。