Package bytecodeparser.analysis.stack

Examples of bytecodeparser.analysis.stack.StackElement


          result[nbParams - 1] = getLocalVariableName(varargs[i]) + "(" + varargs[i] + ")";
        }
        stackIndex++;
      }
      while(nbParams > 0) {
        StackElement se = frame.stackBefore.stack.get(stackIndex++);
        if(se instanceof TOP)
          se = frame.stackBefore.stack.get(stackIndex++);
        result[nbParams - 1] = getLocalVariableName(se) + "(" + se + ")";
        nbParams--;
      }
View Full Code Here


 
  @Override
  public void simulate(Stack stack) {
    int size = -1;
    if(dimensions == 1) {
      StackElement se = stack.pop();
      if(se instanceof IntegerConstant) {
        IntegerConstant ic = (IntegerConstant) se;
        size = ic.getValue();
      }
    } else {
View Full Code Here

  }
 
  @Override
  public void simulate(Stack stack) {
    boolean isAutoboxing = isAutoboxing();
    StackElement se = null;
    for(int i = 0; i < pops.length; i++) {
      if(pops[i] == DOUBLE)
        se = stack.pop2();
      else se = stack.pop();
    }
    if(op.as(MethodInvocationOpcode.class).isInstanceMethod())
      stack.pop();
    if(returnTypeLength != null) {
      if(returnTypeLength == DOUBLE)
        stack.push2(isAutoboxing ? se.copy() : new Whatever());
      else stack.push(isAutoboxing ? se.copy() : new Whatever());
    }
  }
View Full Code Here

        TrackableArray trackableArray = (TrackableArray) frame.stackBefore.stack.get(stackIndex);
        varargs = resolveParameters(Arrays.asList(trackableArray.elements), trackableArray.elements.length, true);
      }
    }
    if(decoded.op.as(MethodInvocationOpcode.class).isInstanceMethod()) {
      StackElement subjectSE = frame.stackBefore.stack.get(StackElementLength.add(decoded.pops));
      LocalVariable lv = getLocalVariableIfAvailable(subjectSE);
      return new MethodParams(lv != null ? new MethodParam(lv.name, lv.type) : new MethodParam(null, null), params, varargs);
    }
    return new MethodParams(null, params, varargs);
  }
View Full Code Here

  private static MethodParam[] resolveParameters(final Iterable<StackElement> stack, final int elements, boolean reverse) {
    MethodParam[] result = new MethodParam[elements];
    Iterator<StackElement> it = stack.iterator();
    int i = 0;
    while(it.hasNext() && i < elements) {
      StackElement se = it.next();
      if(se instanceof TOP)
        se = it.next();
      LocalVariable lv = getLocalVariableIfAvailable(se);
      if(lv != null) {
        result[reverse ? i : elements - i - 1] = new MethodParam(lv.name, lv.type);
View Full Code Here

  @Override
  public void simulate(Stack stack) {
    if(op.code != Opcode.IINC) {
      ValueFromLocalVariable toPush = new ValueFromLocalVariable(localVariable);
      if(!load) {
        StackElement poppedSe;
        if(doubleLength)
          poppedSe = stack.pop2();
        else poppedSe = stack.pop();
        /* when a name is null while LocalVariableTable is present, it is likely that this class has been
         * previously enhanced and this local variable is just a variable proxy, so grab the original local
View Full Code Here

  }
  @Override
  public void simulate(Stack stack) {
    if(!this.op.as(ArrayOpcode.class).isLoad) {
      StackElementLength[] pops = Arrays.copyOf(getPops(), getPops().length - 1);
      StackElement subject = stack.getFromTop(StackElementLength.add(pops));
      if(subject instanceof TrackableArray) {
        TrackableArray array = (TrackableArray) subject;
        StackElement i = stack.getFromTop(StackElementLength.add(array.componentLength));
        if(i instanceof IntegerConstant) {
          StackElement value = stack.peek(array.componentLength);
          array.set(((IntegerConstant) i).getValue(), value);
        } else {
          array.isDirty = true;
        }
      }
View Full Code Here

TOP

Related Classes of bytecodeparser.analysis.stack.StackElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.