private static BytecodeExpression generateRequireNotNull(Variable variable) { return invokeStatic(Objects.class, "requireNonNull", Object.class, variable.cast(Object.class), constantString(variable.getName() + " is null")) .cast(variable.getType()); }
if (!nullable.get(i)) { Variable variableDefinition = parameterVariables.get(i); loopBody = new IfStatement("if(!%s.isNull(position))", variableDefinition.getName()) .condition(new BytecodeBlock() .getVariable(variableDefinition) loopBody = new IfStatement("if(testMask(%s, position))", masksBlock.getName()) .condition(new BytecodeBlock() .getVariable(masksBlock)
body.comment("%s = page.getBlock(inputChannels.get(%d));", parameterVariables.get(i).getName(), i) .append(page) .append(thisVariable.getField(inputChannelsField))
@Override protected String formatOneLine() { return variable.getName() + " = " + value; } }
@Override public Void visitStoreVariable(BytecodeNode parent, StoreVariableInstruction storeVariableInstruction) { Variable variable = storeVariableInstruction.getVariable(); printLine("store %s)", variable.getName()); return null; }
@Override public Void visitLoadVariable(BytecodeNode parent, LoadVariableInstruction loadVariableInstruction) { Variable variable = loadVariableInstruction.getVariable(); printLine("load %s", variable.getName()); return null; }
public void enterScope(Scope scope) { requireNonNull(scope, "scope is null"); checkArgument(!allEnteredScopes.contains(scope), "scope has already been entered"); allEnteredScopes.add(scope); ScopeContext scopeContext = new ScopeContext(scope); scopes.addLast(scopeContext); for (Variable variable : scopeContext.getVariables()) { checkArgument(!"this".equals(variable.getName()) || nextSlot == 0, "The 'this' variable must be in slot 0"); variableSlots.put(variable, nextSlot); nextSlot += Type.getType(variable.getType().getType()).getSize(); } scopeContext.getStartLabel().accept(methodVisitor, this); }
@Override public Void visitIncrementVariable(BytecodeNode parent, IncrementVariableInstruction incrementVariableInstruction) { Variable variable = incrementVariableInstruction.getVariable(); byte increment = incrementVariableInstruction.getIncrement(); printLine("increment %s %s", variable.getName(), increment); return null; }
private static BytecodeExpression generateRequireNotNull(Variable variable) { return invokeStatic(Objects.class, "requireNonNull", Object.class, variable.cast(Object.class), constantString(variable.getName() + " is null")) .cast(variable.getType()); }
private static BytecodeExpression generateRequireNotNull(Variable variable) { return invokeStatic(Objects.class, "requireNonNull", Object.class, variable.cast(Object.class), constantString(variable.getName() + " is null")) .cast(variable.getType()); }
@Override public void accept(MethodVisitor visitor, MethodGenerationContext generationContext) { visitor.visitLocalVariable(variable.getName(), variable.getType().getType(), variable.getType().getGenericSignature(), start.getLabel(), end.getLabel(), generationContext.getVariableSlot(variable)); }
if (!nullable.get(i)) { Variable variableDefinition = parameterVariables.get(i); loopBody = new IfStatement("if(!%s.isNull(position))", variableDefinition.getName()) .condition(new BytecodeBlock() .getVariable(variableDefinition) loopBody = new IfStatement("if(testMask(%s, position))", masksBlock.getName()) .condition(new BytecodeBlock() .getVariable(masksBlock)
if (!nullable.get(i)) { Variable variableDefinition = parameterVariables.get(i); loopBody = new IfStatement("if(!%s.isNull(position))", variableDefinition.getName()) .condition(new BytecodeBlock() .getVariable(variableDefinition) loopBody = new IfStatement("if(testMask(%s, position))", masksBlock.getName()) .condition(new BytecodeBlock() .getVariable(masksBlock)
body.comment("%s = page.getBlock(inputChannels.get(%d));", parameterVariables.get(i).getName(), i) .append(page) .append(thisVariable.getField(inputChannelsField))
body.comment("%s = page.getBlock(inputChannels.get(%d));", parameterVariables.get(i).getName(), i) .append(page) .append(thisVariable.getField(inputChannelsField))