com.sun.java.util.jar.pack.ConstantPool.Index Java Examples

The following examples show how to use com.sun.java.util.jar.pack.ConstantPool.Index. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: BandStructure.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
int encodeRef(Entry e, Index ix) {
    if (ix == null)
        throw new RuntimeException("null index for " + e.stringValue());
    int coding = ix.indexOf(e);
    if (verbose > 2)
        Utils.log.fine("putRef "+coding+" => "+e);
    return coding;
}
 
Example #2
Source File: BandStructure.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
static private void printCDecl(Band b) {
    if (b instanceof MultiBand) {
        MultiBand mb = (MultiBand) b;
        for (int i = 0; i < mb.bandCount; i++) {
            printCDecl(mb.bands[i]);
        }
        return;
    }
    String ixS = "NULL";
    if (b instanceof CPRefBand) {
        Index ix = ((CPRefBand)b).index;
        if (ix != null)  ixS = "INDEX("+ix.debugName+")";
    }
    Coding[] knownc = { BYTE1, CHAR3, BCI5, BRANCH5, UNSIGNED5,
                        UDELTA5, SIGNED5, DELTA5, MDELTA5 };
    String[] knowns = { "BYTE1", "CHAR3", "BCI5", "BRANCH5", "UNSIGNED5",
                        "UDELTA5", "SIGNED5", "DELTA5", "MDELTA5" };
    Coding rc = b.regularCoding;
    int rci = Arrays.asList(knownc).indexOf(rc);
    String cstr;
    if (rci >= 0)
        cstr = knowns[rci];
    else
        cstr = "CODING"+rc.keyString();
    System.out.println("  BAND_INIT(\""+b.name()+"\""
                       +", "+cstr+", "+ixS+"),");
}
 
Example #3
Source File: BandStructure.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private Entry decodeRefOrNull(int code, Index index) {
    // Inverse to encodeRefOrNull...
    int nonNullCode = code - (nullOK ? 1 : 0);
    if (nonNullCode == -1) {
        return null;
    } else {
        return decodeRef(nonNullCode, index);
    }
}
 
Example #4
Source File: BandStructure.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
private int encodeRefOrNull(Entry e, Index index) {
    int nonNullCode;  // NNC is the coding which assumes nulls are rare
    if (e == null) {
        nonNullCode = -1;  // negative values are rare
    } else {
        nonNullCode = encodeRef(e, index);
    }
    // If nulls are expected, increment, to make -1 code turn to 0.
    return (nullOK ? 1 : 0) + nonNullCode;
}
 
Example #5
Source File: BandStructure.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
private int encodeRefOrNull(Entry e, Index index) {
    int nonNullCode;  // NNC is the coding which assumes nulls are rare
    if (e == null) {
        nonNullCode = -1;  // negative values are rare
    } else {
        nonNullCode = encodeRef(e, index);
    }
    // If nulls are expected, increment, to make -1 code turn to 0.
    return (nullOK ? 1 : 0) + nonNullCode;
}
 
Example #6
Source File: BandStructure.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
protected void setConstantValueIndex(Field f) {
    Index ix = null;
    if (f != null) {
        byte tag = f.getLiteralTag();
        ix = getCPIndex(tag);
        if (verbose > 2)
            Utils.log.fine("setConstantValueIndex "+f+" "+ConstantPool.tagName(tag)+" => "+ix);
        assert(ix != null);
    }
    // Typically, allKQBands is the singleton of field_ConstantValue_KQ.
    for (CPRefBand xxx_KQ : allKQBands) {
        xxx_KQ.setIndex(ix);
    }
}
 
Example #7
Source File: BandStructure.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
protected void setConstantValueIndex(Field f) {
    Index ix = null;
    if (f != null) {
        byte tag = f.getLiteralTag();
        ix = getCPIndex(tag);
        if (verbose > 2)
            Utils.log.fine("setConstantValueIndex "+f+" "+ConstantPool.tagName(tag)+" => "+ix);
        assert(ix != null);
    }
    // Typically, allKQBands is the singleton of field_ConstantValue_KQ.
    for (CPRefBand xxx_KQ : allKQBands) {
        xxx_KQ.setIndex(ix);
    }
}
 
