< prev index next >

src/jdk.hotspot.agent/share/classes/sun/jvm/hotspot/oops/ConstantPool.java

Print this page




 679                   dos.writeShort(bsmIndex);
 680                   dos.writeShort(nameAndTypeIndex);
 681                   if (DEBUG) debugMessage("CP[" + ci + "] = INDY bsm = " +
 682                                           bsmIndex + ", N&T = " + nameAndTypeIndex);
 683                   break;
 684               }
 685 
 686               default:
 687                   throw new InternalError("Unknown tag: " + cpConstType);
 688           } // switch
 689       }
 690       dos.flush();
 691       return;
 692   }
 693 
 694   public void printValueOn(PrintStream tty) {
 695     tty.print("ConstantPool for " + getPoolHolder().getName().asString());
 696   }
 697 
 698   public long getSize() {
 699     return Oop.alignObjectSize(headerSize + getLength());
 700   }
 701 
 702   //----------------------------------------------------------------------
 703   // Internals only below this point
 704   //
 705 
 706   private static int extractHighShortFromInt(int val) {
 707     // must stay in sync with ConstantPool::name_and_type_at_put, method_at_put, etc.
 708     return (val >> 16) & 0xFFFF;
 709   }
 710 
 711   private static int extractLowShortFromInt(int val) {
 712     // must stay in sync with ConstantPool::name_and_type_at_put, method_at_put, etc.
 713     return val & 0xFFFF;
 714   }
 715 }


 679                   dos.writeShort(bsmIndex);
 680                   dos.writeShort(nameAndTypeIndex);
 681                   if (DEBUG) debugMessage("CP[" + ci + "] = INDY bsm = " +
 682                                           bsmIndex + ", N&T = " + nameAndTypeIndex);
 683                   break;
 684               }
 685 
 686               default:
 687                   throw new InternalError("Unknown tag: " + cpConstType);
 688           } // switch
 689       }
 690       dos.flush();
 691       return;
 692   }
 693 
 694   public void printValueOn(PrintStream tty) {
 695     tty.print("ConstantPool for " + getPoolHolder().getName().asString());
 696   }
 697 
 698   public long getSize() {
 699     return alignSize(headerSize + getLength());
 700   }
 701 
 702   //----------------------------------------------------------------------
 703   // Internals only below this point
 704   //
 705 
 706   private static int extractHighShortFromInt(int val) {
 707     // must stay in sync with ConstantPool::name_and_type_at_put, method_at_put, etc.
 708     return (val >> 16) & 0xFFFF;
 709   }
 710 
 711   private static int extractLowShortFromInt(int val) {
 712     // must stay in sync with ConstantPool::name_and_type_at_put, method_at_put, etc.
 713     return val & 0xFFFF;
 714   }
 715 }
< prev index next >