Tabnine Logo
Prototype
Code IndexAdd Tabnine to your IDE (free)

How to use
Prototype
in
com.android.dx.rop.type

Best Java code snippets using com.android.dx.rop.type.Prototype (Showing top 20 results out of 315)

origin: linkedin/dexmaker

Prototype prototype(boolean includeThis) {
  return Prototype.intern(descriptor(includeThis));
}
origin: dodola/RocooFix

private void checkPrototype(Prototype proto) {
 checkDescriptor(proto.getReturnType().getDescriptor());
 StdTypeList args = proto.getParameterTypes();
 for (int i = 0; i < args.size(); i++) {
   checkDescriptor(args.get(i).getDescriptor());
 }
}
private void checkDescriptor(String typeDescriptor) {
origin: com.google.android.tools/dx

Type[] params = makeParameterArray(descriptor);
int paramCount = 0;
int at = 1;
result = new Prototype(descriptor, returnType, parameterTypes);
return putIntern(result);
origin: com.android.tools.build/builder

/**
 * Interns an instance, adding to the descriptor as necessary based
 * on the given definer, name, and flags. For example, an init
 * method has an uninitialized object of type {@code definer}
 * as its first argument.
 *
 * @param descriptor {@code non-null;} the descriptor string
 * @param definer {@code non-null;} class the method is defined on
 * @param isStatic whether this is a static method
 * @param isInit whether this is an init method
 * @return {@code non-null;} the interned instance
 */
public static Prototype intern(String descriptor, Type definer,
    boolean isStatic, boolean isInit) {
  Prototype base = intern(descriptor);
  if (isStatic) {
    return base;
  }
  if (isInit) {
    definer = definer.asUninitialized(Integer.MAX_VALUE);
  }
  return base.withFirstParameter(definer);
}
origin: nikita36078/J2ME-Loader

/**
 * Returns a new interned instance, which is the same as this instance,
 * except that it has an additional parameter prepended to the original's
 * argument list.
 *
 * @param param {@code non-null;} the new first parameter
 * @return {@code non-null;} an appropriately-constructed instance
 */
public Prototype withFirstParameter(Type param) {
  String newDesc = "(" + param.getDescriptor() + descriptor.substring(1);
  StdTypeList newParams = parameterTypes.withFirst(param);
  newParams.setImmutable();
  Prototype result =
    new Prototype(newDesc, returnType, newParams);
  return putIntern(result);
}
origin: nikita36078/J2ME-Loader

/**
 * Gets the register that begins the method's parameter range (including
 * the 'this' parameter for non-static methods). The range continues until
 * {@code regSize}
 *
 * @return register as noted above.
 */
private int getParamBase() {
  return regSize
      - desc.getParameterTypes().getWordCount() - (isStatic? 0 : 1);
}
origin: nikita36078/J2ME-Loader

/**
 * {@inheritDoc}
 *
 * In this case, this method returns the <i>return type</i> of this method.
 *
 * @return {@code non-null;} the method's return type
 */
@Override
public final Type getType() {
  return prototype.getReturnType();
}
origin: nikita36078/J2ME-Loader

/** {@inheritDoc} */
@Override
public String toHuman() {
  return prototype.getDescriptor();
}
origin: nikita36078/J2ME-Loader

/**
 * Returns the appropriate {@code invoke-static} rop for the
 * given type. The result is typically a newly-allocated instance.
 *
 * @param meth {@code non-null;} descriptor of the method
 * @return {@code non-null;} an appropriate instance
 */
public static Rop opInvokeStatic(Prototype meth) {
  return new Rop(RegOps.INVOKE_STATIC,
          meth.getParameterFrameTypes(),
          StdTypeList.THROWABLE);
}
origin: nikita36078/J2ME-Loader

/** {@inheritDoc} */
@Override
protected int compareTo0(Constant other) {
  CstProtoRef otherCstProtoRef = (CstProtoRef) other;
  return prototype.compareTo(otherCstProtoRef.getPrototype());
}
origin: com.jakewharton.android.repackaged/dalvik-dx

Type[] params = makeParameterArray(descriptor);
int paramCount = 0;
int at = 1;
return new Prototype(descriptor, returnType, parameterTypes);
origin: nikita36078/J2ME-Loader

/**
 * Gets the prototype of this method as either a
 * {@code static} or instance method. In the case of a
 * {@code static} method, this is the same as the raw
 * prototype. In the case of an instance method, this has an
 * appropriately-typed {@code this} argument as the first
 * one.
 *
 * @param isStatic whether the method should be considered static
 * @return {@code non-null;} the method prototype
 */
public final Prototype getPrototype(boolean isStatic) {
  if (isStatic) {
    return prototype;
  } else {
    if (instancePrototype == null) {
      Type thisType = getDefiningClass().getClassType();
      instancePrototype = prototype.withFirstParameter(thisType);
    }
    return instancePrototype;
  }
}
origin: nikita36078/J2ME-Loader

/**
 * Returns the unique instance corresponding to the
 * given method descriptor. See vmspec-2 sec4.3.3 for details on the
 * field descriptor syntax.
 *
 * @param descriptor {@code non-null;} the descriptor
 * @return {@code non-null;} the corresponding instance
 * @throws IllegalArgumentException thrown if the descriptor has
 * invalid syntax
 */
public static Prototype intern(String descriptor) {
  if (descriptor == null) {
    throw new NullPointerException("descriptor == null");
  }
  Prototype result = internTable.get(descriptor);
  if (result != null) {
    return result;
  }
  result = fromDescriptor(descriptor);
  return putIntern(result);
}
origin: com.google.dexmaker/dexmaker-dx

Type[] params = makeParameterArray(descriptor);
int paramCount = 0;
int at = 1;
result = new Prototype(descriptor, returnType, parameterTypes);
return putIntern(result);
origin: com.android/dx

/**
 * Interns an instance, adding to the descriptor as necessary based
 * on the given definer, name, and flags. For example, an init
 * method has an uninitialized object of type {@code definer}
 * as its first argument.
 *
 * @param descriptor {@code non-null;} the descriptor string
 * @param definer {@code non-null;} class the method is defined on
 * @param isStatic whether this is a static method
 * @param isInit whether this is an init method
 * @return {@code non-null;} the interned instance
 */
public static Prototype intern(String descriptor, Type definer,
    boolean isStatic, boolean isInit) {
  Prototype base = intern(descriptor);
  if (isStatic) {
    return base;
  }
  if (isInit) {
    definer = definer.asUninitialized(Integer.MAX_VALUE);
  }
  return base.withFirstParameter(definer);
}
origin: com.google.android.tools/dx

/**
 * Returns a new interned instance, which is the same as this instance,
 * except that it has an additional parameter prepended to the original's
 * argument list.
 *
 * @param param {@code non-null;} the new first parameter
 * @return {@code non-null;} an appropriately-constructed instance
 */
public Prototype withFirstParameter(Type param) {
  String newDesc = "(" + param.getDescriptor() + descriptor.substring(1);
  StdTypeList newParams = parameterTypes.withFirst(param);
  newParams.setImmutable();
  Prototype result =
    new Prototype(newDesc, returnType, newParams);
  return putIntern(result);
}
origin: nikita36078/J2ME-Loader

/**
 * Gets the register that begins the method's parameter range (including
 * the 'this' parameter for non-static methods). The range continues until
 * {@code regSize}
 *
 * @return register as noted above
 */
private int getParamBase() {
  return regSize
      - desc.getParameterTypes().getWordCount() - (isStatic? 0 : 1);
}
origin: com.jakewharton.android.repackaged/dalvik-dx

/**
 * Gets the return type.
 *
 * @return {@code non-null;} the return type
 */
public Type getReturnType() {
  return prototype.getReturnType();
}
origin: com.jakewharton.android.repackaged/dalvik-dx

/** {@inheritDoc} */
@Override
public String toHuman() {
  return prototype.getDescriptor();
}
origin: com.android/dx

/**
 * Returns the appropriate {@code invoke-static} rop for the
 * given type. The result is typically a newly-allocated instance.
 *
 * @param meth {@code non-null;} descriptor of the method
 * @return {@code non-null;} an appropriate instance
 */
public static Rop opInvokeStatic(Prototype meth) {
  return new Rop(RegOps.INVOKE_STATIC,
          meth.getParameterFrameTypes(),
          StdTypeList.THROWABLE);
}
com.android.dx.rop.typePrototype

Javadoc

Representation of a method descriptor. Instances of this class are generally interned and may be usefully compared with each other using ==.

Most used methods

  • intern
    Interns an instance, adding to the descriptor as necessary based on the given definer, name, and fla
  • getParameterTypes
    Gets the list of parameter types.
  • getReturnType
    Gets the return type.
  • <init>
    Constructs an instance. This is a private constructor; use one of the public static methods to get i
  • compareTo
  • getDescriptor
    Gets the descriptor string.
  • getParameterFrameTypes
    Gets the list of frame types corresponding to the list of parameter types. The difference between th
  • makeParameterArray
    Helper for #intern which returns an empty array to populate with parsed parameter types, and which a
  • putIntern
    Puts the given instance in the intern table if it's not already there. If a conflicting value is alr
  • withFirstParameter
    Returns a new interned instance, which is the same as this instance, except that it has an additiona
  • internInts
    Interns an instance which consists of the given number of ints along with the given return type
  • clearInternTable
  • internInts,
  • clearInternTable,
  • equals,
  • fromDescriptor,
  • hashCode,
  • toString

Popular in Java

  • Reading from database using SQL prepared statement
  • getApplicationContext (Context)
  • requestLocationUpdates (LocationManager)
  • getExternalFilesDir (Context)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • Point (java.awt)
    A point representing a location in (x,y) coordinate space, specified in integer precision.
  • InputStreamReader (java.io)
    A class for turning a byte stream into a character stream. Data read from the source input stream is
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now