本文整理了Java中com.android.dx.rop.code.BasicBlock.<init>()
方法的一些代码示例,展示了BasicBlock.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。BasicBlock.<init>()
方法的具体详情如下:
包路径:com.android.dx.rop.code.BasicBlock
类名称:BasicBlock
方法名:<init>
[英]Constructs an instance. The predecessor set is set to null.
[中]构造一个实例。前置集设置为空。
代码示例来源:origin: linkedin/dexmaker
BasicBlock toBasicBlock() {
InsnList result = new InsnList(instructions.size());
for (int i = 0; i < instructions.size(); i++) {
result.set(i, instructions.get(i));
}
result.setImmutable();
int primarySuccessorIndex = -1;
IntList successors = new IntList();
for (Label catchLabel : catchLabels) {
successors.add(catchLabel.id);
}
if (primarySuccessor != null) {
primarySuccessorIndex = primarySuccessor.id;
successors.add(primarySuccessorIndex);
}
if (alternateSuccessor != null) {
successors.add(alternateSuccessor.id);
}
successors.setImmutable();
return new BasicBlock(id, result, successors, primarySuccessorIndex);
}
}
代码示例来源:origin: com.jakewharton.android.repackaged/dalvik-dx
/**
* Returns an instance that is identical to this one, except that
* the registers in each instruction are offset by the given
* amount.
*
* @param delta the amount to offset register numbers by
* @return {@code non-null;} an appropriately-constructed instance
*/
public BasicBlock withRegisterOffset(int delta) {
return new BasicBlock(label, insns.withRegisterOffset(delta),
successors, primarySuccessor);
}
代码示例来源:origin: gdpancheng/LoonAndroid3
/**
* Returns an instance that is identical to this one, except that
* the registers in each instruction are offset by the given
* amount.
*
* @param delta the amount to offset register numbers by
* @return {@code non-null;} an appropriately-constructed instance
*/
public BasicBlock withRegisterOffset(int delta) {
return new BasicBlock(label, insns.withRegisterOffset(delta),
successors, primarySuccessor);
}
代码示例来源:origin: nikita36078/J2ME-Loader
/**
* Returns an instance that is identical to this one, except that
* the registers in each instruction are offset by the given
* amount.
*
* @param delta the amount to offset register numbers by
* @return {@code non-null;} an appropriately-constructed instance
*/
public BasicBlock withRegisterOffset(int delta) {
return new BasicBlock(label, insns.withRegisterOffset(delta),
successors, primarySuccessor);
}
代码示例来源:origin: dragome/dragome-sdk
/**
* Returns an instance that is identical to this one, except that
* the registers in each instruction are offset by the given
* amount.
*
* @param delta the amount to offset register numbers by
* @return {@code non-null;} an appropriately-constructed instance
*/
public BasicBlock withRegisterOffset(int delta) {
return new BasicBlock(label, insns.withRegisterOffset(delta),
successors, primarySuccessor);
}
代码示例来源:origin: com.google.android.tools/dx
/**
* Returns an instance that is identical to this one, except that
* the registers in each instruction are offset by the given
* amount.
*
* @param delta the amount to offset register numbers by
* @return {@code non-null;} an appropriately-constructed instance
*/
public BasicBlock withRegisterOffset(int delta) {
return new BasicBlock(label, insns.withRegisterOffset(delta),
successors, primarySuccessor);
}
代码示例来源:origin: com.google.dexmaker/dexmaker-dx
/**
* Returns an instance that is identical to this one, except that
* the registers in each instruction are offset by the given
* amount.
*
* @param delta the amount to offset register numbers by
* @return {@code non-null;} an appropriately-constructed instance
*/
public BasicBlock withRegisterOffset(int delta) {
return new BasicBlock(label, insns.withRegisterOffset(delta),
successors, primarySuccessor);
}
代码示例来源:origin: com.android.tools.build/builder
/**
* Returns an instance that is identical to this one, except that
* the registers in each instruction are offset by the given
* amount.
*
* @param delta the amount to offset register numbers by
* @return {@code non-null;} an appropriately-constructed instance
*/
public BasicBlock withRegisterOffset(int delta) {
return new BasicBlock(label, insns.withRegisterOffset(delta),
successors, primarySuccessor);
}
代码示例来源:origin: com.android/dx
/**
* Returns an instance that is identical to this one, except that
* the registers in each instruction are offset by the given
* amount.
*
* @param delta the amount to offset register numbers by
* @return {@code non-null;} an appropriately-constructed instance
*/
public BasicBlock withRegisterOffset(int delta) {
return new BasicBlock(label, insns.withRegisterOffset(delta),
successors, primarySuccessor);
}
代码示例来源:origin: com.linkedin.dexmaker/dexmaker
BasicBlock toBasicBlock() {
InsnList result = new InsnList(instructions.size());
for (int i = 0; i < instructions.size(); i++) {
result.set(i, instructions.get(i));
}
result.setImmutable();
int primarySuccessorIndex = -1;
IntList successors = new IntList();
for (Label catchLabel : catchLabels) {
successors.add(catchLabel.id);
}
if (primarySuccessor != null) {
primarySuccessorIndex = primarySuccessor.id;
successors.add(primarySuccessorIndex);
}
if (alternateSuccessor != null) {
successors.add(alternateSuccessor.id);
}
successors.setImmutable();
return new BasicBlock(id, result, successors, primarySuccessorIndex);
}
}
代码示例来源:origin: com.google.android.tools/dx
BasicBlock toBasicBlock() {
InsnList result = new InsnList(instructions.size());
for (int i = 0; i < instructions.size(); i++) {
result.set(i, instructions.get(i));
}
result.setImmutable();
int primarySuccessorIndex = -1;
IntList successors = new IntList();
for (Label catchLabel : catchLabels) {
successors.add(catchLabel.id);
}
if (primarySuccessor != null) {
primarySuccessorIndex = primarySuccessor.id;
successors.add(primarySuccessorIndex);
}
if (alternateSuccessor != null) {
successors.add(alternateSuccessor.id);
}
successors.setImmutable();
return new BasicBlock(id, result, successors, primarySuccessorIndex);
}
}
代码示例来源:origin: gdpancheng/LoonAndroid3
BasicBlock toBasicBlock() {
InsnList result = new InsnList(instructions.size());
for (int i = 0; i < instructions.size(); i++) {
result.set(i, instructions.get(i));
}
result.setImmutable();
int primarySuccessorIndex = -1;
IntList successors = new IntList();
for (Label catchLabel : catchLabels) {
successors.add(catchLabel.id);
}
if (primarySuccessor != null) {
primarySuccessorIndex = primarySuccessor.id;
successors.add(primarySuccessorIndex);
}
if (alternateSuccessor != null) {
successors.add(alternateSuccessor.id);
}
successors.setImmutable();
return new BasicBlock(id, result, successors, primarySuccessorIndex);
}
}
代码示例来源:origin: com.android/dx
/**
* Replaces one of a block's successors with a different label. Constructs
* an updated BasicBlock instance and places it in {@code newBlocks}.
*
* @param block block to replace
* @param oldLabel label of successor to replace
* @param newLabel label of new successor
*/
private void replaceSucc(BasicBlock block, int oldLabel, int newLabel) {
IntList newSuccessors = block.getSuccessors().mutableCopy();
int newPrimarySuccessor;
newSuccessors.set(newSuccessors.indexOf(oldLabel), newLabel);
newPrimarySuccessor = block.getPrimarySuccessor();
if (newPrimarySuccessor == oldLabel) {
newPrimarySuccessor = newLabel;
}
newSuccessors.setImmutable();
BasicBlock newBB = new BasicBlock(block.getLabel(),
block.getInsns(), newSuccessors, newPrimarySuccessor);
newBlocks.set(newBlocks.indexOfLabel(block.getLabel()), newBB);
}
}
代码示例来源:origin: nikita36078/J2ME-Loader
/**
* Replaces one of a block's successors with a different label. Constructs
* an updated BasicBlock instance and places it in {@code newBlocks}.
*
* @param block block to replace
* @param oldLabel label of successor to replace
* @param newLabel label of new successor
*/
private void replaceSucc(BasicBlock block, int oldLabel, int newLabel) {
IntList newSuccessors = block.getSuccessors().mutableCopy();
int newPrimarySuccessor;
newSuccessors.set(newSuccessors.indexOf(oldLabel), newLabel);
newPrimarySuccessor = block.getPrimarySuccessor();
if (newPrimarySuccessor == oldLabel) {
newPrimarySuccessor = newLabel;
}
newSuccessors.setImmutable();
BasicBlock newBB = new BasicBlock(block.getLabel(),
block.getInsns(), newSuccessors, newPrimarySuccessor);
newBlocks.set(newBlocks.indexOfLabel(block.getLabel()), newBB);
}
}
代码示例来源:origin: dragome/dragome-sdk
/**
* Replaces one of a block's successors with a different label. Constructs
* an updated BasicBlock instance and places it in {@code newBlocks}.
*
* @param block block to replace
* @param oldLabel label of successor to replace
* @param newLabel label of new successor
*/
private void replaceSucc(BasicBlock block, int oldLabel, int newLabel) {
IntList newSuccessors = block.getSuccessors().mutableCopy();
int newPrimarySuccessor;
newSuccessors.set(newSuccessors.indexOf(oldLabel), newLabel);
newPrimarySuccessor = block.getPrimarySuccessor();
if (newPrimarySuccessor == oldLabel) {
newPrimarySuccessor = newLabel;
}
newSuccessors.setImmutable();
BasicBlock newBB = new BasicBlock(block.getLabel(),
block.getInsns(), newSuccessors, newPrimarySuccessor);
newBlocks.set(newBlocks.indexOfLabel(block.getLabel()), newBB);
}
}
代码示例来源:origin: com.jakewharton.android.repackaged/dalvik-dx
/**
* Replaces one of a block's successors with a different label. Constructs
* an updated BasicBlock instance and places it in {@code newBlocks}.
*
* @param block block to replace
* @param oldLabel label of successor to replace
* @param newLabel label of new successor
*/
private void replaceSucc(BasicBlock block, int oldLabel, int newLabel) {
IntList newSuccessors = block.getSuccessors().mutableCopy();
int newPrimarySuccessor;
newSuccessors.set(newSuccessors.indexOf(oldLabel), newLabel);
newPrimarySuccessor = block.getPrimarySuccessor();
if (newPrimarySuccessor == oldLabel) {
newPrimarySuccessor = newLabel;
}
newSuccessors.setImmutable();
BasicBlock newBB = new BasicBlock(block.getLabel(),
block.getInsns(), newSuccessors, newPrimarySuccessor);
newBlocks.set(newBlocks.indexOfLabel(block.getLabel()), newBB);
}
}
代码示例来源:origin: com.google.android.tools/dx
/**
* Replaces one of a block's successors with a different label. Constructs
* an updated BasicBlock instance and places it in {@code newBlocks}.
*
* @param block block to replace
* @param oldLabel label of successor to replace
* @param newLabel label of new successor
*/
private void replaceSucc(BasicBlock block, int oldLabel, int newLabel) {
IntList newSuccessors = block.getSuccessors().mutableCopy();
int newPrimarySuccessor;
newSuccessors.set(newSuccessors.indexOf(oldLabel), newLabel);
newPrimarySuccessor = block.getPrimarySuccessor();
if (newPrimarySuccessor == oldLabel) {
newPrimarySuccessor = newLabel;
}
newSuccessors.setImmutable();
BasicBlock newBB = new BasicBlock(block.getLabel(),
block.getInsns(), newSuccessors, newPrimarySuccessor);
newBlocks.set(newBlocks.indexOfLabel(block.getLabel()), newBB);
}
}
代码示例来源:origin: com.android.tools.build/builder
/**
* Replaces one of a block's successors with a different label. Constructs
* an updated BasicBlock instance and places it in {@code newBlocks}.
*
* @param block block to replace
* @param oldLabel label of successor to replace
* @param newLabel label of new successor
*/
private void replaceSucc(BasicBlock block, int oldLabel, int newLabel) {
IntList newSuccessors = block.getSuccessors().mutableCopy();
int newPrimarySuccessor;
newSuccessors.set(newSuccessors.indexOf(oldLabel), newLabel);
newPrimarySuccessor = block.getPrimarySuccessor();
if (newPrimarySuccessor == oldLabel) {
newPrimarySuccessor = newLabel;
}
newSuccessors.setImmutable();
BasicBlock newBB = new BasicBlock(block.getLabel(),
block.getInsns(), newSuccessors, newPrimarySuccessor);
newBlocks.set(newBlocks.indexOfLabel(block.getLabel()), newBB);
}
}
代码示例来源:origin: com.google.dexmaker/dexmaker-dx
/**
* Replaces one of a block's successors with a different label. Constructs
* an updated BasicBlock instance and places it in {@code newBlocks}.
*
* @param block block to replace
* @param oldLabel label of successor to replace
* @param newLabel label of new successor
*/
private void replaceSucc(BasicBlock block, int oldLabel, int newLabel) {
IntList newSuccessors = block.getSuccessors().mutableCopy();
int newPrimarySuccessor;
newSuccessors.set(newSuccessors.indexOf(oldLabel), newLabel);
newPrimarySuccessor = block.getPrimarySuccessor();
if (newPrimarySuccessor == oldLabel) {
newPrimarySuccessor = newLabel;
}
newSuccessors.setImmutable();
BasicBlock newBB = new BasicBlock(block.getLabel(),
block.getInsns(), newSuccessors, newPrimarySuccessor);
newBlocks.set(newBlocks.indexOfLabel(block.getLabel()), newBB);
}
}
代码示例来源:origin: gdpancheng/LoonAndroid3
/**
* Replaces one of a block's successors with a different label. Constructs
* an updated BasicBlock instance and places it in {@code newBlocks}.
*
* @param block block to replace
* @param oldLabel label of successor to replace
* @param newLabel label of new successor
*/
private void replaceSucc(BasicBlock block, int oldLabel, int newLabel) {
IntList newSuccessors = block.getSuccessors().mutableCopy();
int newPrimarySuccessor;
newSuccessors.set(newSuccessors.indexOf(oldLabel), newLabel);
newPrimarySuccessor = block.getPrimarySuccessor();
if (newPrimarySuccessor == oldLabel) {
newPrimarySuccessor = newLabel;
}
newSuccessors.setImmutable();
BasicBlock newBB = new BasicBlock(block.getLabel(),
block.getInsns(), newSuccessors, newPrimarySuccessor);
newBlocks.set(newBlocks.indexOfLabel(block.getLabel()), newBB);
}
}
内容来源于网络,如有侵权,请联系作者删除!