Tabnine Logo
javassist.bytecode.analysis
Code IndexAdd Tabnine to your IDE (free)

How to use javassist.bytecode.analysis

Best Java code snippets using javassist.bytecode.analysis (Showing top 20 results out of 315)

origin: redisson/redisson

private Map mergeMultiAndSingle(MultiType multi, Type single) {
  Map map1 = getAllMultiInterfaces(multi);
  Map map2 = getAllInterfaces(single.getCtClass(), null);
  return findCommonInterfaces(map1, map2);
}
origin: redisson/redisson

  public String toString() {
    // follows the same detailed formating scheme as component
    return arrayName(component.toString(), dims);
  }
}
origin: redisson/redisson

private void access(int index, Type type, Subroutine subroutine) {
  if (subroutine == null)
    return;
  subroutine.access(index);
  if (type.getSize() == 2)
    subroutine.access(index + 1);
}
origin: redisson/redisson

private void mergeExceptionHandlers(IntQueue queue, MethodInfo method, int pos, Frame frame) {
  for (int i = 0; i < exceptions.length; i++) {
    ExceptionInfo exception = exceptions[i];
    // Start is inclusive, while end is exclusive!
    if (pos >= exception.start && pos < exception.end) {
      Frame newFrame = frame.copy();
      newFrame.clearStack();
      newFrame.push(exception.type);
      merge(queue, newFrame, exception.handler);
    }
  }
}
origin: redisson/redisson

private void evalLoad(Type expected, int index, Frame frame, Subroutine subroutine) throws BadBytecode {
  Type type = frame.getLocal(index);
  verifyAssignable(expected, type);
  simplePush(type, frame);
  access(index, type, subroutine);
}
origin: redisson/redisson

private void evalStore(Type expected, int index, Frame frame, Subroutine subroutine) throws BadBytecode {
  Type type = simplePop(frame);
  // RETURN_ADDRESS is allowed by ASTORE
  if (! (expected == Type.OBJECT && type == Type.RETURN_ADDRESS))
    verifyAssignable(expected, type);
  simpleSetLocal(index, type, frame);
  access(index, type, subroutine);
}
origin: redisson/redisson

private void evalBinaryMath(Type expected, Frame frame) throws BadBytecode {
  Type value2 = simplePop(frame);
  Type value1 = simplePop(frame);
  verifyAssignable(expected, value2);
  verifyAssignable(expected, value1);
  simplePush(value1, frame);
}
origin: redisson/redisson

private void merge(IntQueue queue, Frame frame, int target) {
  Frame old = frames[target];
  boolean changed;
  if (old == null) {
    frames[target] = frame.copy();
    changed = true;
  } else {
    changed = old.merge(frame);
  }
  if (changed) {
    queue.add(target);
  }
}
origin: redisson/redisson

private void printLocals(Frame frame) {
  stream.print("locals [");
  int length = frame.localsLength();
  for (int i = 0; i < length; i++) {
    if (i > 0)
      stream.print(", ");
    Type type = frame.getLocal(i);
    stream.print(type == null ? "empty" : type.toString());
  }
  stream.println("]");
}
origin: redisson/redisson

private void simplePush(Type type, Frame frame) {
  frame.push(type);
  if (type.getSize() == 2)
    frame.push(Type.TOP);
}
origin: redisson/redisson

private void simpleSetLocal(int index, Type type, Frame frame) {
  frame.setLocal(index, type);
  if (type.getSize() == 2)
    frame.setLocal(index + 1, Type.TOP);
}
origin: redisson/redisson

private Map findCommonInterfaces(Type type) {
  Map typeMap = getAllInterfaces(type.clazz, null);
  Map thisMap = getAllInterfaces(this.clazz, null);
  return findCommonInterfaces(typeMap, thisMap);
}
origin: redisson/redisson

private Map mergeMultiInterfaces(MultiType type1, MultiType type2) {
  Map map1 = getAllMultiInterfaces(type1);
  Map map2 = getAllMultiInterfaces(type2);
  return findCommonInterfaces(map1, map2);
}
origin: redisson/redisson

Type getRootComponent(Type type) {
  while (type.isArray())
    type = type.getComponent();
  return type;
}
origin: redisson/redisson

private void initFrames(CtClass clazz, MethodInfo minfo) throws BadBytecode {
  if (frames == null) {
    frames = ((new Analyzer())).analyze(clazz, minfo);
    offset = 0; // start tracking changes
  }
}
origin: redisson/redisson

/**
 * Prints all the methods declared in the given class. 
 */
public static void print(CtClass clazz, PrintStream stream) {
  (new FramePrinter(stream)).print(clazz);
}
origin: redisson/redisson

/**
 * Gets the class that corresponds with this type. If this information
 * is not yet known, java.lang.Object will be returned.
 */
public CtClass getCtClass() {
  if (resolved != null)
    return resolved.getCtClass();
  return Type.OBJECT.getCtClass();
}
origin: redisson/redisson

public boolean equals(Object o) {
  if (! (o instanceof MultiArrayType))
    return false;
  MultiArrayType multi = (MultiArrayType)o;
  return component.equals(multi.component) && dims == multi.dims;
}
origin: redisson/redisson

void add(int value) {
  IntQueue.Entry entry = new Entry(value);
  if (tail != null)
    tail.next = entry;
  tail = entry;
  if (head == null)
    head = entry;
}
origin: redisson/redisson

private void evalShift(Type expected, Frame frame) throws BadBytecode {
  Type value2 = simplePop(frame);
  Type value1 = simplePop(frame);
  verifyAssignable(Type.INTEGER, value2);
  verifyAssignable(expected, value1);
  simplePush(value1, frame);
}
javassist.bytecode.analysis

Most used classes

  • IntQueue
  • Analyzer$ExceptionInfo
  • Analyzer
    A data-flow analyzer that determines the type state of the stack and local variable table at every r
  • Executor
    Executor is responsible for modeling the effects of a JVM instruction on a frame.
  • Frame
    Represents the stack frame and local variable table at a particular point in time.
  • IntQueue$Entry,
  • MultiArrayType,
  • MultiType,
  • Subroutine,
  • SubroutineScanner,
  • Type,
  • Util,
  • ControlFlow$1,
  • ControlFlow$Access,
  • ControlFlow$Block,
  • ControlFlow$Catcher,
  • ControlFlow$Node
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now