Package net.sourceforge.javautil.bytecode.api.type.method

Examples of net.sourceforge.javautil.bytecode.api.type.method.BytecodeScope


  /**
   * @param context The context in which to write this try/catch/final
   */
  public void write(BytecodeContextMethod context) {
    BytecodeScope parent = context.getScope(0);
    BytecodeScope code = new BytecodeScope(parent, context.createMarker(), context.createMarker());
   
    Map<String, BytecodeScope> scopes = new LinkedHashMap<String, BytecodeScope>();
    for (String key : exceptionTypes.keySet()) {
      ExceptionHandler handler = exceptionTypes.get(key);
      BytecodeScope scope = new BytecodeScope(parent, context.createMarker(), context.createMarker());
     
      context.jumpIfException(code.getStart(), code.getEnd(), scope.getStart(), handler.getExceptionType());
      scopes.put(handler.getExceptionType().getClassName(), scope);
    }
   
    BytecodeScope fscope = null;
    if (this.finallyBlock != null) {
      fscope = new BytecodeScope(parent, context.createMarker(), context.createMarker());
      context.jumpFinally(code.getStart(), fscope.getStart());
    }
   
    context.mark(code.getStart());
    this.writeLogic(context);
    context.mark(code.getEnd());
   
    if (this.finallyBlock != null) {
      context.jump(fscope.getStart());
    }
   
    for (String key : exceptionTypes.keySet()) {
      ExceptionHandler handler = exceptionTypes.get(key);
      handler.write(context, scopes.get(handler.getExceptionType().getClassName()));
View Full Code Here


 
  @Override protected void writeInstructions(BytecodeContextMethod context) {
    this.writeInitializer(context);
    IBytecodeMarker loop = context.getWriter().mark(context);
    try {
      context.pushLoop(new BytecodeScope(context.getScope(0), loop, context.getScope(0).getEnd()));
      this.writeCondition(context);
      this.writeLoopLogic(context);
      context.getWriter().jump(context, loop);
    } finally {
      context.popLoop();
View Full Code Here

TOP

Related Classes of net.sourceforge.javautil.bytecode.api.type.method.BytecodeScope

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.