Package com.caucho.bytecode

Examples of com.caucho.bytecode.CodeEnhancer


    baseClass.getMethodList().add(extMethod);

    try {
      InitAnalyzer initAnalyzer = new InitAnalyzer();
      CodeEnhancer baseEnhancer = new CodeEnhancer(baseClass, baseMethod.getCode());
      baseEnhancer.analyze(initAnalyzer);

      int offset = initAnalyzer.getOffset();
      byte []code = new byte[offset];
      byte []oldCode = baseEnhancer.getCode();
      System.arraycopy(oldCode, 0, code, 0, offset);

      baseEnhancer.remove(0, offset);
      baseEnhancer.update();

      CodeEnhancer extEnhancer = new CodeEnhancer(baseClass, extMethod.getCode());

      extEnhancer.add(0, code, 0, code.length);

      ExtMethodAnalyzer extMethodAnalyzer
  = new ExtMethodAnalyzer(baseClass, extMethod, offset);
      extEnhancer.analyze(extMethodAnalyzer);
      extEnhancer.update();

      CodeAttribute baseCode = baseMethod.getCode();
      CodeAttribute extCode = extMethod.getCode();

      if (extCode.getMaxStack() < baseCode.getMaxStack())
View Full Code Here


  {
    try {
      if (extMethod.getName().endsWith("__super"))
  return;
     
      CodeEnhancer extEnhancer
  = new CodeEnhancer(extClass, extMethod.getCode());

      ExtMethodAnalyzer extMethodAnalyzer
  = new ExtMethodAnalyzer(baseClass, extMethod, 0);
      extEnhancer.analyze(extMethodAnalyzer);
      extEnhancer.update();
    } catch (RuntimeException e) {
      throw e;
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
View Full Code Here

    baseClass.getMethodList().add(extMethod);

    try {
      InitAnalyzer initAnalyzer = new InitAnalyzer();
      CodeEnhancer baseEnhancer = new CodeEnhancer(baseClass, baseMethod.getCode());
      baseEnhancer.analyze(initAnalyzer);

      int offset = initAnalyzer.getOffset();
      byte []code = new byte[offset];
      byte []oldCode = baseEnhancer.getCode();
      System.arraycopy(oldCode, 0, code, 0, offset);

      baseEnhancer.remove(0, offset);
      baseEnhancer.update();

      CodeEnhancer extEnhancer = new CodeEnhancer(baseClass, extMethod.getCode());

      extEnhancer.add(0, code, 0, code.length);

      ExtMethodAnalyzer extMethodAnalyzer
        = new ExtMethodAnalyzer(baseClass, extMethod, offset);
      extEnhancer.analyze(extMethodAnalyzer);
      extEnhancer.update();

      CodeAttribute baseCode = baseMethod.getCode();
      CodeAttribute extCode = extMethod.getCode();

      if (extCode.getMaxStack() < baseCode.getMaxStack())
View Full Code Here

  {
    try {
      if (extMethod.getName().endsWith("__super"))
        return;
     
      CodeEnhancer extEnhancer
        = new CodeEnhancer(extClass, extMethod.getCode());

      ExtMethodAnalyzer extMethodAnalyzer
        = new ExtMethodAnalyzer(baseClass, extMethod, 0);
      extEnhancer.analyze(extMethodAnalyzer);
      extEnhancer.update();
    } catch (RuntimeException e) {
      throw e;
    } catch (Exception e) {
      throw new RuntimeException(e);
    }
View Full Code Here

TOP

Related Classes of com.caucho.bytecode.CodeEnhancer

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.