本文整理汇总了Java中com.android.dx.util.IntList.EMPTY属性的典型用法代码示例。如果您正苦于以下问题:Java IntList.EMPTY属性的具体用法?Java IntList.EMPTY怎么用?Java IntList.EMPTY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类com.android.dx.util.IntList
的用法示例。
在下文中一共展示了IntList.EMPTY属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: toTargetList
/**
* Returns a target list corresponding to this instance. The result
* is a list of all the exception handler addresses, with the given
* {@code noException} address appended if appropriate. The
* result is automatically made immutable.
*
* @param noException {@code >= -1;} the no-exception address to append, or
* {@code -1} not to append anything
* @return {@code non-null;} list of exception targets, with
* {@code noException} appended if necessary
*/
public IntList toTargetList(int noException) {
if (noException < -1) {
throw new IllegalArgumentException("noException < -1");
}
boolean hasDefault = (noException >= 0);
int sz = size();
if (sz == 0) {
if (hasDefault) {
/*
* The list is empty, but there is a no-exception
* address; so, the result is just that address.
*/
return IntList.makeImmutable(noException);
}
/*
* The list is empty and there isn't even a no-exception
* address.
*/
return IntList.EMPTY;
}
IntList result = new IntList(sz + (hasDefault ? 1 : 0));
for (int i = 0; i < sz; i++) {
result.add(get(i).getHandlerPc());
}
if (hasDefault) {
result.add(noException);
}
result.setImmutable();
return result;
}
示例2: visitLocal
/** {@inheritDoc} */
public void visitLocal(int opcode, int offset, int length,
int idx, Type type, int value) {
if (opcode == ByteOps.RET) {
visitCommon(offset, length, false);
targetLists[offset] = IntList.EMPTY;
} else {
visitCommon(offset, length, true);
}
}
示例3: convertBasicBlock
/**
* Converts a single basic block to rop form.
*
* @param block SSA block to process
* @return {@code non-null;} ROP block
*/
private BasicBlock convertBasicBlock(SsaBasicBlock block) {
IntList successorList = block.getRopLabelSuccessorList();
int primarySuccessorLabel = block.getPrimarySuccessorRopLabel();
// Filter out any reference to the SSA form's exit block.
// Exit block may be null.
SsaBasicBlock exitBlock = ssaMeth.getExitBlock();
int exitRopLabel = (exitBlock == null) ? -1 : exitBlock.getRopLabel();
if (successorList.contains(exitRopLabel)) {
if (successorList.size() > 1) {
throw new RuntimeException(
"Exit predecessor must have no other successors"
+ Hex.u2(block.getRopLabel()));
} else {
successorList = IntList.EMPTY;
primarySuccessorLabel = -1;
verifyValidExitPredecessor(block);
}
}
successorList.setImmutable();
BasicBlock result = new BasicBlock(
block.getRopLabel(), convertInsns(block.getInsns()),
successorList,
primarySuccessorLabel);
return result;
}
示例4: visitNoArgs
/** {@inheritDoc} */
public void visitNoArgs(int opcode, int offset, int length, Type type) {
switch (opcode) {
case ByteOps.IRETURN:
case ByteOps.RETURN: {
visitCommon(offset, length, false);
targetLists[offset] = IntList.EMPTY;
break;
}
case ByteOps.ATHROW: {
visitCommon(offset, length, false);
visitThrowing(offset, length, false);
break;
}
case ByteOps.IALOAD:
case ByteOps.LALOAD:
case ByteOps.FALOAD:
case ByteOps.DALOAD:
case ByteOps.AALOAD:
case ByteOps.BALOAD:
case ByteOps.CALOAD:
case ByteOps.SALOAD:
case ByteOps.IASTORE:
case ByteOps.LASTORE:
case ByteOps.FASTORE:
case ByteOps.DASTORE:
case ByteOps.AASTORE:
case ByteOps.BASTORE:
case ByteOps.CASTORE:
case ByteOps.SASTORE:
case ByteOps.ARRAYLENGTH:
case ByteOps.MONITORENTER:
case ByteOps.MONITOREXIT: {
/*
* These instructions can all throw, so they have to end
* the block they appear in (since throws are branches).
*/
visitCommon(offset, length, true);
visitThrowing(offset, length, true);
break;
}
case ByteOps.IDIV:
case ByteOps.IREM: {
/*
* The int and long versions of division and remainder may
* throw, but not the other types.
*/
visitCommon(offset, length, true);
if ((type == Type.INT) || (type == Type.LONG)) {
visitThrowing(offset, length, true);
}
break;
}
default: {
visitCommon(offset, length, true);
break;
}
}
}
示例5: addSynchExceptionHandlerBlock
/**
* Constructs and adds, if necessary, the catch-all exception handler
* block to deal with unwinding the lock taken on entry to a synchronized
* method.
*/
private void addSynchExceptionHandlerBlock() {
if (!synchNeedsExceptionHandler) {
/*
* The method being converted either isn't synchronized or
* can't possibly throw exceptions in its main body, so
* there's no need for a synchronized method exception
* handler.
*/
return;
}
SourcePosition pos = method.makeSourcePosistion(0);
RegisterSpec exReg = RegisterSpec.make(0, Type.THROWABLE);
BasicBlock bb;
Insn insn;
InsnList insns = new InsnList(2);
insn = new PlainInsn(Rops.opMoveException(Type.THROWABLE), pos,
exReg, RegisterSpecList.EMPTY);
insns.set(0, insn);
insn = new ThrowingInsn(Rops.MONITOR_EXIT, pos,
RegisterSpecList.make(getSynchReg()),
StdTypeList.EMPTY);
insns.set(1, insn);
insns.setImmutable();
int label2 = getSpecialLabel(SYNCH_CATCH_2);
bb = new BasicBlock(getSpecialLabel(SYNCH_CATCH_1), insns,
IntList.makeImmutable(label2), label2);
addBlock(bb, IntList.EMPTY);
insns = new InsnList(1);
insn = new ThrowingInsn(Rops.THROW, pos,
RegisterSpecList.make(exReg),
StdTypeList.EMPTY);
insns.set(0, insn);
insns.setImmutable();
bb = new BasicBlock(label2, insns, IntList.EMPTY, -1);
addBlock(bb, IntList.EMPTY);
}
示例6: Frame
/**
* Constructs an instance.
*
* @param locals {@code non-null;} the locals array to use
* @param stack {@code non-null;} the execution stack to use
*/
private Frame(LocalsArray locals, ExecutionStack stack) {
this(locals, stack, IntList.EMPTY);
}