Example #8
Source File: BandStructure.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
int encodeRef(Entry e, Index ix) {
    if (ix == null)
        throw new RuntimeException("null index for " + e.stringValue());
    int coding = ix.indexOf(e);
    if (verbose > 2)
        Utils.log.fine("putRef "+coding+" => "+e);
    return coding;
}
 
Example #9
Source File: BandStructure.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected void setConstantValueIndex(Field f) {
    Index ix = null;
    if (f != null) {
        byte tag = f.getLiteralTag();
        ix = getCPIndex(tag);
        if (verbose > 2)
            Utils.log.fine("setConstantValueIndex "+f+" "+ConstantPool.tagName(tag)+" => "+ix);
        assert(ix != null);
    }
    // Typically, allKQBands is the singleton of field_ConstantValue_KQ.
    for (CPRefBand xxx_KQ : allKQBands) {
        xxx_KQ.setIndex(ix);
    }
}
 
Example #10
Source File: BandStructure.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
static private void printCDecl(Band b) {
    if (b instanceof MultiBand) {
        MultiBand mb = (MultiBand) b;
        for (int i = 0; i < mb.bandCount; i++) {
            printCDecl(mb.bands[i]);
        }
        return;
    }
    String ixS = "NULL";
    if (b instanceof CPRefBand) {
        Index ix = ((CPRefBand)b).index;
        if (ix != null)  ixS = "INDEX("+ix.debugName+")";
    }
    Coding[] knownc = { BYTE1, CHAR3, BCI5, BRANCH5, UNSIGNED5,
                        UDELTA5, SIGNED5, DELTA5, MDELTA5 };
    String[] knowns = { "BYTE1", "CHAR3", "BCI5", "BRANCH5", "UNSIGNED5",
                        "UDELTA5", "SIGNED5", "DELTA5", "MDELTA5" };
    Coding rc = b.regularCoding;
    int rci = Arrays.asList(knownc).indexOf(rc);
    String cstr;
    if (rci >= 0)
        cstr = knowns[rci];
    else
        cstr = "CODING"+rc.keyString();
    System.out.println("  BAND_INIT(\""+b.name()+"\""
                       +", "+cstr+", "+ixS+"),");
}
 
Example #11
Source File: BandStructure.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
Entry decodeRef(int n, Index ix) {
    if (n < 0 || n >= ix.size())
        Utils.log.warning("decoding bad ref "+n+" in "+ix);
    Entry e = ix.getEntry(n);
    if (verbose > 2)
        Utils.log.fine("getRef "+n+" => "+e);
    return e;
}
 
Example #12
Source File: BandStructure.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
private Entry decodeRefOrNull(int code, Index index) {
    // Inverse to encodeRefOrNull...
    int nonNullCode = code - (nullOK ? 1 : 0);
    if (nonNullCode == -1) {
        return null;
    } else {
        return decodeRef(nonNullCode, index);
    }
}
 
Example #13
Source File: BandStructure.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
int encodeRef(Entry e, Index ix) {
    if (ix == null)
        throw new RuntimeException("null index for " + e.stringValue());
    int coding = ix.indexOf(e);
    if (verbose > 2)
        Utils.log.fine("putRef "+coding+" => "+e);
    return coding;
}
 
Example #14
Source File: BandStructure.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private int encodeRefOrNull(Entry e, Index index) {
    int nonNullCode;  // NNC is the coding which assumes nulls are rare
    if (e == null) {
        nonNullCode = -1;  // negative values are rare
    } else {
        nonNullCode = encodeRef(e, index);
    }
    // If nulls are expected, increment, to make -1 code turn to 0.
    return (nullOK ? 1 : 0) + nonNullCode;
}
 
Example #15
Source File: BandStructure.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
private Entry decodeRefOrNull(int code, Index index) {
    // Inverse to encodeRefOrNull...
    int nonNullCode = code - (nullOK ? 1 : 0);
    if (nonNullCode == -1) {
        return null;
    } else {
        return decodeRef(nonNullCode, index);
    }
}
 
Example #16
Source File: BandStructure.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
protected void setConstantValueIndex(Field f) {
    Index ix = null;
    if (f != null) {
        byte tag = f.getLiteralTag();
        ix = getCPIndex(tag);
        if (verbose > 2)
            Utils.log.fine("setConstantValueIndex "+f+" "+ConstantPool.tagName(tag)+" => "+ix);
        assert(ix != null);
    }
    // Typically, allKQBands is the singleton of field_ConstantValue_KQ.
    for (CPRefBand xxx_KQ : allKQBands) {
        xxx_KQ.setIndex(ix);
    }
}
 
