Changeset 309 for trunk/openjdk/hotspot/agent/src
- Timestamp:
- Feb 13, 2012, 10:07:12 PM (14 years ago)
- Location:
- trunk/openjdk
- Files:
-
- 37 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/openjdk
- Property svn:mergeinfo changed
/branches/vendor/oracle/openjdk6/b24 (added) merged: 308 /branches/vendor/oracle/openjdk6/current merged: 307
- Property svn:mergeinfo changed
-
trunk/openjdk/hotspot/agent/src/os/linux/libproc_impl.c
r278 r309 1 1 /* 2 * Copyright (c) 2003, 20 06, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * -
trunk/openjdk/hotspot/agent/src/os/linux/ps_core.c
r278 r309 1 1 /* 2 * Copyright (c) 2003, 20 09, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * -
trunk/openjdk/hotspot/agent/src/os/linux/ps_proc.c
r278 r309 1 1 /* 2 * Copyright (c) 2003, 20 08, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 122 122 #endif 123 123 124 #ifdef _LP64 125 #ifdef PTRACE_GETREGS64 124 #if defined(_LP64) && defined(PTRACE_GETREGS64) 126 125 #define PTRACE_GETREGS_REQ PTRACE_GETREGS64 127 #endif 128 #else 129 #if defined(PTRACE_GETREGS) || defined(PT_GETREGS) 126 #elif defined(PTRACE_GETREGS) 130 127 #define PTRACE_GETREGS_REQ PTRACE_GETREGS 131 #endif 132 #endif /* _LP64 */ 128 #elif defined(PT_GETREGS) 129 #define PTRACE_GETREGS_REQ PT_GETREGS 130 #endif 133 131 134 132 #ifdef PTRACE_GETREGS_REQ -
trunk/openjdk/hotspot/agent/src/os/linux/symtab.c
r278 r309 1 1 /* 2 * Copyright (c) 2003, 20 05, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * -
trunk/openjdk/hotspot/agent/src/os/linux/symtab.h
r278 r309 1 1 /* 2 * Copyright (c) 2003, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/CommandProcessor.java
r278 r309 1038 1038 } 1039 1039 public void visit(CodeBlob blob) { 1040 fout.println(gen.genHTML(blob. instructionsBegin()));1040 fout.println(gen.genHTML(blob.contentBegin())); 1041 1041 } 1042 1042 public void epilogue() { -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/HotSpotTypeDataBase.java
r278 r309 1 1 /* 2 * Copyright (c) 2000, 20 09, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 100 100 long typeEntryArrayStride; 101 101 102 // Fetch the address of the VMTypeEntry*. We get this symbol first 103 // and try to use it to make sure that symbol lookup is working. 104 Address entryAddr = lookupInProcess("gHotSpotVMTypes"); 105 // System.err.println("gHotSpotVMTypes address = " + entryAddr); 106 // Dereference this once to get the pointer to the first VMTypeEntry 107 // dumpMemory(entryAddr, 80); 108 entryAddr = entryAddr.getAddressAt(0); 109 110 if (entryAddr == null) { 111 throw new RuntimeException("gHotSpotVMTypes was not initialized properly in the remote process; can not continue"); 112 } 113 102 114 typeEntryTypeNameOffset = getLongValueFromProcess("gHotSpotVMTypeEntryTypeNameOffset"); 103 115 typeEntrySuperclassNameOffset = getLongValueFromProcess("gHotSpotVMTypeEntrySuperclassNameOffset"); … … 107 119 typeEntrySizeOffset = getLongValueFromProcess("gHotSpotVMTypeEntrySizeOffset"); 108 120 typeEntryArrayStride = getLongValueFromProcess("gHotSpotVMTypeEntryArrayStride"); 109 110 // Fetch the address of the VMTypeEntry*111 Address entryAddr = lookupInProcess("gHotSpotVMTypes");112 // System.err.println("gHotSpotVMTypes address = " + entryAddr);113 // Dereference this once to get the pointer to the first VMTypeEntry114 // dumpMemory(entryAddr, 80);115 entryAddr = entryAddr.getAddressAt(0);116 117 if (entryAddr == null) {118 throw new RuntimeException("gHotSpotVMTypes was not initialized properly in the remote process; can not continue");119 }120 121 121 122 // Start iterating down it until we find an entry with no name -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/c1/Runtime1.java
r278 r309 1 1 /* 2 * Copyright (c) 2000, 20 03, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 55 55 /** FIXME: consider making argument "type-safe" in Java port */ 56 56 public Address entryFor(int id) { 57 return blobFor(id). instructionsBegin();57 return blobFor(id).codeBegin(); 58 58 } 59 59 -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/CodeBlob.java
r278 r309 1 1 /* 2 * Copyright (c) 2000, 20 05, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 40 40 private static CIntegerField headerSizeField; 41 41 private static CIntegerField relocationSizeField; 42 private static CIntegerField instructionsOffsetField; 42 private static CIntegerField contentOffsetField; 43 private static CIntegerField codeOffsetField; 43 44 private static CIntegerField frameCompleteOffsetField; 44 45 private static CIntegerField dataOffsetField; … … 69 70 relocationSizeField = type.getCIntegerField("_relocation_size"); 70 71 frameCompleteOffsetField = type.getCIntegerField("_frame_complete_offset"); 71 instructionsOffsetField = type.getCIntegerField("_instructions_offset"); 72 contentOffsetField = type.getCIntegerField("_content_offset"); 73 codeOffsetField = type.getCIntegerField("_code_offset"); 72 74 dataOffsetField = type.getCIntegerField("_data_offset"); 73 75 frameSizeField = type.getCIntegerField("_frame_size"); … … 112 114 // public RelocInfo relocationEnd(); 113 115 114 public Address instructionsBegin() { 115 return headerBegin().addOffsetTo(instructionsOffsetField.getValue(addr)); 116 } 117 118 public Address instructionsEnd() { 116 public Address contentBegin() { 117 return headerBegin().addOffsetTo(contentOffsetField.getValue(addr)); 118 } 119 120 public Address contentEnd() { 121 return headerBegin().addOffsetTo(dataOffsetField.getValue(addr)); 122 } 123 124 public Address codeBegin() { 125 return headerBegin().addOffsetTo(contentOffsetField.getValue(addr)); 126 } 127 128 public Address codeEnd() { 119 129 return headerBegin().addOffsetTo(dataOffsetField.getValue(addr)); 120 130 } … … 129 139 130 140 // Offsets 131 public int getRelocationOffset() { return (int) headerSizeField.getValue(addr); } 132 public int getInstructionsOffset() { return (int) instructionsOffsetField.getValue(addr); } 133 public int getDataOffset() { return (int) dataOffsetField.getValue(addr); } 141 public int getRelocationOffset() { return (int) headerSizeField .getValue(addr); } 142 public int getContentOffset() { return (int) contentOffsetField.getValue(addr); } 143 public int getCodeOffset() { return (int) codeOffsetField .getValue(addr); } 144 public int getDataOffset() { return (int) dataOffsetField .getValue(addr); } 134 145 135 146 // Sizes 136 public int getSize() { return (int) sizeField .getValue(addr);}137 public int getHeaderSize() { return (int) headerSizeField.getValue(addr); 147 public int getSize() { return (int) sizeField .getValue(addr); } 148 public int getHeaderSize() { return (int) headerSizeField.getValue(addr); } 138 149 // FIXME: add getRelocationSize() 139 public int getInstructionsSize() { return (int) instructionsEnd().minus(instructionsBegin()); } 140 public int getDataSize() { return (int) dataEnd().minus(dataBegin()); } 150 public int getContentSize() { return (int) contentEnd().minus(contentBegin()); } 151 public int getCodeSize() { return (int) codeEnd() .minus(codeBegin()); } 152 public int getDataSize() { return (int) dataEnd() .minus(dataBegin()); } 141 153 142 154 // Containment 143 public boolean blobContains(Address addr) { return headerBegin().lessThanOrEqual(addr) && dataEnd().greaterThan(addr);}155 public boolean blobContains(Address addr) { return headerBegin() .lessThanOrEqual(addr) && dataEnd() .greaterThan(addr); } 144 156 // FIXME: add relocationContains 145 public boolean instructionsContains(Address addr) { return instructionsBegin().lessThanOrEqual(addr) && instructionsEnd().greaterThan(addr); } 146 public boolean dataContains(Address addr) { return dataBegin().lessThanOrEqual(addr) && dataEnd().greaterThan(addr); } 147 public boolean contains(Address addr) { return instructionsContains(addr); } 148 public boolean isFrameCompleteAt(Address a) { return instructionsContains(a) && a.minus(instructionsBegin()) >= frameCompleteOffsetField.getValue(addr); } 157 public boolean contentContains(Address addr) { return contentBegin().lessThanOrEqual(addr) && contentEnd().greaterThan(addr); } 158 public boolean codeContains(Address addr) { return codeBegin() .lessThanOrEqual(addr) && codeEnd() .greaterThan(addr); } 159 public boolean dataContains(Address addr) { return dataBegin() .lessThanOrEqual(addr) && dataEnd() .greaterThan(addr); } 160 public boolean contains(Address addr) { return contentContains(addr); } 161 public boolean isFrameCompleteAt(Address a) { return codeContains(a) && a.minus(codeBegin()) >= frameCompleteOffsetField.getValue(addr); } 149 162 150 163 // Reclamation support (really only used by the nmethods, but in order to get asserts to work … … 169 182 Assert.that(getOopMaps() != null, "nope"); 170 183 } 171 return getOopMaps().findMapAtOffset(pc.minus( instructionsBegin()), debugging);184 return getOopMaps().findMapAtOffset(pc.minus(codeBegin()), debugging); 172 185 } 173 186 … … 201 214 202 215 protected void printComponentsOn(PrintStream tty) { 203 tty.println(" instructions: [" + instructionsBegin() + ", " + instructionsEnd() + "), " + 216 tty.println(" content: [" + contentBegin() + ", " + contentEnd() + "), " + 217 " code: [" + codeBegin() + ", " + codeEnd() + "), " + 204 218 " data: [" + dataBegin() + ", " + dataEnd() + "), " + 205 219 " frame size: " + getFrameSize()); -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/NMethod.java
r278 r309 135 135 136 136 /** Boundaries for different parts */ 137 public Address constantsBegin() { return instructionsBegin();}137 public Address constantsBegin() { return contentBegin(); } 138 138 public Address constantsEnd() { return getEntryPoint(); } 139 public Address codeBegin() { return getEntryPoint();}140 public Address codeEnd(){ return headerBegin().addOffsetTo(getStubOffset()); }139 public Address instsBegin() { return codeBegin(); } 140 public Address instsEnd() { return headerBegin().addOffsetTo(getStubOffset()); } 141 141 public Address exceptionBegin() { return headerBegin().addOffsetTo(getExceptionOffset()); } 142 142 public Address deoptBegin() { return headerBegin().addOffsetTo(getDeoptOffset()); } … … 157 157 158 158 public int constantsSize() { return (int) constantsEnd() .minus(constantsBegin()); } 159 public int codeSize() { return (int) codeEnd() .minus(codeBegin());}159 public int instsSize() { return (int) instsEnd() .minus(instsBegin()); } 160 160 public int stubSize() { return (int) stubEnd() .minus(stubBegin()); } 161 161 public int oopsSize() { return (int) oopsEnd() .minus(oopsBegin()); } … … 170 170 return 171 171 constantsSize() + 172 codeSize()+172 instsSize() + 173 173 stubSize() + 174 174 scopesDataSize() + … … 180 180 181 181 public boolean constantsContains (Address addr) { return constantsBegin() .lessThanOrEqual(addr) && constantsEnd() .greaterThan(addr); } 182 public boolean codeContains (Address addr) { return codeBegin() .lessThanOrEqual(addr) && codeEnd().greaterThan(addr); }182 public boolean instsContains (Address addr) { return instsBegin() .lessThanOrEqual(addr) && instsEnd() .greaterThan(addr); } 183 183 public boolean stubContains (Address addr) { return stubBegin() .lessThanOrEqual(addr) && stubEnd() .greaterThan(addr); } 184 184 public boolean oopsContains (Address addr) { return oopsBegin() .lessThanOrEqual(addr) && oopsEnd() .greaterThan(addr); } … … 354 354 protected void printComponentsOn(PrintStream tty) { 355 355 // FIXME: add relocation information 356 tty.println(" instructions: [" + instructionsBegin() + ", " + instructionsEnd() + "), " + 356 tty.println(" content: [" + contentBegin() + ", " + contentEnd() + "), " + 357 " code: [" + codeBegin() + ", " + codeEnd() + "), " + 357 358 " data: [" + dataBegin() + ", " + dataEnd() + "), " + 358 359 " oops: [" + oopsBegin() + ", " + oopsEnd() + "), " + -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/code/PCDesc.java
r278 r309 1 1 /* 2 * Copyright (c) 2000, 20 09, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 76 76 77 77 public Address getRealPC(NMethod code) { 78 return code. instructionsBegin().addOffsetTo(getPCOffset());78 return code.codeBegin().addOffsetTo(getPCOffset()); 79 79 } 80 80 -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/COFFFileParser.java
r278 r309 1 1 /* 2 * Copyright (c) 2000, 20 04, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 123 123 private MemoizedObject[] symbols; 124 124 125 // Init stringTable at decl time since other fields init'ed in the 126 // constructor need the String Table. 125 127 private MemoizedObject stringTable = new MemoizedObject() { 126 128 public Object computeValue() { 129 // the String Table follows the Symbol Table 127 130 int ptr = getPointerToSymbolTable(); 128 131 if (ptr == 0) { 132 // no Symbol Table so no String Table 129 133 return new StringTable(0); 130 134 } else { … … 141 145 pointerToSymbolTable = readInt(); 142 146 numberOfSymbols = readInt(); 147 // String Table can be accessed at this point because 148 // pointerToSymbolTable and numberOfSymbols fields are set. 143 149 sizeOfOptionalHeader = readShort(); 144 150 characteristics = readShort(); … … 223 229 private MemoizedObject dataDirectories; 224 230 231 // We use an offset of 2 because OptionalHeaderStandardFieldsImpl doesn't 232 // include the 'magic' field. 225 233 private static final int STANDARD_FIELDS_OFFSET = 2; 226 234 private static final int PE32_WINDOWS_SPECIFIC_FIELDS_OFFSET = 28; … … 289 297 private int addressOfEntryPoint; 290 298 private int baseOfCode; 291 private int baseOfData; 299 private int baseOfData; // only set in PE32 292 300 293 301 OptionalHeaderStandardFieldsImpl(int offset, … … 302 310 addressOfEntryPoint = readInt(); 303 311 baseOfCode = readInt(); 304 if (isPE32Plus) { 312 if (!isPE32Plus) { 313 // only available in PE32 305 314 baseOfData = readInt(); 306 315 } … … 434 443 return null; 435 444 } 436 return new ExportDirectoryTableImpl(rvaToFileOffset(dir.getRVA()), dir.getSize()); 445 // ExportDirectoryTableImpl needs both the RVA and the 446 // RVA converted to a file offset. 447 return new 448 ExportDirectoryTableImpl(dir.getRVA(), dir.getSize()); 437 449 } 438 450 }; … … 527 539 528 540 class ExportDirectoryTableImpl implements ExportDirectoryTable { 541 private int exportDataDirRVA; 529 542 private int offset; 530 543 private int size; … … 549 562 private MemoizedObject exportAddressTable; 550 563 551 ExportDirectoryTableImpl(int offset, int size) { 552 this.offset = offset; 564 ExportDirectoryTableImpl(int exportDataDirRVA, int size) { 565 this.exportDataDirRVA = exportDataDirRVA; 566 offset = rvaToFileOffset(exportDataDirRVA); 553 567 this.size = size; 554 568 seek(offset); … … 596 610 exportOrdinalTable = new MemoizedObject() { 597 611 public Object computeValue() { 612 // number of ordinals is same as the number of name pointers 598 613 short[] ordinals = new short[getNumberOfNamePointers()]; 599 614 seek(rvaToFileOffset(getOrdinalTableRVA())); … … 609 624 int[] addresses = new int[getNumberOfAddressTableEntries()]; 610 625 seek(rvaToFileOffset(getExportAddressTableRVA())); 611 // Must make two passes to avoid rvaToFileOffset 612 // destroying seek() position 626 // The Export Address Table values are a union of two 627 // possible values: 628 // Export RVA - The address of the exported symbol when 629 // loaded into memory, relative to the image base. 630 // This value doesn't get converted into a file offset. 631 // Forwarder RVA - The pointer to a null-terminated ASCII 632 // string in the export section. This value gets 633 // converted into a file offset because we have to 634 // fetch the string. 613 635 for (int i = 0; i < addresses.length; i++) { 614 636 addresses[i] = readInt(); 615 }616 for (int i = 0; i < addresses.length; i++) {617 addresses[i] = rvaToFileOffset(addresses[i]);618 637 } 619 638 return addresses; … … 649 668 public boolean isExportAddressForwarder(short ordinal) { 650 669 int addr = getExportAddress(ordinal); 651 return ((offset <= addr) && (addr < (offset + size))); 670 return ((exportDataDirRVA <= addr) && 671 (addr < (exportDataDirRVA + size))); 652 672 } 653 673 654 674 public String getExportAddressForwarder(short ordinal) { 655 seek( getExportAddress(ordinal));675 seek(rvaToFileOffset(getExportAddress(ordinal))); 656 676 return readCString(); 657 677 } … … 3372 3392 } 3373 3393 // Look up in string table 3394 // FIXME: this index value is assumed to be in the valid range 3374 3395 name = getStringTable().get(index); 3375 3396 } else { 3376 3397 try { 3377 name = new String(tmpName, US_ASCII); 3398 int length = 0; 3399 // find last non-NULL 3400 for (; length < tmpName.length && tmpName[length] != '\0';) { 3401 length++; 3402 } 3403 // don't include NULL chars in returned name String 3404 name = new String(tmpName, 0, length, US_ASCII); 3378 3405 } catch (UnsupportedEncodingException e) { 3379 3406 throw new COFFException(e); … … 3488 3515 tmpName[6] << 8 | 3489 3516 tmpName[7]); 3517 // FIXME: stringOffset is assumed to be in the valid range 3490 3518 name = getStringTable().getAtOffset(stringOffset); 3491 3519 } … … 3699 3727 StringTable(int offset) { 3700 3728 if (offset == 0) { 3729 // no String Table 3701 3730 strings = new COFFString[0]; 3702 3731 return; … … 3704 3733 3705 3734 seek(offset); 3706 int length = readInt(); 3735 int length = readInt(); // length includes itself 3707 3736 byte[] data = new byte[length - 4]; 3708 3737 int numBytesRead = readBytes(data); -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/DumpExports.java
r278 r309 1 1 /* 2 * Copyright (c) 2001, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 38 38 String filename = args[0]; 39 39 COFFFile file = COFFFileParser.getParser().parse(filename); 40 ExportDirectoryTable exports = 41 file.getHeader(). 42 getOptionalHeader(). 43 getDataDirectories(). 44 getExportDirectoryTable(); 40 41 // get common point for both things we want to dump 42 OptionalHeaderDataDirectories dataDirs = file.getHeader().getOptionalHeader(). 43 getDataDirectories(); 44 45 // dump the header data directory for the Export Table: 46 DataDirectory dir = dataDirs.getExportTable(); 47 System.out.println("Export table: RVA = " + dir.getRVA() + "/0x" + 48 Integer.toHexString(dir.getRVA()) + ", size = " + dir.getSize() + "/0x" + 49 Integer.toHexString(dir.getSize())); 50 51 System.out.println(file.getHeader().getNumberOfSections() + " sections in file"); 52 for (int i = 1; i <= file.getHeader().getNumberOfSections(); i++) { 53 SectionHeader sec = file.getHeader().getSectionHeader(i); 54 System.out.println(" Section " + i + ":"); 55 System.out.println(" Name = '" + sec.getName() + "'"); 56 System.out.println(" VirtualSize = " + sec.getSize() + "/0x" + 57 Integer.toHexString(sec.getSize())); 58 System.out.println(" VirtualAddress = " + sec.getVirtualAddress() + "/0x" + 59 Integer.toHexString(sec.getVirtualAddress())); 60 System.out.println(" SizeOfRawData = " + sec.getSizeOfRawData() + "/0x" + 61 Integer.toHexString(sec.getSizeOfRawData())); 62 System.out.println(" PointerToRawData = " + sec.getPointerToRawData() + "/0x" + 63 Integer.toHexString(sec.getPointerToRawData())); 64 } 65 66 ExportDirectoryTable exports = dataDirs.getExportDirectoryTable(); 45 67 if (exports == null) { 46 68 System.out.println("No exports found."); 47 69 } else { 48 System.out.println(file.getHeader().getNumberOfSections() + " sections in file");49 for (int i = 0; i < file.getHeader().getNumberOfSections(); i++) {50 System.out.println(" Section " + i + ": " + file.getHeader().getSectionHeader(1 + i).getName());51 }52 53 DataDirectory dir = file.getHeader().getOptionalHeader().getDataDirectories().getExportTable();54 System.out.println("Export table: RVA = 0x" + Integer.toHexString(dir.getRVA()) +55 ", size = 0x" + Integer.toHexString(dir.getSize()));56 57 70 System.out.println("DLL name: " + exports.getDLLName()); 58 71 System.out.println("Time/date stamp 0x" + Integer.toHexString(exports.getTimeDateStamp())); 59 72 System.out.println("Major version 0x" + Integer.toHexString(exports.getMajorVersion() & 0xFFFF)); 60 73 System.out.println("Minor version 0x" + Integer.toHexString(exports.getMinorVersion() & 0xFFFF)); 61 System.out.println(exports.getNumberOfNamePointers() + " functions found");74 System.out.println(exports.getNumberOfNamePointers() + " exports found"); 62 75 for (int i = 0; i < exports.getNumberOfNamePointers(); i++) { 63 System.out.println(" 0x" +64 Integer.toHexString(exports.getExportAddress(exports.getExportOrdinal(i)))+65 " " +66 (exports.isExportAddressForwarder(exports.getExportOrdinal(i)) ?67 ("Forwarded to " + exports.getExportAddressForwarder(exports.getExportOrdinal(i))) :68 exports.getExportName(i)));76 short ordinal = exports.getExportOrdinal(i); 77 System.out.print("[" + i + "] '" + exports.getExportName(i) + "': [" + 78 ordinal + "] = 0x" + Integer.toHexString(exports.getExportAddress(ordinal))); 79 System.out.println(exports.isExportAddressForwarder(ordinal) 80 ? " Forwarded to '" + exports.getExportAddressForwarder(ordinal) + "'" 81 : ""); 69 82 } 70 83 } -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/win32/coff/TestParser.java
r278 r309 1 1 /* 2 * Copyright (c) 2000, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 43 43 int numSections = header.getNumberOfSections(); 44 44 System.out.println(numSections + " sections detected."); 45 for (int i = 0; i <numSections; i++) {46 SectionHeader secHeader = header.getSectionHeader( 1 +i);45 for (int i = 1; i <= numSections; i++) { 46 SectionHeader secHeader = header.getSectionHeader(i); 47 47 System.out.println(secHeader.getName()); 48 48 } -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/debugger/windbg/WindbgDebuggerLocal.java
r278 r309 1 1 /* 2 * Copyright (c) 2002, 20 08, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 507 507 } 508 508 509 private static String DTFWHome;510 509 private static String imagePath; 511 510 private static String symbolPath; … … 515 514 516 515 /* 517 * sawindbg.dll depends on dbgeng.dll which 518 * itself depends on dbghelp.dll. dbgeng.dll and dbghelp.dll. 519 * On systems newer than Windows 2000, these two .dlls are 520 * in the standard system directory so we will find them there. 521 * On Windows 2000 and earlier, these files do not exist. 522 * The user must download Debugging Tools For Windows (DTFW) 523 * and install it in order to use SA. 516 * sawindbg.dll depends on dbgeng.dll which itself depends on 517 * dbghelp.dll. We have to make sure that the dbgeng.dll and 518 * dbghelp.dll that we load are compatible with each other. We 519 * load both of those libraries from the same directory based 520 * on the theory that co-located libraries are compatible. 524 521 * 525 * We have to make sure we use the two files from the same directory 526 * in case there are more than one copy on the system because 527 * one version of dbgeng.dll might not be compatible with a 528 * different version of dbghelp.dll. 529 * We first look for them in the directory pointed at by 530 * env. var. DEBUGGINGTOOLSFORWINDOWS, next in the default 531 * installation dir for DTFW, and lastly in the standard 532 * system directory. We expect that that we will find 533 * them in the standard system directory on all systems 534 * newer than Windows 2000. 522 * On Windows 2000 and earlier, dbgeng.dll and dbghelp.dll were 523 * not included as part of the standard system directory. On 524 * systems newer than Windows 2000, dbgeng.dll and dbghelp.dll 525 * are included in the standard system directory. However, the 526 * versions included in the standard system directory may not 527 * be able to handle symbol information for the newer compilers. 528 * 529 * We search for and explicitly load the libraries using the 530 * following directory search order: 531 * 532 * - java.home/bin (same as $JAVA_HOME/jre/bin) 533 * - dir named by DEBUGGINGTOOLSFORWINDOWS environment variable 534 * - various "Debugging Tools For Windows" program directories 535 * - the system directory ($SYSROOT/system32) 536 * 537 * If SA is invoked with -Dsun.jvm.hotspot.loadLibrary.DEBUG=1, 538 * then debug messages about library loading are printed to 539 * System.err. 535 540 */ 536 String dirName = null; 537 DTFWHome = System.getenv("DEBUGGINGTOOLSFORWINDOWS"); 538 539 if (DTFWHome == null) { 540 // See if we have the files in the default location. 541 542 String dbgengPath = null; 543 String dbghelpPath = null; 544 String sawindbgPath = null; 545 List searchList = new ArrayList(); 546 547 boolean loadLibraryDEBUG = 548 System.getProperty("sun.jvm.hotspot.loadLibrary.DEBUG") != null; 549 550 { 551 // First place to search is co-located with sawindbg.dll in 552 // $JAVA_HOME/jre/bin (java.home property is set to $JAVA_HOME/jre): 553 searchList.add(System.getProperty("java.home") + File.separator + "bin"); 554 sawindbgPath = (String) searchList.get(0) + File.separator + 555 "sawindbg.dll"; 556 557 // second place to search is specified by an environment variable: 558 String DTFWHome = System.getenv("DEBUGGINGTOOLSFORWINDOWS"); 559 if (DTFWHome != null) { 560 searchList.add(DTFWHome); 561 } 562 563 // The third place to search is the install directory for the 564 // "Debugging Tools For Windows" package; so far there are three 565 // name variations that we know of: 541 566 String sysRoot = System.getenv("SYSTEMROOT"); 542 DTFWHome = sysRoot + File.separator + 543 ".." + File.separator + "Program Files" + 544 File.separator + "Debugging Tools For Windows"; 545 } 546 547 { 548 String dbghelp = DTFWHome + File.separator + "dbghelp.dll"; 549 String dbgeng = DTFWHome + File.separator + "dbgeng.dll"; 550 File fhelp = new File(dbghelp); 551 File feng = new File(dbgeng); 552 if (fhelp.exists() && feng.exists()) { 553 // found both, we are happy. 554 // NOTE: The order of loads is important! If we load dbgeng.dll 555 // first, then the dependency - dbghelp.dll - will be loaded 556 // from usual DLL search thereby defeating the purpose! 557 System.load(dbghelp); 558 System.load(dbgeng); 559 } else if (! fhelp.exists() && ! feng.exists()) { 560 // neither exist. We will ignore this dir and assume 561 // they are in the system dir. 562 DTFWHome = null; 567 DTFWHome = sysRoot + File.separator + ".." + File.separator + 568 "Program Files" + File.separator + "Debugging Tools For Windows"; 569 searchList.add(DTFWHome); 570 searchList.add(DTFWHome + " (x86)"); 571 searchList.add(DTFWHome + " (x64)"); 572 573 // The last place to search is the system directory: 574 searchList.add(sysRoot + File.separator + "system32"); 575 } 576 577 for (int i = 0; i < searchList.size(); i++) { 578 File dir = new File((String) searchList.get(i)); 579 if (!dir.exists()) { 580 if (loadLibraryDEBUG) { 581 System.err.println("DEBUG: '" + searchList.get(i) + 582 "': directory does not exist."); 583 } 584 // this search directory doesn't exist so skip it 585 continue; 586 } 587 588 dbgengPath = (String) searchList.get(i) + File.separator + "dbgeng.dll"; 589 dbghelpPath = (String) searchList.get(i) + File.separator + "dbghelp.dll"; 590 591 File feng = new File(dbgengPath); 592 File fhelp = new File(dbghelpPath); 593 if (feng.exists() && fhelp.exists()) { 594 // both files exist so we have a match 595 break; 596 } 597 598 // At least one of the files does not exist; no warning if both 599 // don't exist. If just one doesn't exist then we don't check 600 // loadLibraryDEBUG because we have a mis-configured system. 601 if (feng.exists()) { 602 System.err.println("WARNING: found '" + dbgengPath + 603 "' but did not find '" + dbghelpPath + "'; ignoring '" + 604 dbgengPath + "'."); 605 } else if (fhelp.exists()) { 606 System.err.println("WARNING: found '" + dbghelpPath + 607 "' but did not find '" + dbgengPath + "'; ignoring '" + 608 dbghelpPath + "'."); 609 } else if (loadLibraryDEBUG) { 610 System.err.println("DEBUG: searched '" + searchList.get(i) + 611 "': dbgeng.dll and dbghelp.dll were not found."); 612 } 613 dbgengPath = null; 614 dbghelpPath = null; 615 } 616 617 if (dbgengPath == null || dbghelpPath == null) { 618 // at least one of the files wasn't found anywhere we searched 619 String mesg = null; 620 621 if (dbgengPath == null && dbghelpPath == null) { 622 mesg = "dbgeng.dll and dbghelp.dll cannot be found. "; 623 } else if (dbgengPath == null) { 624 mesg = "dbgeng.dll cannot be found (dbghelp.dll was found). "; 563 625 } else { 564 // one exists but not the other 565 //System.err.println("Error: Both files dbghelp.dll and dbgeng.dll " 566 // "must exist in directory " + DTFWHome); 567 throw new UnsatisfiedLinkError("Both files dbghelp.dll and " + 568 "dbgeng.dll must exist in " + 569 "directory " + DTFWHome); 570 } 571 } 572 if (DTFWHome == null) { 573 // The files better be in the system dir. 574 String sysDir = System.getenv("SYSTEMROOT") + 575 File.separator + "system32"; 576 577 File feng = new File(sysDir + File.separator + "dbgeng.dll"); 578 if (!feng.exists()) { 579 throw new UnsatisfiedLinkError("File dbgeng.dll does not exist in " + 580 sysDir + ". Please search microsoft.com " + 581 "for Debugging Tools For Windows, and " + 582 "either download it to the default " + 583 "location, or download it to a custom " + 584 "location and set environment variable " + 585 " DEBUGGINGTOOLSFORWINDOWS " + 586 "to the pathname of that location."); 587 } 588 } 626 mesg = "dbghelp.dll cannot be found (dbgeng.dll was found). "; 627 } 628 throw new UnsatisfiedLinkError(mesg + 629 "Please search microsoft.com for 'Debugging Tools For Windows', " + 630 "and either download it to the default location, or download it " + 631 "to a custom location and set environment variable " + 632 "'DEBUGGINGTOOLSFORWINDOWS' to the pathname of that location."); 633 } 634 635 // NOTE: The order of loads is important! If we load dbgeng.dll 636 // first, then the dependency - dbghelp.dll - will be loaded 637 // from usual DLL search thereby defeating the purpose! 638 if (loadLibraryDEBUG) { 639 System.err.println("DEBUG: loading '" + dbghelpPath + "'."); 640 } 641 System.load(dbghelpPath); 642 if (loadLibraryDEBUG) { 643 System.err.println("DEBUG: loading '" + dbgengPath + "'."); 644 } 645 System.load(dbgengPath); 589 646 590 647 // Now, load sawindbg.dll 591 System.loadLibrary("sawindbg"); 648 if (loadLibraryDEBUG) { 649 System.err.println("DEBUG: loading '" + sawindbgPath + "'."); 650 } 651 System.load(sawindbgPath); 652 592 653 // where do I find '.exe', '.dll' files? 593 654 imagePath = System.getProperty("sun.jvm.hotspot.debugger.windbg.imagePath"); -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeInvoke.java
r278 r309 1 1 /* 2 * Copyright (c) 2001, 20 03, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeLoadConstant.java
r278 r309 1 1 /* 2 * Copyright (c) 2002, 20 03, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 189 189 throw new RuntimeException("should not reach here"); 190 190 } 191 } else if (ctag.isMethodHandle() || ctag.isMethodType()) {191 } else if (ctag.isMethodHandle()) { 192 192 Oop x = getCachedConstant(); 193 193 int refidx = cpool.getMethodHandleIndexAt(cpIndex); -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/BytecodeWithCPIndex.java
r278 r309 1 1 /* 2 * Copyright (c) 2002, 20 03, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/interpreter/Bytecodes.java
r278 r309 1 1 /* 2 * Copyright (c) 2001, 20 04, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/CompactibleFreeListSpace.java
r278 r309 1 1 /* 2 * Copyright (c) 2003, 20 09, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/memory/SystemDictionary.java
r278 r309 1 1 /* 2 * Copyright (c) 2001, 20 08, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPool.java
r278 r309 54 54 Type type = db.lookupType("constantPoolOopDesc"); 55 55 tags = new OopField(type.getOopField("_tags"), 0); 56 operands = new OopField(type.getOopField("_operands"), 0); 56 57 cache = new OopField(type.getOopField("_cache"), 0); 57 58 poolHolder = new OopField(type.getOopField("_pool_holder"), 0); … … 59 60 headerSize = type.getSize(); 60 61 elementSize = 0; 62 // fetch constants: 63 INDY_BSM_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_indy_bsm_offset").intValue(); 64 INDY_ARGC_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_indy_argc_offset").intValue(); 65 INDY_ARGV_OFFSET = db.lookupIntConstant("constantPoolOopDesc::_indy_argv_offset").intValue(); 61 66 } 62 67 … … 68 73 69 74 private static OopField tags; 75 private static OopField operands; 70 76 private static OopField cache; 71 77 private static OopField poolHolder; … … 75 81 private static long elementSize; 76 82 83 private static int INDY_BSM_OFFSET; 84 private static int INDY_ARGC_OFFSET; 85 private static int INDY_ARGV_OFFSET; 86 77 87 public TypeArray getTags() { return (TypeArray) tags.getValue(this); } 88 public TypeArray getOperands() { return (TypeArray) operands.getValue(this); } 78 89 public ConstantPoolCache getCache() { return (ConstantPoolCache) cache.getValue(this); } 79 90 public Klass getPoolHolder() { return (Klass) poolHolder.getValue(this); } … … 277 288 } 278 289 return res; 290 } 291 292 /** Lookup for multi-operand (InvokeDynamic) entries. */ 293 public short[] getBootstrapSpecifierAt(int i) { 294 if (Assert.ASSERTS_ENABLED) { 295 Assert.that(getTagAt(i).isInvokeDynamic(), "Corrupted constant pool"); 296 } 297 if (getTagAt(i).value() == JVM_CONSTANT_InvokeDynamicTrans) 298 return null; 299 int bsmSpec = extractLowShortFromInt(this.getIntAt(i)); 300 TypeArray operands = getOperands(); 301 if (operands == null) return null; // safety first 302 int basePos = VM.getVM().buildIntFromShorts(operands.getShortAt(bsmSpec * 2 + 0), 303 operands.getShortAt(bsmSpec * 2 + 1)); 304 int argv = basePos + INDY_ARGV_OFFSET; 305 int argc = operands.getShortAt(basePos + INDY_ARGC_OFFSET); 306 int endPos = argv + argc; 307 short[] values = new short[endPos - basePos]; 308 for (int j = 0; j < values.length; j++) { 309 values[j] = operands.getShortAt(basePos+j); 310 } 311 return values; 279 312 } 280 313 … … 299 332 case JVM_CONSTANT_MethodType: return "JVM_CONSTANT_MethodType"; 300 333 case JVM_CONSTANT_InvokeDynamic: return "JVM_CONSTANT_InvokeDynamic"; 334 case JVM_CONSTANT_InvokeDynamicTrans: return "JVM_CONSTANT_InvokeDynamic/transitional"; 301 335 case JVM_CONSTANT_Invalid: return "JVM_CONSTANT_Invalid"; 302 336 case JVM_CONSTANT_UnresolvedClass: return "JVM_CONSTANT_UnresolvedClass"; … … 358 392 case JVM_CONSTANT_MethodType: 359 393 case JVM_CONSTANT_InvokeDynamic: 394 case JVM_CONSTANT_InvokeDynamicTrans: 360 395 visitor.doInt(new IntField(new NamedFieldIdentifier(nameForTag(ctag)), indexOffset(index), true), true); 361 396 break; … … 521 556 } 522 557 558 case JVM_CONSTANT_InvokeDynamicTrans: 523 559 case JVM_CONSTANT_InvokeDynamic: { 524 560 dos.writeByte(cpConstType); 525 561 int value = getIntAt(ci); 526 short b ootstrapMethodIndex = (short) extractLowShortFromInt(value);562 short bsmIndex = (short) extractLowShortFromInt(value); 527 563 short nameAndTypeIndex = (short) extractHighShortFromInt(value); 528 dos.writeShort(b ootstrapMethodIndex);564 dos.writeShort(bsmIndex); 529 565 dos.writeShort(nameAndTypeIndex); 530 if (DEBUG) debugMessage("CP[" + ci + "] = indy BSM = " + b ootstrapMethodIndex566 if (DEBUG) debugMessage("CP[" + ci + "] = indy BSM = " + bsmIndex 531 567 + ", N&T = " + nameAndTypeIndex); 532 568 break; 533 569 } 570 534 571 default: 535 572 throw new InternalError("unknown tag: " + cpConstType); -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCache.java
r278 r309 1 1 /* 2 * Copyright (c) 2000, 20 08, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/ConstantPoolCacheEntry.java
r278 r309 1 1 /* 2 * Copyright (c) 2001, 20 05, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/GenerateOopMap.java
r278 r309 1 1 /* 2 * Copyright (c) 2001, 20 05, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/oops/Oop.java
r278 r309 1 1 /* 2 * Copyright (c) 2000, 20 08, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/ClassConstants.java
r278 r309 43 43 public static final int JVM_CONSTANT_MethodHandle = 15; 44 44 public static final int JVM_CONSTANT_MethodType = 16; 45 public static final int JVM_CONSTANT_InvokeDynamic = 17; 45 public static final int JVM_CONSTANT_InvokeDynamicTrans = 17; // only occurs in old class files 46 public static final int JVM_CONSTANT_InvokeDynamic = 18; 46 47 47 48 // JVM_CONSTANT_MethodHandle subtypes -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/runtime/VM.java
r278 r309 1 1 /* 2 * Copyright (c) 2000, 20 09, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ByteCodeRewriter.java
r278 r309 1 1 /* 2 * Copyright (c) 2002, 20 09, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/tools/jcore/ClassWriter.java
r278 r309 304 304 dos.writeByte(cpConstType); 305 305 int value = cpool.getIntAt(ci); 306 short bootstrapMethodIndex = (short) extractLowShortFromInt(value);307 short nameAndTypeIndex = (short) extractHighShortFromInt(value);308 dos.write Short(bootstrapMethodIndex);309 dos.writeShort( nameAndTypeIndex);310 if (DEBUG) debugMessage("CP[" + ci + "] = indy BSM= " +311 bootstrapMethodIndex + ", N&T = " + nameAndTypeIndex);306 byte refKind = (byte) extractLowShortFromInt(value); 307 short memberIndex = (short) extractHighShortFromInt(value); 308 dos.writeByte(refKind); 309 dos.writeShort(memberIndex); 310 if (DEBUG) debugMessage("CP[" + ci + "] = MH kind = " + 311 refKind + ", mem = " + memberIndex); 312 312 break; 313 313 } … … 322 322 } 323 323 324 case JVM_CONSTANT_InvokeDynamicTrans: 324 325 case JVM_CONSTANT_InvokeDynamic: { 325 326 dos.writeByte(cpConstType); 326 327 int value = cpool.getIntAt(ci); 327 short refIndex = (short) value; 328 dos.writeShort(refIndex); 329 if (DEBUG) debugMessage("CP[" + ci + "] = MT index = " + refIndex); 328 short bsmIndex = (short) extractLowShortFromInt(value); 329 short nameAndTypeIndex = (short) extractHighShortFromInt(value); 330 dos.writeShort(bsmIndex); 331 dos.writeShort(nameAndTypeIndex); 332 if (DEBUG) debugMessage("CP[" + ci + "] = INDY bsm = " + 333 bsmIndex + ", N&T = " + nameAndTypeIndex); 330 334 break; 331 335 } -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/FindInCodeCachePanel.java
r278 r309 1 1 /* 2 * Copyright (c) 2004, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 191 191 private void reportResult(StringBuffer result, CodeBlob blob) { 192 192 result.append("<a href='blob:"); 193 result.append(blob. instructionsBegin().toString());193 result.append(blob.contentBegin().toString()); 194 194 result.append("'>"); 195 195 result.append(blob.getName()); 196 196 result.append("@"); 197 result.append(blob. instructionsBegin());197 result.append(blob.contentBegin()); 198 198 result.append("</a><br>"); 199 199 } -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/ui/classbrowser/HTMLGenerator.java
r278 r309 31 31 import sun.jvm.hotspot.asm.x86.*; 32 32 import sun.jvm.hotspot.asm.ia64.*; 33 import sun.jvm.hotspot.asm.amd64.*; 33 34 import sun.jvm.hotspot.code.*; 34 35 import sun.jvm.hotspot.compiler.*; … … 199 200 } else if (cpu.equals("x86")) { 200 201 cpuHelper = new X86Helper(); 202 } else if (cpu.equals("amd64")) { 203 cpuHelper = new AMD64Helper(); 201 204 } else if (cpu.equals("ia64")) { 202 205 cpuHelper = new IA64Helper(); … … 461 464 } 462 465 466 private String genListOfShort(short[] values) { 467 if (values == null || values.length == 0) return ""; 468 Formatter buf = new Formatter(genHTML); 469 buf.append('['); 470 for (int i = 0; i < values.length; i++) { 471 if (i > 0) buf.append(' '); 472 buf.append('#'); 473 buf.append(Integer.toString(values[i])); 474 } 475 buf.append(']'); 476 return buf.toString(); 477 } 478 463 479 protected String genHTMLTableForConstantPool(ConstantPool cpool) { 464 480 Formatter buf = new Formatter(genHTML); … … 583 599 break; 584 600 601 case JVM_CONSTANT_InvokeDynamicTrans: 585 602 case JVM_CONSTANT_InvokeDynamic: 586 603 buf.cell("JVM_CONSTANT_InvokeDynamic"); 587 buf.cell(genLowHighShort(cpool.getIntAt(index))); 604 buf.cell(genLowHighShort(cpool.getIntAt(index)) + 605 genListOfShort(cpool.getBootstrapSpecifierAt(index))); 588 606 break; 589 607 … … 1416 1434 1417 1435 buf.h3("Compiled Code"); 1418 sun.jvm.hotspot.debugger.Address codeBegin = nmethod.codeBegin();1419 sun.jvm.hotspot.debugger.Address codeEnd = nmethod.codeEnd();1420 final int codeSize = (int)codeEnd.minus(codeBegin);1421 final long startPc = addressToLong( codeBegin);1422 final byte[] code = new byte[ codeSize];1436 sun.jvm.hotspot.debugger.Address instsBegin = nmethod.instsBegin(); 1437 sun.jvm.hotspot.debugger.Address instsEnd = nmethod.instsEnd(); 1438 final int instsSize = nmethod.instsSize(); 1439 final long startPc = addressToLong(instsBegin); 1440 final byte[] code = new byte[instsSize]; 1423 1441 for (int i=0; i < code.length; i++) 1424 code[i] = codeBegin.getJByteAt(i);1442 code[i] = instsBegin.getJByteAt(i); 1425 1443 1426 1444 final long verifiedEntryPoint = addressToLong(nmethod.getVerifiedEntryPoint()); … … 1500 1518 1501 1519 buf.h3("Compiled Code"); 1502 final sun.jvm.hotspot.debugger.Address codeBegin = blob. instructionsBegin();1503 final int codeSize = blob.get InstructionsSize();1520 final sun.jvm.hotspot.debugger.Address codeBegin = blob.codeBegin(); 1521 final int codeSize = blob.getCodeSize(); 1504 1522 final long startPc = addressToLong(codeBegin); 1505 1523 final byte[] code = new byte[codeSize]; -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/ConstantTag.java
r278 r309 1 1 /* 2 * Copyright (c) 2001, 20 05, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2001, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 41 41 private static int JVM_CONSTANT_MethodHandle = 15; // JSR 292 42 42 private static int JVM_CONSTANT_MethodType = 16; // JSR 292 43 private static int JVM_CONSTANT_InvokeDynamic = 17; // JSR 292 43 private static int JVM_CONSTANT_InvokeDynamicTrans = 17; // JSR 292, only occurs in old class files 44 private static int JVM_CONSTANT_InvokeDynamic = 18; // JSR 292 44 45 private static int JVM_CONSTANT_Invalid = 0; // For bad value initialization 45 46 private static int JVM_CONSTANT_UnresolvedClass = 100; // Temporary tag until actual use … … 67 68 } 68 69 70 public int value() { return tag; } 71 69 72 public boolean isKlass() { return tag == JVM_CONSTANT_Class; } 70 73 public boolean isField () { return tag == JVM_CONSTANT_Fieldref; } … … 81 84 public boolean isMethodType() { return tag == JVM_CONSTANT_MethodType; } 82 85 public boolean isInvokeDynamic() { return tag == JVM_CONSTANT_InvokeDynamic; } 86 public boolean isInvokeDynamicTrans() { return tag == JVM_CONSTANT_InvokeDynamicTrans; } 83 87 84 88 public boolean isInvalid() { return tag == JVM_CONSTANT_Invalid; } -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PointerFinder.java
r278 r309 97 97 Assert.that(loc.blob != null, "Should have found CodeBlob"); 98 98 } 99 loc.inBlob Instructions = loc.blob.instructionsContains(a);100 loc.inBlobData 99 loc.inBlobCode = loc.blob.codeContains(a); 100 loc.inBlobData = loc.blob.dataContains(a); 101 101 102 102 if (loc.blob.isNMethod()) { … … 105 105 } 106 106 107 loc.inBlobUnknownLocation = (!(loc.inBlob Instructions||107 loc.inBlobUnknownLocation = (!(loc.inBlobCode || 108 108 loc.inBlobData || 109 109 loc.inBlobOops)); -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/PointerLocation.java
r278 r309 1 1 /* 2 * Copyright (c) 2000, 20 04, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 * … … 66 66 CodeBlob blob; 67 67 // FIXME: add more detail about CodeBlob 68 boolean inBlob Instructions;68 boolean inBlobCode; 69 69 boolean inBlobData; 70 70 boolean inBlobOops; … … 143 143 } 144 144 145 public boolean isInBlob Instructions() {146 return inBlob Instructions;145 public boolean isInBlobCode() { 146 return inBlobCode; 147 147 } 148 148 … … 234 234 CodeBlob b = getCodeBlob(); 235 235 tty.print("In "); 236 if (isInBlob Instructions()) {237 tty.print(" instructions");236 if (isInBlobCode()) { 237 tty.print("code"); 238 238 } else if (isInBlobData()) { 239 239 tty.print("data"); -
trunk/openjdk/hotspot/agent/src/share/classes/sun/jvm/hotspot/utilities/soql/sa.js
r278 r309 1 1 /* 2 * Copyright (c) 2004, 20 07, Oracle and/or its affiliates. All rights reserved.2 * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved. 3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 4 *
Note:
See TracChangeset
for help on using the changeset viewer.