1 10 11 package jas; 12 13 import java.io.*; 14 15 16 public class Label extends Insn implements RuntimeConstants 17 { 18 String id; 19 20 25 public Label(String tag) 26 { 27 id = tag.intern(); 28 opc = opc_label; 29 operand = null; 30 } 31 void write(ClassEnv e, CodeAttr ce, DataOutputStream out) 33 { return; } 34 int size(ClassEnv e, CodeAttr ce) 36 { return 0; } 37 void writeOffset(CodeAttr ce, Insn source, DataOutputStream out) 39 throws jasError, IOException 40 { int pc, tpc; 43 pc = ce.getPc(this); 44 if (source == null) 45 tpc = 0; 46 else 47 tpc = ce.getPc(source); 48 short offset = (short) (pc - tpc); 49 out.writeShort(offset); 50 } 51 void writeWideOffset(CodeAttr ce, Insn source, DataOutputStream out) 52 throws IOException, jasError 53 { 54 int pc, tpc; 55 pc = ce.getPc(this); 56 if (source == null) 57 tpc = 0; 58 else 59 tpc = ce.getPc(source); 60 out.writeInt(pc - tpc); 61 } 62 public String toString() 63 { 64 return ("Label: " + id); 65 } 66 } 67 68 | Popular Tags |