Example #17
Source File: BandStructure.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
private int encodeRefOrNull(Entry e, Index index) {
    int nonNullCode;  // NNC is the coding which assumes nulls are rare
    if (e == null) {
        nonNullCode = -1;  // negative values are rare
    } else {
        nonNullCode = encodeRef(e, index);
    }
    // If nulls are expected, increment, to make -1 code turn to 0.
    return (nullOK ? 1 : 0) + nonNullCode;
}
 
Example #18
Source File: BandStructure.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
protected void setConstantValueIndex(Field f) {
    Index ix = null;
    if (f != null) {
        byte tag = f.getLiteralTag();
        ix = getCPIndex(tag);
        if (verbose > 2)
            Utils.log.fine("setConstantValueIndex "+f+" "+ConstantPool.tagName(tag)+" => "+ix);
        assert(ix != null);
    }
    // Typically, allKQBands is the singleton of field_ConstantValue_KQ.
    for (CPRefBand xxx_KQ : allKQBands) {
        xxx_KQ.setIndex(ix);
    }
}
 
Example #19
Source File: BandStructure.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
static private void printCDecl(Band b) {
    if (b instanceof MultiBand) {
        MultiBand mb = (MultiBand) b;
        for (int i = 0; i < mb.bandCount; i++) {
            printCDecl(mb.bands[i]);
        }
        return;
    }
    String ixS = "NULL";
    if (b instanceof CPRefBand) {
        Index ix = ((CPRefBand)b).index;
        if (ix != null)  ixS = "INDEX("+ix.debugName+")";
    }
    Coding[] knownc = { BYTE1, CHAR3, BCI5, BRANCH5, UNSIGNED5,
                        UDELTA5, SIGNED5, DELTA5, MDELTA5 };
    String[] knowns = { "BYTE1", "CHAR3", "BCI5", "BRANCH5", "UNSIGNED5",
                        "UDELTA5", "SIGNED5", "DELTA5", "MDELTA5" };
    Coding rc = b.regularCoding;
    int rci = Arrays.asList(knownc).indexOf(rc);
    String cstr;
    if (rci >= 0)
        cstr = knowns[rci];
    else
        cstr = "CODING"+rc.keyString();
    System.out.println("  BAND_INIT(\""+b.name()+"\""
                       +", "+cstr+", "+ixS+"),");
}
 
Example #20
Source File: BandStructure.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
static private void printCDecl(Band b) {
    if (b instanceof MultiBand) {
        MultiBand mb = (MultiBand) b;
        for (int i = 0; i < mb.bandCount; i++) {
            printCDecl(mb.bands[i]);
        }
        return;
    }
    String ixS = "NULL";
    if (b instanceof CPRefBand) {
        Index ix = ((CPRefBand)b).index;
        if (ix != null)  ixS = "INDEX("+ix.debugName+")";
    }
    Coding[] knownc = { BYTE1, CHAR3, BCI5, BRANCH5, UNSIGNED5,
                        UDELTA5, SIGNED5, DELTA5, MDELTA5 };
    String[] knowns = { "BYTE1", "CHAR3", "BCI5", "BRANCH5", "UNSIGNED5",
                        "UDELTA5", "SIGNED5", "DELTA5", "MDELTA5" };
    Coding rc = b.regularCoding;
    int rci = Arrays.asList(knownc).indexOf(rc);
    String cstr;
    if (rci >= 0)
        cstr = knowns[rci];
    else
        cstr = "CODING"+rc.keyString();
    System.out.println("  BAND_INIT(\""+b.name()+"\""
                       +", "+cstr+", "+ixS+"),");
}
 
