1 6 7 package jas; 8 9 import java.io.*; 10 11 public class LocalVarEntry 12 { 13 Label start, end; 14 CP name, sig; 15 int slot; 16 17 27 public LocalVarEntry 28 (Label startLabel, Label endLabel, String name, String sig, int slot) 29 { 30 start = startLabel; 31 end = endLabel; 32 this.name = new AsciiCP(name); 33 this.sig = new AsciiCP(sig); 34 this.slot = slot; 35 } 36 37 47 public LocalVarEntry 48 (Label startLabel, Label endLabel, CP name, CP sig, int slot) 49 { 50 start = startLabel; 51 end = endLabel; 52 this.name = name; 53 this.sig = sig; 54 this.slot = slot; 55 } 56 57 void resolve(ClassEnv e) 58 { e.addCPItem(name); e.addCPItem(sig); } 59 60 void write(ClassEnv e, CodeAttr ce, DataOutputStream out) 61 throws IOException, jasError 62 { 63 start.writeOffset(ce, null, out); 64 end.writeOffset(ce, start, out); 67 out.writeShort(e.getCPIndex(name)); 68 out.writeShort(e.getCPIndex(sig)); 69 out.writeShort((short)slot); 70 } 71 } 72 | Popular Tags |