use of com.android.dx.rop.type.StdTypeList in project buck by facebook.
the class ProtoIdItem method makeShortForm.
/**
* Creates the short-form of the given prototype.
*
* @param prototype {@code non-null;} the prototype
* @return {@code non-null;} the short form
*/
private static CstString makeShortForm(Prototype prototype) {
StdTypeList parameters = prototype.getParameterTypes();
int size = parameters.size();
StringBuilder sb = new StringBuilder(size + 1);
sb.append(shortFormCharFor(prototype.getReturnType()));
for (int i = 0; i < size; i++) {
sb.append(shortFormCharFor(parameters.getType(i)));
}
return new CstString(sb.toString());
}
use of com.android.dx.rop.type.StdTypeList in project RocooFix by dodola.
the class ClassReferenceListBuilder method addDependencies.
private void addDependencies(ConstantPool pool) {
for (Constant constant : pool.getEntries()) {
if (constant instanceof CstType) {
checkDescriptor(((CstType) constant).getClassType());
} else if (constant instanceof CstFieldRef) {
checkDescriptor(((CstFieldRef) constant).getType());
} else if (constant instanceof CstMethodRef) {
Prototype proto = ((CstMethodRef) constant).getPrototype();
checkDescriptor(proto.getReturnType());
StdTypeList args = proto.getParameterTypes();
for (int i = 0; i < args.size(); i++) {
checkDescriptor(args.get(i));
}
}
}
}
use of com.android.dx.rop.type.StdTypeList in project RocooFix by dodola.
the class ClassReferenceListBuilder method checkPrototype.
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());
}
}
use of com.android.dx.rop.type.StdTypeList in project J2ME-Loader by nikita36078.
the class BaseMachine method popArgs.
/**
* {@inheritDoc}
*/
public void popArgs(Frame frame, Prototype prototype) {
StdTypeList types = prototype.getParameterTypes();
int size = types.size();
// Use the above method to do the actual popping...
popArgs(frame, size);
for (int i = 0; i < size; i++) {
if (!Merger.isPossiblyAssignableFrom(types.getType(i), args[i])) {
throw new SimException("at stack depth " + (size - 1 - i) + ", expected type " + types.getType(i).toHuman() + " but found " + args[i].getType().toHuman());
}
}
}
use of com.android.dx.rop.type.StdTypeList in project J2ME-Loader by nikita36078.
the class ByteCatchList method toRopCatchList.
/**
* Returns a rop-style catches list equivalent to this one.
*
* @return {@code non-null;} the converted instance
*/
public TypeList toRopCatchList() {
int sz = size();
if (sz == 0) {
return StdTypeList.EMPTY;
}
StdTypeList result = new StdTypeList(sz);
for (int i = 0; i < sz; i++) {
result.set(i, get(i).getExceptionClass().getClassType());
}
result.setImmutable();
return result;
}
Aggregations