1 24 25 package org.aspectj.compiler.base; 26 27 import org.aspectj.compiler.base.ast.*; 28 import org.aspectj.compiler.base.*; 29 30 import java.util.*; 31 32 38 40 42 public final class FrameLocPass extends WalkerPass { 43 public FrameLocPass(JavaCompiler jc) { super(jc); } 44 45 public String getDisplayName() { return "assigning frame locs"; } 46 47 public boolean inTryFinally = false; 48 private int maxfs = 0; 49 private int fs = 0; 50 51 54 public int getmaxfs() { 55 return maxfs; 56 } 57 public int getfs() { 58 return fs; 59 } 60 public void setfs(int fs) { 61 if (! inTryFinally) 62 this.fs = fs; 63 frameInvariant(); 64 } 65 public void incfs(int delta) { 66 this.fs += delta; 67 frameInvariant(); 68 } 69 public int allocate(int size) { 70 int ret = this.fs; 71 incfs(size); 72 return ret; 73 } 74 private void frameInvariant() { 75 if (fs > maxfs) maxfs = fs; 76 } 77 78 public ASTObject process(ASTObject object) { 79 object.walkFrameLoc(this); 80 return object; 81 } 82 } 83 | Popular Tags |