List of usage examples for org.objectweb.asm.commons GeneratorAdapter XOR
int XOR
To view the source code for org.objectweb.asm.commons GeneratorAdapter XOR.
Click Source Link
From source file:org.elasticsearch.painless.MethodWriter.java
License:Apache License
/** Writes a static binary instruction */ public void writeBinaryInstruction(Location location, Type type, Operation operation) { final Sort sort = type.sort; if ((sort == Sort.FLOAT || sort == Sort.DOUBLE) && (operation == Operation.LSH || operation == Operation.USH || operation == Operation.RSH || operation == Operation.BWAND || operation == Operation.XOR || operation == Operation.BWOR)) { throw location.createError(new IllegalStateException("Illegal tree structure.")); }/*from w w w . j av a 2 s. co m*/ switch (operation) { case MUL: math(GeneratorAdapter.MUL, type.type); break; case DIV: math(GeneratorAdapter.DIV, type.type); break; case REM: math(GeneratorAdapter.REM, type.type); break; case ADD: math(GeneratorAdapter.ADD, type.type); break; case SUB: math(GeneratorAdapter.SUB, type.type); break; case LSH: math(GeneratorAdapter.SHL, type.type); break; case USH: math(GeneratorAdapter.USHR, type.type); break; case RSH: math(GeneratorAdapter.SHR, type.type); break; case BWAND: math(GeneratorAdapter.AND, type.type); break; case XOR: math(GeneratorAdapter.XOR, type.type); break; case BWOR: math(GeneratorAdapter.OR, type.type); break; default: throw location.createError(new IllegalStateException("Illegal tree structure.")); } }
From source file:org.elasticsearch.painless.Writer.java
License:Apache License
@Override public Void visitUnary(final UnaryContext ctx) { final Metadata.ExpressionMetadata unaryemd = metadata.getExpressionMetadata(ctx); final Object postConst = unaryemd.postConst; final Object preConst = unaryemd.preConst; final Branch branch = getBranch(ctx); if (postConst != null) { if (ctx.BOOLNOT() != null) { if (branch == null) { writeConstant(ctx, postConst); } else { if ((boolean) postConst && branch.tru != null) { execute.goTo(branch.tru); } else if (!(boolean) postConst && branch.fals != null) { execute.goTo(branch.fals); }//ww w . ja va 2 s. c o m } } else { writeConstant(ctx, postConst); checkWriteBranch(ctx); } } else if (preConst != null) { if (branch == null) { writeConstant(ctx, preConst); checkWriteCast(unaryemd); } else { throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state."); } } else { final ExpressionContext exprctx = ctx.expression(); if (ctx.BOOLNOT() != null) { final Branch local = markBranch(ctx, exprctx); if (branch == null) { local.fals = new Label(); final Label aend = new Label(); visit(exprctx); execute.push(false); execute.goTo(aend); execute.mark(local.fals); execute.push(true); execute.mark(aend); checkWriteCast(unaryemd); } else { local.tru = branch.fals; local.fals = branch.tru; visit(exprctx); } } else { final org.objectweb.asm.Type type = unaryemd.from.type; final Sort sort = unaryemd.from.sort; visit(exprctx); if (ctx.BWNOT() != null) { if (sort == Sort.DEF) { execute.invokeStatic(definition.defobjType.type, DEF_NOT_CALL); } else { if (sort == Sort.INT) { writeConstant(ctx, -1); } else if (sort == Sort.LONG) { writeConstant(ctx, -1L); } else { throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state."); } execute.math(GeneratorAdapter.XOR, type); } } else if (ctx.SUB() != null) { if (sort == Sort.DEF) { execute.invokeStatic(definition.defobjType.type, DEF_NEG_CALL); } else { if (settings.getNumericOverflow()) { execute.math(GeneratorAdapter.NEG, type); } else { if (sort == Sort.INT) { execute.invokeStatic(definition.mathType.type, NEGATEEXACT_INT); } else if (sort == Sort.LONG) { execute.invokeStatic(definition.mathType.type, NEGATEEXACT_LONG); } else { throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state."); } } } } else if (ctx.ADD() == null) { throw new IllegalStateException(Metadata.error(ctx) + "Unexpected writer state."); } checkWriteCast(unaryemd); checkWriteBranch(ctx); } } return null; }
From source file:org.elasticsearch.painless.Writer.java
License:Apache License
private void writeBinaryInstruction(final ParserRuleContext source, final Type type, final int token) { final Sort sort = type.sort; final boolean exact = !settings.getNumericOverflow() && ((sort == Sort.INT || sort == Sort.LONG) && (token == MUL || token == DIV || token == ADD || token == SUB) || (sort == Sort.FLOAT || sort == Sort.DOUBLE) && (token == MUL || token == DIV || token == REM || token == ADD || token == SUB)); // if its a 64-bit shift, fixup the lastSource argument to truncate to 32-bits // note unlike java, this means we still do binary promotion of shifts, // but it keeps things simple -- this check works because we promote shifts. if (sort == Sort.LONG && (token == LSH || token == USH || token == RSH)) { execute.cast(org.objectweb.asm.Type.LONG_TYPE, org.objectweb.asm.Type.INT_TYPE); }//from ww w . jav a 2 s. c o m if (exact) { switch (sort) { case INT: switch (token) { case MUL: execute.invokeStatic(definition.mathType.type, MULEXACT_INT); break; case DIV: execute.invokeStatic(definition.utilityType.type, DIVWOOVERLOW_INT); break; case ADD: execute.invokeStatic(definition.mathType.type, ADDEXACT_INT); break; case SUB: execute.invokeStatic(definition.mathType.type, SUBEXACT_INT); break; default: throw new IllegalStateException(Metadata.error(source) + "Unexpected writer state."); } break; case LONG: switch (token) { case MUL: execute.invokeStatic(definition.mathType.type, MULEXACT_LONG); break; case DIV: execute.invokeStatic(definition.utilityType.type, DIVWOOVERLOW_LONG); break; case ADD: execute.invokeStatic(definition.mathType.type, ADDEXACT_LONG); break; case SUB: execute.invokeStatic(definition.mathType.type, SUBEXACT_LONG); break; default: throw new IllegalStateException(Metadata.error(source) + "Unexpected writer state."); } break; case FLOAT: switch (token) { case MUL: execute.invokeStatic(definition.utilityType.type, MULWOOVERLOW_FLOAT); break; case DIV: execute.invokeStatic(definition.utilityType.type, DIVWOOVERLOW_FLOAT); break; case REM: execute.invokeStatic(definition.utilityType.type, REMWOOVERLOW_FLOAT); break; case ADD: execute.invokeStatic(definition.utilityType.type, ADDWOOVERLOW_FLOAT); break; case SUB: execute.invokeStatic(definition.utilityType.type, SUBWOOVERLOW_FLOAT); break; default: throw new IllegalStateException(Metadata.error(source) + "Unexpected writer state."); } break; case DOUBLE: switch (token) { case MUL: execute.invokeStatic(definition.utilityType.type, MULWOOVERLOW_DOUBLE); break; case DIV: execute.invokeStatic(definition.utilityType.type, DIVWOOVERLOW_DOUBLE); break; case REM: execute.invokeStatic(definition.utilityType.type, REMWOOVERLOW_DOUBLE); break; case ADD: execute.invokeStatic(definition.utilityType.type, ADDWOOVERLOW_DOUBLE); break; case SUB: execute.invokeStatic(definition.utilityType.type, SUBWOOVERLOW_DOUBLE); break; default: throw new IllegalStateException(Metadata.error(source) + "Unexpected writer state."); } break; default: throw new IllegalStateException(Metadata.error(source) + "Unexpected writer state."); } } else { if ((sort == Sort.FLOAT || sort == Sort.DOUBLE) && (token == LSH || token == USH || token == RSH || token == BWAND || token == BWXOR || token == BWOR)) { throw new IllegalStateException(Metadata.error(source) + "Unexpected writer state."); } if (sort == Sort.DEF) { switch (token) { case MUL: execute.invokeStatic(definition.defobjType.type, DEF_MUL_CALL); break; case DIV: execute.invokeStatic(definition.defobjType.type, DEF_DIV_CALL); break; case REM: execute.invokeStatic(definition.defobjType.type, DEF_REM_CALL); break; case ADD: execute.invokeStatic(definition.defobjType.type, DEF_ADD_CALL); break; case SUB: execute.invokeStatic(definition.defobjType.type, DEF_SUB_CALL); break; case LSH: execute.invokeStatic(definition.defobjType.type, DEF_LSH_CALL); break; case USH: execute.invokeStatic(definition.defobjType.type, DEF_RSH_CALL); break; case RSH: execute.invokeStatic(definition.defobjType.type, DEF_USH_CALL); break; case BWAND: execute.invokeStatic(definition.defobjType.type, DEF_AND_CALL); break; case BWXOR: execute.invokeStatic(definition.defobjType.type, DEF_XOR_CALL); break; case BWOR: execute.invokeStatic(definition.defobjType.type, DEF_OR_CALL); break; default: throw new IllegalStateException(Metadata.error(source) + "Unexpected writer state."); } } else { switch (token) { case MUL: execute.math(GeneratorAdapter.MUL, type.type); break; case DIV: execute.math(GeneratorAdapter.DIV, type.type); break; case REM: execute.math(GeneratorAdapter.REM, type.type); break; case ADD: execute.math(GeneratorAdapter.ADD, type.type); break; case SUB: execute.math(GeneratorAdapter.SUB, type.type); break; case LSH: execute.math(GeneratorAdapter.SHL, type.type); break; case USH: execute.math(GeneratorAdapter.USHR, type.type); break; case RSH: execute.math(GeneratorAdapter.SHR, type.type); break; case BWAND: execute.math(GeneratorAdapter.AND, type.type); break; case BWXOR: execute.math(GeneratorAdapter.XOR, type.type); break; case BWOR: execute.math(GeneratorAdapter.OR, type.type); break; default: throw new IllegalStateException(Metadata.error(source) + "Unexpected writer state."); } } } }
From source file:org.elasticsearch.painless.WriterExpression.java
License:Apache License
void processUnary(final UnaryContext ctx) { final ExpressionMetadata unaryemd = metadata.getExpressionMetadata(ctx); final Object postConst = unaryemd.postConst; final Object preConst = unaryemd.preConst; final Branch branch = utility.getBranch(ctx); if (postConst != null) { if (ctx.BOOLNOT() != null) { if (branch == null) { utility.writeConstant(ctx, postConst); } else { if ((boolean) postConst && branch.tru != null) { execute.goTo(branch.tru); } else if (!(boolean) postConst && branch.fals != null) { execute.goTo(branch.fals); }/*from w ww . ja v a 2s .c o m*/ } } else { utility.writeConstant(ctx, postConst); utility.checkWriteBranch(ctx); } } else if (preConst != null) { if (branch == null) { utility.writeConstant(ctx, preConst); caster.checkWriteCast(unaryemd); } else { throw new IllegalStateException(WriterUtility.error(ctx) + "Unexpected state."); } } else { final ExpressionContext exprctx = ctx.expression(); if (ctx.BOOLNOT() != null) { final Branch local = utility.markBranch(ctx, exprctx); if (branch == null) { local.fals = new Label(); final Label aend = new Label(); writer.visit(exprctx); execute.push(false); execute.goTo(aend); execute.mark(local.fals); execute.push(true); execute.mark(aend); caster.checkWriteCast(unaryemd); } else { local.tru = branch.fals; local.fals = branch.tru; writer.visit(exprctx); } } else { final org.objectweb.asm.Type type = unaryemd.from.type; final Sort sort = unaryemd.from.sort; writer.visit(exprctx); if (ctx.BWNOT() != null) { if (sort == Sort.DEF) { execute.invokeStatic(definition.defobjType.type, DEF_NOT_CALL); } else { if (sort == Sort.INT) { utility.writeConstant(ctx, -1); } else if (sort == Sort.LONG) { utility.writeConstant(ctx, -1L); } else { throw new IllegalStateException(WriterUtility.error(ctx) + "Unexpected state."); } execute.math(GeneratorAdapter.XOR, type); } } else if (ctx.SUB() != null) { if (sort == Sort.DEF) { execute.invokeStatic(definition.defobjType.type, DEF_NEG_CALL); } else { if (settings.getNumericOverflow()) { execute.math(GeneratorAdapter.NEG, type); } else { if (sort == Sort.INT) { execute.invokeStatic(definition.mathType.type, NEGATEEXACT_INT); } else if (sort == Sort.LONG) { execute.invokeStatic(definition.mathType.type, NEGATEEXACT_LONG); } else { throw new IllegalStateException(WriterUtility.error(ctx) + "Unexpected state."); } } } } else if (ctx.ADD() == null) { throw new IllegalStateException(WriterUtility.error(ctx) + "Unexpected state."); } caster.checkWriteCast(unaryemd); utility.checkWriteBranch(ctx); } } }
From source file:org.elasticsearch.painless.WriterUtility.java
License:Apache License
void writeBinaryInstruction(final ParserRuleContext source, final Type type, final int token) { final Sort sort = type.sort; final boolean exact = !settings.getNumericOverflow() && ((sort == Sort.INT || sort == Sort.LONG) && (token == MUL || token == DIV || token == ADD || token == SUB) || (sort == Sort.FLOAT || sort == Sort.DOUBLE) && (token == MUL || token == DIV || token == REM || token == ADD || token == SUB)); // If it's a 64-bit shift, fix-up the last argument to truncate to 32-bits. // Note that unlike java, this means we still do binary promotion of shifts, // but it keeps things simple, and this check works because we promote shifts. if (sort == Sort.LONG && (token == LSH || token == USH || token == RSH)) { execute.cast(org.objectweb.asm.Type.LONG_TYPE, org.objectweb.asm.Type.INT_TYPE); }// w w w .j a v a2s .c o m if (exact) { switch (sort) { case INT: switch (token) { case MUL: execute.invokeStatic(definition.mathType.type, MULEXACT_INT); break; case DIV: execute.invokeStatic(definition.utilityType.type, DIVWOOVERLOW_INT); break; case ADD: execute.invokeStatic(definition.mathType.type, ADDEXACT_INT); break; case SUB: execute.invokeStatic(definition.mathType.type, SUBEXACT_INT); break; default: throw new IllegalStateException(WriterUtility.error(source) + "Unexpected state."); } break; case LONG: switch (token) { case MUL: execute.invokeStatic(definition.mathType.type, MULEXACT_LONG); break; case DIV: execute.invokeStatic(definition.utilityType.type, DIVWOOVERLOW_LONG); break; case ADD: execute.invokeStatic(definition.mathType.type, ADDEXACT_LONG); break; case SUB: execute.invokeStatic(definition.mathType.type, SUBEXACT_LONG); break; default: throw new IllegalStateException(WriterUtility.error(source) + "Unexpected state."); } break; case FLOAT: switch (token) { case MUL: execute.invokeStatic(definition.utilityType.type, MULWOOVERLOW_FLOAT); break; case DIV: execute.invokeStatic(definition.utilityType.type, DIVWOOVERLOW_FLOAT); break; case REM: execute.invokeStatic(definition.utilityType.type, REMWOOVERLOW_FLOAT); break; case ADD: execute.invokeStatic(definition.utilityType.type, ADDWOOVERLOW_FLOAT); break; case SUB: execute.invokeStatic(definition.utilityType.type, SUBWOOVERLOW_FLOAT); break; default: throw new IllegalStateException(WriterUtility.error(source) + "Unexpected state."); } break; case DOUBLE: switch (token) { case MUL: execute.invokeStatic(definition.utilityType.type, MULWOOVERLOW_DOUBLE); break; case DIV: execute.invokeStatic(definition.utilityType.type, DIVWOOVERLOW_DOUBLE); break; case REM: execute.invokeStatic(definition.utilityType.type, REMWOOVERLOW_DOUBLE); break; case ADD: execute.invokeStatic(definition.utilityType.type, ADDWOOVERLOW_DOUBLE); break; case SUB: execute.invokeStatic(definition.utilityType.type, SUBWOOVERLOW_DOUBLE); break; default: throw new IllegalStateException(WriterUtility.error(source) + "Unexpected state."); } break; default: throw new IllegalStateException(WriterUtility.error(source) + "Unexpected state."); } } else { if ((sort == Sort.FLOAT || sort == Sort.DOUBLE) && (token == LSH || token == USH || token == RSH || token == BWAND || token == BWXOR || token == BWOR)) { throw new IllegalStateException(WriterUtility.error(source) + "Unexpected state."); } if (sort == Sort.DEF) { switch (token) { case MUL: execute.invokeStatic(definition.defobjType.type, DEF_MUL_CALL); break; case DIV: execute.invokeStatic(definition.defobjType.type, DEF_DIV_CALL); break; case REM: execute.invokeStatic(definition.defobjType.type, DEF_REM_CALL); break; case ADD: execute.invokeStatic(definition.defobjType.type, DEF_ADD_CALL); break; case SUB: execute.invokeStatic(definition.defobjType.type, DEF_SUB_CALL); break; case LSH: execute.invokeStatic(definition.defobjType.type, DEF_LSH_CALL); break; case USH: execute.invokeStatic(definition.defobjType.type, DEF_RSH_CALL); break; case RSH: execute.invokeStatic(definition.defobjType.type, DEF_USH_CALL); break; case BWAND: execute.invokeStatic(definition.defobjType.type, DEF_AND_CALL); break; case BWXOR: execute.invokeStatic(definition.defobjType.type, DEF_XOR_CALL); break; case BWOR: execute.invokeStatic(definition.defobjType.type, DEF_OR_CALL); break; default: throw new IllegalStateException(WriterUtility.error(source) + "Unexpected state."); } } else { switch (token) { case MUL: execute.math(GeneratorAdapter.MUL, type.type); break; case DIV: execute.math(GeneratorAdapter.DIV, type.type); break; case REM: execute.math(GeneratorAdapter.REM, type.type); break; case ADD: execute.math(GeneratorAdapter.ADD, type.type); break; case SUB: execute.math(GeneratorAdapter.SUB, type.type); break; case LSH: execute.math(GeneratorAdapter.SHL, type.type); break; case USH: execute.math(GeneratorAdapter.USHR, type.type); break; case RSH: execute.math(GeneratorAdapter.SHR, type.type); break; case BWAND: execute.math(GeneratorAdapter.AND, type.type); break; case BWXOR: execute.math(GeneratorAdapter.XOR, type.type); break; case BWOR: execute.math(GeneratorAdapter.OR, type.type); break; default: throw new IllegalStateException(WriterUtility.error(source) + "Unexpected state."); } } } }
From source file:org.elasticsearch.plan.a.Writer.java
License:Apache License
@Override public Void visitUnary(final UnaryContext ctx) { final ExpressionMetadata unaryemd = metadata.getExpressionMetadata(ctx); final Object postConst = unaryemd.postConst; final Object preConst = unaryemd.preConst; final Branch branch = getBranch(ctx); if (postConst != null) { if (ctx.BOOLNOT() != null) { if (branch == null) { writeConstant(ctx, postConst); } else { if ((boolean) postConst && branch.tru != null) { execute.goTo(branch.tru); } else if (!(boolean) postConst && branch.fals != null) { execute.goTo(branch.fals); }// w ww . j ava 2 s . c o m } } else { writeConstant(ctx, postConst); checkWriteBranch(ctx); } } else if (preConst != null) { if (branch == null) { writeConstant(ctx, preConst); checkWriteCast(unaryemd); } else { throw new IllegalStateException(error(ctx) + "Unexpected writer state."); } } else { final ExpressionContext exprctx = ctx.expression(); if (ctx.BOOLNOT() != null) { final Branch local = markBranch(ctx, exprctx); if (branch == null) { local.fals = new Label(); final Label aend = new Label(); visit(exprctx); execute.push(false); execute.goTo(aend); execute.mark(local.fals); execute.push(true); execute.mark(aend); checkWriteCast(unaryemd); } else { local.tru = branch.fals; local.fals = branch.tru; visit(exprctx); } } else { final org.objectweb.asm.Type type = unaryemd.from.type; final Sort sort = unaryemd.from.sort; visit(exprctx); if (ctx.BWNOT() != null) { if (sort == Sort.DEF) { execute.invokeStatic(definition.defobjType.type, DEF_NOT_CALL); } else { if (sort == Sort.INT) { writeConstant(ctx, -1); } else if (sort == Sort.LONG) { writeConstant(ctx, -1L); } else { throw new IllegalStateException(error(ctx) + "Unexpected writer state."); } execute.math(GeneratorAdapter.XOR, type); } } else if (ctx.SUB() != null) { if (sort == Sort.DEF) { execute.invokeStatic(definition.defobjType.type, DEF_NEG_CALL); } else { if (settings.getNumericOverflow()) { execute.math(GeneratorAdapter.NEG, type); } else { if (sort == Sort.INT) { execute.invokeStatic(definition.mathType.type, NEGATEEXACT_INT); } else if (sort == Sort.LONG) { execute.invokeStatic(definition.mathType.type, NEGATEEXACT_LONG); } else { throw new IllegalStateException(error(ctx) + "Unexpected writer state."); } } } } else if (ctx.ADD() == null) { throw new IllegalStateException(error(ctx) + "Unexpected writer state."); } checkWriteCast(unaryemd); checkWriteBranch(ctx); } } return null; }
From source file:org.elasticsearch.plan.a.Writer.java
License:Apache License
private void writeBinaryInstruction(final ParserRuleContext source, final Type type, final int token) { final Sort sort = type.sort; final boolean exact = !settings.getNumericOverflow() && ((sort == Sort.INT || sort == Sort.LONG) && (token == MUL || token == DIV || token == ADD || token == SUB) || (sort == Sort.FLOAT || sort == Sort.DOUBLE) && (token == MUL || token == DIV || token == REM || token == ADD || token == SUB)); // if its a 64-bit shift, fixup the lastSource argument to truncate to 32-bits // note unlike java, this means we still do binary promotion of shifts, // but it keeps things simple -- this check works because we promote shifts. if (sort == Sort.LONG && (token == LSH || token == USH || token == RSH)) { execute.cast(org.objectweb.asm.Type.LONG_TYPE, org.objectweb.asm.Type.INT_TYPE); }//from ww w .j a va2s. c o m if (exact) { switch (sort) { case INT: switch (token) { case MUL: execute.invokeStatic(definition.mathType.type, MULEXACT_INT); break; case DIV: execute.invokeStatic(definition.utilityType.type, DIVWOOVERLOW_INT); break; case ADD: execute.invokeStatic(definition.mathType.type, ADDEXACT_INT); break; case SUB: execute.invokeStatic(definition.mathType.type, SUBEXACT_INT); break; default: throw new IllegalStateException(error(source) + "Unexpected writer state."); } break; case LONG: switch (token) { case MUL: execute.invokeStatic(definition.mathType.type, MULEXACT_LONG); break; case DIV: execute.invokeStatic(definition.utilityType.type, DIVWOOVERLOW_LONG); break; case ADD: execute.invokeStatic(definition.mathType.type, ADDEXACT_LONG); break; case SUB: execute.invokeStatic(definition.mathType.type, SUBEXACT_LONG); break; default: throw new IllegalStateException(error(source) + "Unexpected writer state."); } break; case FLOAT: switch (token) { case MUL: execute.invokeStatic(definition.utilityType.type, MULWOOVERLOW_FLOAT); break; case DIV: execute.invokeStatic(definition.utilityType.type, DIVWOOVERLOW_FLOAT); break; case REM: execute.invokeStatic(definition.utilityType.type, REMWOOVERLOW_FLOAT); break; case ADD: execute.invokeStatic(definition.utilityType.type, ADDWOOVERLOW_FLOAT); break; case SUB: execute.invokeStatic(definition.utilityType.type, SUBWOOVERLOW_FLOAT); break; default: throw new IllegalStateException(error(source) + "Unexpected writer state."); } break; case DOUBLE: switch (token) { case MUL: execute.invokeStatic(definition.utilityType.type, MULWOOVERLOW_DOUBLE); break; case DIV: execute.invokeStatic(definition.utilityType.type, DIVWOOVERLOW_DOUBLE); break; case REM: execute.invokeStatic(definition.utilityType.type, REMWOOVERLOW_DOUBLE); break; case ADD: execute.invokeStatic(definition.utilityType.type, ADDWOOVERLOW_DOUBLE); break; case SUB: execute.invokeStatic(definition.utilityType.type, SUBWOOVERLOW_DOUBLE); break; default: throw new IllegalStateException(error(source) + "Unexpected writer state."); } break; default: throw new IllegalStateException(error(source) + "Unexpected writer state."); } } else { if ((sort == Sort.FLOAT || sort == Sort.DOUBLE) && (token == LSH || token == USH || token == RSH || token == BWAND || token == BWXOR || token == BWOR)) { throw new IllegalStateException(error(source) + "Unexpected writer state."); } if (sort == Sort.DEF) { switch (token) { case MUL: execute.invokeStatic(definition.defobjType.type, DEF_MUL_CALL); break; case DIV: execute.invokeStatic(definition.defobjType.type, DEF_DIV_CALL); break; case REM: execute.invokeStatic(definition.defobjType.type, DEF_REM_CALL); break; case ADD: execute.invokeStatic(definition.defobjType.type, DEF_ADD_CALL); break; case SUB: execute.invokeStatic(definition.defobjType.type, DEF_SUB_CALL); break; case LSH: execute.invokeStatic(definition.defobjType.type, DEF_LSH_CALL); break; case USH: execute.invokeStatic(definition.defobjType.type, DEF_RSH_CALL); break; case RSH: execute.invokeStatic(definition.defobjType.type, DEF_USH_CALL); break; case BWAND: execute.invokeStatic(definition.defobjType.type, DEF_AND_CALL); break; case BWXOR: execute.invokeStatic(definition.defobjType.type, DEF_XOR_CALL); break; case BWOR: execute.invokeStatic(definition.defobjType.type, DEF_OR_CALL); break; default: throw new IllegalStateException(error(source) + "Unexpected writer state."); } } else { switch (token) { case MUL: execute.math(GeneratorAdapter.MUL, type.type); break; case DIV: execute.math(GeneratorAdapter.DIV, type.type); break; case REM: execute.math(GeneratorAdapter.REM, type.type); break; case ADD: execute.math(GeneratorAdapter.ADD, type.type); break; case SUB: execute.math(GeneratorAdapter.SUB, type.type); break; case LSH: execute.math(GeneratorAdapter.SHL, type.type); break; case USH: execute.math(GeneratorAdapter.USHR, type.type); break; case RSH: execute.math(GeneratorAdapter.SHR, type.type); break; case BWAND: execute.math(GeneratorAdapter.AND, type.type); break; case BWXOR: execute.math(GeneratorAdapter.XOR, type.type); break; case BWOR: execute.math(GeneratorAdapter.OR, type.type); break; default: throw new IllegalStateException(error(source) + "Unexpected writer state."); } } } }