Example #21
Source File: BandStructure.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
static private void printCDecl(Band b) {
    if (b instanceof MultiBand) {
        MultiBand mb = (MultiBand) b;
        for (int i = 0; i < mb.bandCount; i++) {
            printCDecl(mb.bands[i]);
        }
        return;
    }
    String ixS = "NULL";
    if (b instanceof CPRefBand) {
        Index ix = ((CPRefBand)b).index;
        if (ix != null)  ixS = "INDEX("+ix.debugName+")";
    }
    Coding[] knownc = { BYTE1, CHAR3, BCI5, BRANCH5, UNSIGNED5,
                        UDELTA5, SIGNED5, DELTA5, MDELTA5 };
    String[] knowns = { "BYTE1", "CHAR3", "BCI5", "BRANCH5", "UNSIGNED5",
                        "UDELTA5", "SIGNED5", "DELTA5", "MDELTA5" };
    Coding rc = b.regularCoding;
    int rci = Arrays.asList(knownc).indexOf(rc);
    String cstr;
    if (rci >= 0)
        cstr = knowns[rci];
    else
        cstr = "CODING"+rc.keyString();
    System.out.println("  BAND_INIT(\""+b.name()+"\""
                       +", "+cstr+", "+ixS+"),");
}
 
Example #22
Source File: BandStructure.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private int encodeRefOrNull(Entry e, Index index) {
    int nonNullCode;  // NNC is the coding which assumes nulls are rare
    if (e == null) {
        nonNullCode = -1;  // negative values are rare
    } else {
        nonNullCode = encodeRef(e, index);
    }
    // If nulls are expected, increment, to make -1 code turn to 0.
    return (nullOK ? 1 : 0) + nonNullCode;
}
 
Example #23
Source File: BandStructure.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
private Entry decodeRefOrNull(int code, Index index) {
    // Inverse to encodeRefOrNull...
    int nonNullCode = code - (nullOK ? 1 : 0);
    if (nonNullCode == -1) {
        return null;
    } else {
        return decodeRef(nonNullCode, index);
    }
}
 
Example #24
Source File: BandStructure.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
protected void setConstantValueIndex(Field f) {
    Index ix = null;
    if (f != null) {
        byte tag = f.getLiteralTag();
        ix = getCPIndex(tag);
        if (verbose > 2)
            Utils.log.fine("setConstantValueIndex "+f+" "+ConstantPool.tagName(tag)+" => "+ix);
        assert(ix != null);
    }
    // Typically, allKQBands is the singleton of field_ConstantValue_KQ.
    for (CPRefBand xxx_KQ : allKQBands) {
        xxx_KQ.setIndex(ix);
    }
}
 
Example #25
Source File: BandStructure.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
Entry decodeRef(int n, Index ix) {
    if (n < 0 || n >= ix.size())
        Utils.log.warning("decoding bad ref "+n+" in "+ix);
    Entry e = ix.getEntry(n);
    if (verbose > 2)
        Utils.log.fine("getRef "+n+" => "+e);
    return e;
}
 
Example #26
Source File: BandStructure.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
private int encodeRefOrNull(Entry e, Index index) {
    int nonNullCode;  // NNC is the coding which assumes nulls are rare
    if (e == null) {
        nonNullCode = -1;  // negative values are rare
    } else {
        nonNullCode = encodeRef(e, index);
    }
    // If nulls are expected, increment, to make -1 code turn to 0.
    return (nullOK ? 1 : 0) + nonNullCode;
}
 
Example #27
Source File: BandStructure.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
Entry decodeRef(int n, Index ix) {
    if (n < 0 || n >= ix.size())
        Utils.log.warning("decoding bad ref "+n+" in "+ix);
    Entry e = ix.getEntry(n);
    if (verbose > 2)
        Utils.log.fine("getRef "+n+" => "+e);
    return e;
}
 
Example #28
Source File: BandStructure.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
int encodeRef(Entry e, Index ix) {
    if (ix == null)
        throw new RuntimeException("null index for " + e.stringValue());
    int coding = ix.indexOf(e);
    if (verbose > 2)
        Utils.log.fine("putRef "+coding+" => "+e);
    return coding;
}
 
Example #29
Source File: BandStructure.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
private Entry decodeRefOrNull(int code, Index index) {
    // Inverse to encodeRefOrNull...
    int nonNullCode = code - (nullOK ? 1 : 0);
    if (nonNullCode == -1) {
        return null;
    } else {
        return decodeRef(nonNullCode, index);
    }
}
 
Example #30
Source File: BandStructure.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
private int encodeRefOrNull(Entry e, Index index) {
    int nonNullCode;  // NNC is the coding which assumes nulls are rare
    if (e == null) {
        nonNullCode = -1;  // negative values are rare
    } else {
        nonNullCode = encodeRef(e, index);
    }
    // If nulls are expected, increment, to make -1 code turn to 0.
    return (nullOK ? 1 : 0) + nonNullCode;
}