/** * Returns true if the register contains an integer 0 or a known-null * object reference * * @param spec non-null spec * @return true for 0 or null type bearers */ private static boolean isConstIntZeroOrKnownNull(RegisterSpec spec) { TypeBearer tb = spec.getTypeBearer(); if (tb instanceof CstLiteralBits) { CstLiteralBits clb = (CstLiteralBits) tb; return (clb.getLongBits() == 0); } return false; }
/** * Returns true if the register contains an integer 0 or a known-null * object reference * * @param spec non-null spec * @return true for 0 or null type bearers */ private static boolean isConstIntZeroOrKnownNull(RegisterSpec spec) { TypeBearer tb = spec.getTypeBearer(); if (tb instanceof CstLiteralBits) { CstLiteralBits clb = (CstLiteralBits) tb; return (clb.getLongBits() == 0); } return false; }
/** * Returns true if the register contains an integer 0 or a known-null * object reference * * @param spec non-null spec * @return true for 0 or null type bearers */ private static boolean isConstIntZeroOrKnownNull(RegisterSpec spec) { TypeBearer tb = spec.getTypeBearer(); if (tb instanceof CstLiteralBits) { CstLiteralBits clb = (CstLiteralBits) tb; return (clb.getLongBits() == 0); } return false; }
/** * Returns true if the register contains an integer 0 or a known-null * object reference * * @param spec non-null spec * @return true for 0 or null type bearers */ private static boolean isConstIntZeroOrKnownNull(RegisterSpec spec) { TypeBearer tb = spec.getTypeBearer(); if (tb instanceof CstLiteralBits) { CstLiteralBits clb = (CstLiteralBits) tb; return (clb.getLongBits() == 0); } return false; }
/** * Returns true if the register contains an integer 0 or a known-null * object reference * * @param spec non-null spec * @return true for 0 or null type bearers */ private static boolean isConstIntZeroOrKnownNull(RegisterSpec spec) { TypeBearer tb = spec.getTypeBearer(); if (tb instanceof CstLiteralBits) { CstLiteralBits clb = (CstLiteralBits) tb; return (clb.getLongBits() == 0); } return false; }
/** * Returns true if the register contains an integer 0 or a known-null * object reference * * @param spec non-null spec * @return true for 0 or null type bearers */ private static boolean isConstIntZeroOrKnownNull(RegisterSpec spec) { TypeBearer tb = spec.getTypeBearer(); if (tb instanceof CstLiteralBits) { CstLiteralBits clb = (CstLiteralBits) tb; return (clb.getLongBits() == 0); } return false; }
/** * Returns true if the register contains an integer 0 or a known-null * object reference * * @param spec non-null spec * @return true for 0 or null type bearers */ private static boolean isConstIntZeroOrKnownNull(RegisterSpec spec) { TypeBearer tb = spec.getTypeBearer(); if (tb instanceof CstLiteralBits) { CstLiteralBits clb = (CstLiteralBits) tb; return (clb.getLongBits() == 0); } return false; }
/** * Returns true if the register contains an integer 0 or a known-null * object reference * * @param spec non-null spec * @return true for 0 or null type bearers */ private static boolean isConstIntZeroOrKnownNull(RegisterSpec spec) { TypeBearer tb = spec.getTypeBearer(); if (tb instanceof CstLiteralBits) { CstLiteralBits clb = (CstLiteralBits) tb; return (clb.getLongBits() == 0); } return false; }
/** * Returns the local variable listing string for a single register spec. * * @param spec {@code non-null;} the spec to convert * @return {@code non-null;} the string form */ public static String localString(RegisterSpec spec) { return spec.regString() + ' ' + spec.getLocalItem().toString() + ": " + spec.getTypeBearer().toHuman(); }
/** * Returns the local variable listing string for a single register spec. * * @param spec {@code non-null;} the spec to convert * @return {@code non-null;} the string form */ public static String localString(RegisterSpec spec) { return spec.regString() + ' ' + spec.getLocalItem().toString() + ": " + spec.getTypeBearer().toHuman(); }
/** * Returns the local variable listing string for a single register spec. * * @param spec {@code non-null;} the spec to convert * @return {@code non-null;} the string form */ public static String localString(RegisterSpec spec) { return spec.regString() + ' ' + spec.getLocalItem().toString() + ": " + spec.getTypeBearer().toHuman(); }
/** * Returns the local variable listing string for a single register spec. * * @param spec {@code non-null;} the spec to convert * @return {@code non-null;} the string form */ public static String localString(RegisterSpec spec) { return spec.regString() + ' ' + spec.getLocalItem().toString() + ": " + spec.getTypeBearer().toHuman(); }
/** * Returns the local variable listing string for a single register spec. * * @param spec {@code non-null;} the spec to convert * @return {@code non-null;} the string form */ public static String localString(RegisterSpec spec) { return spec.regString() + ' ' + spec.getLocalItem().toString() + ": " + spec.getTypeBearer().toHuman(); }
/** * Returns the local variable listing string for a single register spec. * * @param spec {@code non-null;} the spec to convert * @return {@code non-null;} the string form */ public static String localString(RegisterSpec spec) { return spec.regString() + ' ' + spec.getLocalItem().toString() + ": " + spec.getTypeBearer().toHuman(); }
/** * Returns the local variable listing string for a single register spec. * * @param spec {@code non-null;} the spec to convert * @return {@code non-null;} the string form */ public static String localString(RegisterSpec spec) { return spec.regString() + ' ' + spec.getLocalItem().toString() + ": " + spec.getTypeBearer().toHuman(); }
/** * Returns the local variable listing string for a single register spec. * * @param spec {@code non-null;} the spec to convert * @return {@code non-null;} the string form */ public static String localString(RegisterSpec spec) { return spec.regString() + ' ' + spec.getLocalItem().toString() + ": " + spec.getTypeBearer().toHuman(); }
/** * Process a single instruction, looking for new objects resulting from * move result or move param. * * @param insn {@code non-null;} instruction to process */ private void processInsn(SsaInsn insn) { int op = insn.getOpcode().getOpcode(); RegisterSpec result = insn.getResult(); EscapeSet escSet; // Identify new objects if (op == RegOps.MOVE_RESULT_PSEUDO && result.getTypeBearer().getBasicType() == Type.BT_OBJECT) { // Handle objects generated through move_result_pseudo escSet = processMoveResultPseudoInsn(insn); processRegister(result, escSet); } else if (op == RegOps.MOVE_PARAM && result.getTypeBearer().getBasicType() == Type.BT_OBJECT) { // Track method arguments that are objects escSet = new EscapeSet(result.getReg(), regCount, EscapeState.NONE); latticeValues.add(escSet); processRegister(result, escSet); } else if (op == RegOps.MOVE_RESULT && result.getTypeBearer().getBasicType() == Type.BT_OBJECT) { // Track method return values that are objects escSet = new EscapeSet(result.getReg(), regCount, EscapeState.NONE); latticeValues.add(escSet); processRegister(result, escSet); } }
/** * Process a single instruction, looking for new objects resulting from * move result or move param. * * @param insn {@code non-null;} instruction to process */ private void processInsn(SsaInsn insn) { int op = insn.getOpcode().getOpcode(); RegisterSpec result = insn.getResult(); EscapeSet escSet; // Identify new objects if (op == RegOps.MOVE_RESULT_PSEUDO && result.getTypeBearer().getBasicType() == Type.BT_OBJECT) { // Handle objects generated through move_result_pseudo escSet = processMoveResultPseudoInsn(insn); processRegister(result, escSet); } else if (op == RegOps.MOVE_PARAM && result.getTypeBearer().getBasicType() == Type.BT_OBJECT) { // Track method arguments that are objects escSet = new EscapeSet(result.getReg(), regCount, EscapeState.NONE); latticeValues.add(escSet); processRegister(result, escSet); } else if (op == RegOps.MOVE_RESULT && result.getTypeBearer().getBasicType() == Type.BT_OBJECT) { // Track method return values that are objects escSet = new EscapeSet(result.getReg(), regCount, EscapeState.NONE); latticeValues.add(escSet); processRegister(result, escSet); } }
/** * Process a single instruction, looking for new objects resulting from * move result or move param. * * @param insn {@code non-null;} instruction to process */ private void processInsn(SsaInsn insn) { int op = insn.getOpcode().getOpcode(); RegisterSpec result = insn.getResult(); EscapeSet escSet; // Identify new objects if (op == RegOps.MOVE_RESULT_PSEUDO && result.getTypeBearer().getBasicType() == Type.BT_OBJECT) { // Handle objects generated through move_result_pseudo escSet = processMoveResultPseudoInsn(insn); processRegister(result, escSet); } else if (op == RegOps.MOVE_PARAM && result.getTypeBearer().getBasicType() == Type.BT_OBJECT) { // Track method arguments that are objects escSet = new EscapeSet(result.getReg(), regCount, EscapeState.NONE); latticeValues.add(escSet); processRegister(result, escSet); } else if (op == RegOps.MOVE_RESULT && result.getTypeBearer().getBasicType() == Type.BT_OBJECT) { // Track method return values that are objects escSet = new EscapeSet(result.getReg(), regCount, EscapeState.NONE); latticeValues.add(escSet); processRegister(result, escSet); } }
/** {@inheritDoc} */ @Override public Insn withLastSourceLiteral() { RegisterSpecList sources = getSources(); int szSources = sources.size(); if (szSources == 0) { return this; } TypeBearer lastType = sources.get(szSources - 1).getTypeBearer(); if (!lastType.isConstant()) { return this; } Constant cst = (Constant) lastType; RegisterSpecList newSources = sources.withoutLast(); Rop newRop; try { newRop = Rops.ropFor(getOpcode().getOpcode(), getResult(), newSources, (Constant)lastType); } catch (IllegalArgumentException ex) { // There's no rop for this case return this; } return new PlainCstInsn(newRop, getPosition(), getResult(), newSources, cst); }