Java Code Examples for com.android.dx.rop.type.Prototype#fromDescriptor()

The following examples show how to use com.android.dx.rop.type.Prototype#fromDescriptor() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CstBaseMethodRef.java    From Box with Apache License 2.0 6 votes vote down vote up
/**
 * Constructs an instance.
 *
 * @param definingClass {@code non-null;} the type of the defining class
 * @param nat {@code non-null;} the name-and-type
 */
/*package*/ CstBaseMethodRef(CstType definingClass, CstNat nat) {
    super(definingClass, nat);

    String descriptor = getNat().getDescriptor().getString();
    if (isSignaturePolymorphic()) {
        // The prototype for signature polymorphic methods is used to
        // construct call-site information and select the true invocation
        // target (invoke() or invokeExact(). The prototype is created
        // without being interned to avoid polluting the DEX file with
        // unused data.
        this.prototype = Prototype.fromDescriptor(descriptor);
    } else {
        this.prototype = Prototype.intern(descriptor);
    }
    this.instancePrototype = null;
}
 
Example 2
Source File: CstBaseMethodRef.java    From Box with Apache License 2.0 6 votes vote down vote up
/**
 * Constructs an instance.
 *
 * @param definingClass {@code non-null;} the type of the defining class
 * @param nat {@code non-null;} the name-and-type
 */
/*package*/ CstBaseMethodRef(CstType definingClass, CstNat nat) {
    super(definingClass, nat);

    String descriptor = getNat().getDescriptor().getString();
    if (isSignaturePolymorphic()) {
        // The prototype for signature polymorphic methods is used to
        // construct call-site information and select the true invocation
        // target (invoke() or invokeExact(). The prototype is created
        // without being interned to avoid polluting the DEX file with
        // unused data.
        this.prototype = Prototype.fromDescriptor(descriptor);
    } else {
        this.prototype = Prototype.intern(descriptor);
    }
    this.instancePrototype = null;
}
 
Example 3
Source File: CstBaseMethodRef.java    From J2ME-Loader with Apache License 2.0 6 votes vote down vote up
/**
 * Constructs an instance.
 *
 * @param definingClass {@code non-null;} the type of the defining class
 * @param nat {@code non-null;} the name-and-type
 */
/*package*/ CstBaseMethodRef(CstType definingClass, CstNat nat) {
    super(definingClass, nat);

    String descriptor = getNat().getDescriptor().getString();
    if (isSignaturePolymorphic()) {
        // The prototype for signature polymorphic methods is used to
        // construct call-site information and select the true invocation
        // target (invoke() or invokeExact(). The prototype is created
        // without being interned to avoid polluting the DEX file with
        // unused data.
        this.prototype = Prototype.fromDescriptor(descriptor);
    } else {
        this.prototype = Prototype.intern(descriptor);
    }
    this.instancePrototype = null;
}
 
Example 4
Source File: CstInvokeDynamic.java    From Box with Apache License 2.0 5 votes vote down vote up
/**
 * Constructs an instance. This constructor is private; use {@link #make}.
 *
 * @param bootstrapMethodIndex The index of the bootstrap method in the bootstrap method table
 * @param nat the name and type
 */
private CstInvokeDynamic(int bootstrapMethodIndex, CstNat nat) {
    this.bootstrapMethodIndex = bootstrapMethodIndex;
    this.nat = nat;
    this.prototype = Prototype.fromDescriptor(nat.getDescriptor().toHuman());
    this.references = new ArrayList<>();
}
 
Example 5
Source File: CstInvokeDynamic.java    From Box with Apache License 2.0 5 votes vote down vote up
/**
 * Constructs an instance. This constructor is private; use {@link #make}.
 *
 * @param bootstrapMethodIndex The index of the bootstrap method in the bootstrap method table
 * @param nat the name and type
 */
private CstInvokeDynamic(int bootstrapMethodIndex, CstNat nat) {
    this.bootstrapMethodIndex = bootstrapMethodIndex;
    this.nat = nat;
    this.prototype = Prototype.fromDescriptor(nat.getDescriptor().toHuman());
    this.references = new ArrayList<>();
}
 
Example 6
Source File: CstProtoRef.java    From Box with Apache License 2.0 2 votes vote down vote up
/**
 * Makes an instance for the given value. This may (but does not
 * necessarily) return an already-allocated instance.
 *
 * @param descriptor the method descriptor
 * @return {@code non-null;} the appropriate instance
 */
public static CstProtoRef make(CstString descriptor) {
    Prototype prototype = Prototype.fromDescriptor(descriptor.getString());
    return new CstProtoRef(prototype);
}
 
Example 7
Source File: CstProtoRef.java    From Box with Apache License 2.0 2 votes vote down vote up
/**
 * Makes an instance for the given value. This may (but does not
 * necessarily) return an already-allocated instance.
 *
 * @param descriptor the method descriptor
 * @return {@code non-null;} the appropriate instance
 */
public static CstProtoRef make(CstString descriptor) {
    Prototype prototype = Prototype.fromDescriptor(descriptor.getString());
    return new CstProtoRef(prototype);
}
 
Example 8
Source File: CstMethodType.java    From J2ME-Loader with Apache License 2.0 2 votes vote down vote up
/**
 * Constructs an instance. This constructor is private; use {@link #make}.
 *
 * @param descriptor the method descriptor
 */
private CstMethodType(CstString descriptor) {
    prototype = Prototype.fromDescriptor(descriptor.getString());
}