agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File 7012081 Cdiff agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java

agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2000, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 70,106 **** public long getObjectSize() { return alignObjectSize(baseOffset + getLength() * elementSize); } public ConstantPoolCacheEntry getEntryAt(int i) { ! if (Assert.ASSERTS_ENABLED) { ! Assert.that(0 <= i && i < getLength(), "index out of bounds"); ! } return new ConstantPoolCacheEntry(this, i); } public static boolean isSecondaryIndex(int i) { return (i < 0); } public static int decodeSecondaryIndex(int i) { return isSecondaryIndex(i) ? ~i : i; } public static int encodeSecondaryIndex(int i) { return !isSecondaryIndex(i) ? ~i : i; } // secondary entries hold invokedynamic call site bindings public ConstantPoolCacheEntry getSecondaryEntryAt(int i) { ! ConstantPoolCacheEntry e = new ConstantPoolCacheEntry(this, decodeSecondaryIndex(i)); if (Assert.ASSERTS_ENABLED) { ! Assert.that(e.isSecondaryEntry(), "must be a secondary entry"); } return e; } public ConstantPoolCacheEntry getMainEntryAt(int i) { if (isSecondaryIndex(i)) { // run through an extra level of indirection: ! i = getSecondaryEntryAt(i).getMainEntryIndex(); } ! ConstantPoolCacheEntry e = new ConstantPoolCacheEntry(this, i); if (Assert.ASSERTS_ENABLED) { ! Assert.that(!e.isSecondaryEntry(), "must not be a secondary entry"); } return e; } public int getIntAt(int entry, int fld) { --- 70,110 ---- public long getObjectSize() { return alignObjectSize(baseOffset + getLength() * elementSize); } public ConstantPoolCacheEntry getEntryAt(int i) { ! if (i < 0 || i >= getLength()) throw new IndexOutOfBoundsException(i + " " + getLength()); return new ConstantPoolCacheEntry(this, i); } public static boolean isSecondaryIndex(int i) { return (i < 0); } public static int decodeSecondaryIndex(int i) { return isSecondaryIndex(i) ? ~i : i; } public static int encodeSecondaryIndex(int i) { return !isSecondaryIndex(i) ? ~i : i; } // secondary entries hold invokedynamic call site bindings public ConstantPoolCacheEntry getSecondaryEntryAt(int i) { ! int rawIndex = i; ! if (isSecondaryIndex(i)) { ! rawIndex = decodeSecondaryIndex(i); ! } ! ConstantPoolCacheEntry e = getEntryAt(rawIndex); if (Assert.ASSERTS_ENABLED) { ! Assert.that(e.isSecondaryEntry(), "must be a secondary entry:" + rawIndex); } return e; } public ConstantPoolCacheEntry getMainEntryAt(int i) { + int primaryIndex = i; if (isSecondaryIndex(i)) { // run through an extra level of indirection: ! int rawIndex = decodeSecondaryIndex(i); ! primaryIndex = getEntryAt(rawIndex).getMainEntryIndex(); } ! ConstantPoolCacheEntry e = getEntryAt(primaryIndex); if (Assert.ASSERTS_ENABLED) { ! Assert.that(!e.isSecondaryEntry(), "must not be a secondary entry:" + primaryIndex); } return e; } public int getIntAt(int entry, int fld) {
agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java
Index Unified diffs Context diffs Sdiffs Patch New Old Previous File Next File