Search in sources :

Example 1 with JumpInstruction

use of com.facebook.presto.bytecode.instruction.JumpInstruction in project presto by prestodb.

the class ComparisonBytecodeExpression method getBytecode.

@Override
public BytecodeNode getBytecode(MethodGenerationContext generationContext) {
    BytecodeBlock block = new BytecodeBlock().append(left).append(right);
    if (comparisonInstruction != null) {
        block.append(comparisonInstruction);
    }
    LabelNode noMatch = new LabelNode("no_match");
    LabelNode end = new LabelNode("end");
    return block.append(new JumpInstruction(noMatchJumpInstruction, noMatch)).push(true).gotoLabel(end).append(noMatch).push(false).append(end);
}
Also used : LabelNode(com.facebook.presto.bytecode.instruction.LabelNode) BytecodeBlock(com.facebook.presto.bytecode.BytecodeBlock) JumpInstruction(com.facebook.presto.bytecode.instruction.JumpInstruction)

Aggregations

BytecodeBlock (com.facebook.presto.bytecode.BytecodeBlock)1 JumpInstruction (com.facebook.presto.bytecode.instruction.JumpInstruction)1 LabelNode (com.facebook.presto.bytecode.instruction.LabelNode)1