public void addLocationsOfProgram(ProgramReader program) { for (int i = 0; i < program.basicBlockCount(); ++i) { BasicBlockReader block = program.basicBlockAt(i); block.readAllInstructions(this); } }
sb.append('\n'); for (int i = 0; i < program.basicBlockCount(); ++i) { BasicBlockReader block = program.basicBlockAt(i); sb.append(prefix).append("$").append(i).append("\n");
private boolean hasMonitor(MethodReader method) { if (method.hasModifier(ElementModifier.SYNCHRONIZED)) { return true; } ProgramReader program = method.getProgram(); AsyncInstructionReader insnReader = new AsyncInstructionReader(); for (int i = 0; i < program.basicBlockCount(); ++i) { program.basicBlockAt(i).readAllInstructions(insnReader); if (insnReader.async) { return true; } } return false; }
for (int i = 0; i < program.basicBlockCount(); ++i) { outgoings.add(new ArrayList<>()); for (int i = 0; i < program.basicBlockCount(); ++i) { BasicBlockReader block = program.basicBlockAt(i); for (PhiReader phi : block.readPhis()) {
|| invokedMethod.getProgram().basicBlockCount() == 0) { instructionsToSkip.add(insn); continue;
for (int i = 0; i < program.basicBlockCount(); ++i) { BasicBlockReader block = program.basicBlockAt(i); block.readAllInstructions(reader);
public static Program copy(ProgramReader program) { Program copy = new Program(); for (int i = 0; i < program.variableCount(); ++i) { Variable var = copy.createVariable(); var.setDebugName(program.variableAt(i).getDebugName()); var.setLabel(program.variableAt(i).getLabel()); } for (int i = 0; i < program.basicBlockCount(); ++i) { copy.createBasicBlock(); } for (int i = 0; i < program.basicBlockCount(); ++i) { BasicBlockReader block = program.basicBlockAt(i); BasicBlock blockCopy = copy.basicBlockAt(i); copyBasicBlock(block, blockCopy); } return copy; }
for (MethodReader method : iface.getMethods()) { if (method.hasModifier(ElementModifier.STATIC) || (method.getProgram() != null && method.getProgram().basicBlockCount() > 0)) { continue;
for (int i = 0; i < template.basicBlockCount(); ++i) { program.createBasicBlock(); .limit(template.basicBlockCount()) .collect(Collectors.toList()); List<List<VariableReader>> outgoingVars = Stream.<List<VariableReader>>generate(ArrayList::new) .limit(template.basicBlockCount()) .collect(Collectors.toList()); for (int i = 0; i < template.basicBlockCount(); ++i) { BasicBlockReader templateBlock = template.basicBlockAt(i); blockIndex = i == 0 ? startBlock : substitutor.blockOffset + i; for (int i = 0; i < template.basicBlockCount(); ++i) { BasicBlockReader templateBlock = template.basicBlockAt(i); blockIndex = i == 0 ? startBlock : substitutor.blockOffset + i; for (int i = 0; i < template.basicBlockCount(); ++i) { BasicBlock block = program.basicBlockAt(i == 0 ? startBlock : substitutor.blockOffset + i); for (Phi phi : block.getPhis()) { blockIndex = substitutor.blockOffset + template.basicBlockCount();
public static Set<String> extractUsedResources(TeaVM vm) { Set<String> resources = new LinkedHashSet<>(); ClassReaderSource classSource = vm.getDependencyClassSource(); InstructionLocationReader reader = new InstructionLocationReader(resources); for (MethodReference methodRef : vm.getMethods()) { ClassReader cls = classSource.get(methodRef.getClassName()); if (cls == null) { continue; } MethodReader method = cls.getMethod(methodRef.getDescriptor()); if (method == null) { continue; } ProgramReader program = method.getProgram(); if (program == null) { continue; } for (int i = 0; i < program.basicBlockCount(); ++i) { program.basicBlockAt(i).readAllInstructions(reader); } } return resources; } }
if (method.getProgram() != null && method.getProgram().basicBlockCount() > 0) { MethodReader overridden = getOverriddenMethod(method); if (overridden != null) { method.getReference(), overridden.getReference()); if (method.getProgram() != null && method.getProgram().basicBlockCount() > 0) { invoke.setMethod(new MethodReference(method.getOwnerName(), method.getName() + "$static", getStaticSignature(method.getReference())));
for (int i = 0; i < program.basicBlockCount(); ++i) { BasicBlockReader block = program.basicBlockAt(i); for (PhiReader phi : block.readPhis()) {
for (ReflectMethod method : type.getMethods()) { ReflectMethodImpl methodImpl = (ReflectMethodImpl) method; if (methodImpl.method.getProgram() != null && methodImpl.method.getProgram().basicBlockCount() > 0 || methodImpl.method.hasModifier(ElementModifier.NATIVE) || !methodImpl.method.hasModifier(ElementModifier.ABSTRACT)) {
for (int i = 0; i < program.basicBlockCount(); ++i) { BasicBlockReader block = program.basicBlockAt(i);
public void addLocationsOfProgram(ProgramReader program) { for (int i = 0; i < program.basicBlockCount(); ++i) { BasicBlockReader block = program.basicBlockAt(i); block.readAllInstructions(this); } }
private boolean hasMonitor(MethodReader method) { if (method.hasModifier(ElementModifier.SYNCHRONIZED)) { return true; } ProgramReader program = method.getProgram(); AsyncInstructionReader insnReader = new AsyncInstructionReader(); for (int i = 0; i < program.basicBlockCount(); ++i) { program.basicBlockAt(i).readAllInstructions(insnReader); if (insnReader.async) { return true; } } return false; }
for (MethodReader method : iface.getMethods()) { if (method.hasModifier(ElementModifier.STATIC) || (method.getProgram() != null && method.getProgram().basicBlockCount() > 0)) { continue;
public static Program copy(ProgramReader program) { Program copy = new Program(); for (int i = 0; i < program.variableCount(); ++i) { Variable var = copy.createVariable(); var.setDebugName(program.variableAt(i).getDebugName()); var.setLabel(program.variableAt(i).getLabel()); } for (int i = 0; i < program.basicBlockCount(); ++i) { copy.createBasicBlock(); } for (int i = 0; i < program.basicBlockCount(); ++i) { BasicBlockReader block = program.basicBlockAt(i); BasicBlock blockCopy = copy.basicBlockAt(i); copyBasicBlock(block, blockCopy); } return copy; }
public Collection<String> getUsedResources() { if (vm == null) { return Collections.emptyList(); } Set<String> resources = new HashSet<>(); ClassReaderSource classSource = vm.getDependencyClassSource(); InstructionLocationReader reader = new InstructionLocationReader(resources); for (MethodReference methodRef : vm.getMethods()) { ClassReader cls = classSource.get(methodRef.getClassName()); if (cls == null) { continue; } MethodReader method = cls.getMethod(methodRef.getDescriptor()); if (method == null) { continue; } ProgramReader program = method.getProgram(); if (program == null) { continue; } for (int i = 0; i < program.basicBlockCount(); ++i) { program.basicBlockAt(i).readAllInstructions(reader); } } return resources; }
if (method.getProgram() != null && method.getProgram().basicBlockCount() > 0) { MethodReader overridden = getOverriddenMethod(method); if (overridden != null) { method.getReference(), overridden.getReference()); if (method.getProgram() != null && method.getProgram().basicBlockCount() > 0) { invoke.setMethod(new MethodReference(method.getOwnerName(), method.getName() + "$static", getStaticSignature(method.getReference())));