Mercurial > hg > truffle
comparison agent/src/share/classes/sun/jvm/hotspot/debugger/DebuggerBase.java @ 642:660978a2a31a
6791178: Specialize for zero as the compressed oop vm heap base
Summary: Use zero based compressed oops if java heap is below 32gb and unscaled compressed oops if java heap is below 4gb.
Reviewed-by: never, twisti, jcoomes, coleenp
author | kvn |
---|---|
date | Thu, 12 Mar 2009 10:37:46 -0700 |
parents | d1605aabd0a1 |
children | bd02caa94611 |
comparison
equal
deleted
inserted
replaced
641:6af0a709d52b | 642:660978a2a31a |
---|---|
54 protected long jshortSize; | 54 protected long jshortSize; |
55 protected boolean javaPrimitiveTypesConfigured; | 55 protected boolean javaPrimitiveTypesConfigured; |
56 // heap data. | 56 // heap data. |
57 protected long oopSize; | 57 protected long oopSize; |
58 protected long heapOopSize; | 58 protected long heapOopSize; |
59 protected long heapBase; // heap base for compressed oops. | 59 protected long narrowOopBase; // heap base for compressed oops. |
60 protected long logMinObjAlignmentInBytes; // Used to decode compressed oops. | 60 protected int narrowOopShift; // shift to decode compressed oops. |
61 // Should be initialized if desired by calling initCache() | 61 // Should be initialized if desired by calling initCache() |
62 private PageCache cache; | 62 private PageCache cache; |
63 | 63 |
64 // State for faster accessors that don't allocate memory on each read | 64 // State for faster accessors that don't allocate memory on each read |
65 private boolean useFastAccessors; | 65 private boolean useFastAccessors; |
157 (jshortSize == 2)); | 157 (jshortSize == 2)); |
158 | 158 |
159 javaPrimitiveTypesConfigured = true; | 159 javaPrimitiveTypesConfigured = true; |
160 } | 160 } |
161 | 161 |
162 public void putHeapConst(long heapBase, long heapOopSize, long logMinObjAlignmentInBytes) { | 162 public void putHeapConst(long heapOopSize, long narrowOopBase, int narrowOopShift) { |
163 this.heapBase = heapBase; | |
164 this.heapOopSize = heapOopSize; | 163 this.heapOopSize = heapOopSize; |
165 this.logMinObjAlignmentInBytes = logMinObjAlignmentInBytes; | 164 this.narrowOopBase = narrowOopBase; |
165 this.narrowOopShift = narrowOopShift; | |
166 } | 166 } |
167 | 167 |
168 /** May be called by subclasses if desired to initialize the page | 168 /** May be called by subclasses if desired to initialize the page |
169 cache but may not be overridden */ | 169 cache but may not be overridden */ |
170 protected final void initCache(long pageSize, long maxNumPages) { | 170 protected final void initCache(long pageSize, long maxNumPages) { |
457 protected long readCompOopAddressValue(long address) | 457 protected long readCompOopAddressValue(long address) |
458 throws UnmappedAddressException, UnalignedAddressException { | 458 throws UnmappedAddressException, UnalignedAddressException { |
459 long value = readCInteger(address, getHeapOopSize(), true); | 459 long value = readCInteger(address, getHeapOopSize(), true); |
460 if (value != 0) { | 460 if (value != 0) { |
461 // See oop.inline.hpp decode_heap_oop | 461 // See oop.inline.hpp decode_heap_oop |
462 value = (long)(heapBase + (long)(value << logMinObjAlignmentInBytes)); | 462 value = (long)(narrowOopBase + (long)(value << narrowOopShift)); |
463 } | 463 } |
464 return value; | 464 return value; |
465 } | 465 } |
466 | 466 |
467 protected void writeAddressValue(long address, long value) | 467 protected void writeAddressValue(long address, long value) |
543 | 543 |
544 public long getHeapOopSize() { | 544 public long getHeapOopSize() { |
545 return heapOopSize; | 545 return heapOopSize; |
546 } | 546 } |
547 | 547 |
548 public long getHeapBase() { | 548 public long getNarrowOopBase() { |
549 return heapBase; | 549 return narrowOopBase; |
550 } | 550 } |
551 public long getLogMinObjAlignmentInBytes() { | 551 public int getNarrowOopShift() { |
552 return logMinObjAlignmentInBytes; | 552 return narrowOopShift; |
553 } | 553 } |
554 } | 554 } |