示例#1
0
 void write(ClassEnv e, CodeAttr ce, DataOutputStream out) throws IOException, jasError {
   if (wide) {
     target.writeWideOffset(ce, source, out);
   } else {
     int offset = ce.getPc(target);
     if (source != null) offset -= ce.getPc(source);
     if (offset > 32767 || offset < -32768)
       throw new jasError("reference from line " + ref + " exceed size for short");
     target.writeOffset(ce, source, out);
   }
 }
示例#2
0
  int size(ClassEnv ce, CodeAttr code) throws jasError {
    int sz = 8; // 4 + 4 + padding + jumptable
    int source_pc = code.getPc(source);
    if (((source_pc + 1) % 4) != 0) {
      // need padding
      sz += (4 - ((source_pc + 1) % 4));
    }

    if (jmp != null) {
      sz += 8 * (jmp.length);
    }
    return sz;
  }
示例#3
0
 int size(ClassEnv ce, CodeAttr code) throws jasError
       // the *real* reason for making it a
       // method..
     {
   int sz = 12; // 4+4+4+jmptable+padding...
   int source_pc = code.getPc(source);
   if (((source_pc + 1) % 4) != 0) { // need padding
     sz += (4 - ((source_pc + 1) % 4));
   }
   if (jmp != null) {
     sz += 4 * (jmp.length);
   }
   return sz;
 }
示例#4
0
  void write(ClassEnv e, CodeAttr ce, DataOutputStream out) throws IOException, jasError {
    int pad;
    int source_pc = ce.getPc(source);

    if (((source_pc + 1) % 4) != 0) { // need padding
      pad = (4 - ((source_pc + 1) % 4));
      for (int x = 0; x < pad; x++) out.writeByte(0);
    }
    dflt.writeWideOffset(ce, source, out);
    out.writeInt(min);
    out.writeInt(max);
    int cnt = jmp.length;
    for (int x = 0; x < cnt; x++) {
      jmp[x].writeWideOffset(ce, source, out);
    }
  }
示例#5
0
  void write(ClassEnv e, CodeAttr ce, DataOutputStream out) throws IOException, jasError {
    int pad;
    int source_pc = ce.getPc(source);

    if (((source_pc + 1) % 4) != 0) { // need padding
      pad = (4 - ((source_pc + 1) % 4));
      for (int x = 0; x < pad; x++) out.writeByte(0);
    }

    // write offset to default
    // as a 4 byte signed value
    dflt.writeWideOffset(ce, source, out);
    if (jmp == null) {
      out.writeInt(0);
    } else {
      out.writeInt(jmp.length);
      for (int x = 0; x < jmp.length; x++) {
        out.writeInt(match[x]);
        jmp[x].writeWideOffset(ce, source, out);
      }
    }
  }