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 (int i = 0; i < program.basicBlockCount(); ++i) { BasicBlockReader block = program.basicBlockAt(i); block.readAllInstructions(reader); for (PhiReader phi : block.readPhis()) { Set<Integer> inputs = phi.readIncomings().stream()
@Override public void methodReached(DependencyAgent agent, MethodDependency method) { if (method.getMethod() == null || method.getMethod().getProgram() == null) { return; } ProgramReader program = method.getMethod().getProgram(); FunctionGetFinder finder = new FunctionGetFinder(program.variableCount()); for (BasicBlockReader block : program.getBasicBlocks()) { block.readAllInstructions(finder); } if (!finder.invocations.isEmpty()) { processInvocations(agent, method.getMethod(), finder); } }
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; } }
templateBlock.readAllInstructions(substitutor);
@Override protected void processMethod(MethodDependency methodDep) { MethodReader method = methodDep.getMethod(); ProgramReader program = method.getProgram(); if (program != null) { FastInstructionAnalyzer instructionAnalyzer = new FastInstructionAnalyzer(this); instructionAnalyzer.setCaller(method.getReference()); for (BasicBlockReader block : program.getBasicBlocks()) { block.readAllInstructions(instructionAnalyzer); for (TryCatchBlockReader tryCatch : block.readTryCatchBlocks()) { if (tryCatch.getExceptionType() != null) { linkClass(tryCatch.getExceptionType()); } } } methodDep.variableNodes = new DependencyNode[program.variableCount()]; for (int i = 0; i < methodDep.variableNodes.length; ++i) { methodDep.variableNodes[i] = instancesNode; } } if (method.hasModifier(ElementModifier.SYNCHRONIZED)) { processAsyncMethod(methodDep); } }
BasicBlockReader block = program.basicBlockAt(i); currentExceptionConsumer = createExceptionConsumer(dep, block); block.readAllInstructions(reader);
block.readAllInstructions(this);
block.readAllInstructions(reader); for (PhiReader phi : block.readPhis()) { for (IncomingReader incoming : phi.readIncomings()) {
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 (int i = 0; i < program.basicBlockCount(); ++i) { BasicBlockReader block = program.basicBlockAt(i); block.readAllInstructions(reader); for (PhiReader phi : block.readPhis()) { Set<Integer> inputs = phi.readIncomings().stream()
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; }
templateBlock.readAllInstructions(substitutor);
BasicBlockReader block = program.basicBlockAt(i); currentExceptionConsumer = createExceptionConsumer(dep, block); block.readAllInstructions(reader);
block.readAllInstructions(this);
block.readAllInstructions(reader); for (PhiReader phi : block.readPhis()) { for (IncomingReader incoming : phi.readIncomings()) {