Mercurial > hg > graal-jvmci-8
comparison agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java @ 113:ba764ed4b6f2
6420645: Create a vm that uses compressed oops for up to 32gb heapsizes
Summary: Compressed oops in instances, arrays, and headers. Code contributors are coleenp, phh, never, swamyv
Reviewed-by: jmasa, kamg, acorn, tbell, kvn, rasbold
author | coleenp |
---|---|
date | Sun, 13 Apr 2008 17:43:42 -0400 |
parents | a61af66fc99e |
children | d1605aabd0a1 |
comparison
equal
deleted
inserted
replaced
110:a49a647afe9a | 113:ba764ed4b6f2 |
---|---|
572 } | 572 } |
573 } catch (IOException exp) { | 573 } catch (IOException exp) { |
574 throw new RuntimeException(exp); | 574 throw new RuntimeException(exp); |
575 } | 575 } |
576 } | 576 } |
577 public void visitCompOopAddress(Address handleAddr) { | |
578 throw new RuntimeException( | |
579 " Should not reach here. JNIHandles are not compressed \n"); | |
580 } | |
577 }); | 581 }); |
578 } catch (RuntimeException re) { | 582 } catch (RuntimeException re) { |
579 handleRuntimeException(re); | 583 handleRuntimeException(re); |
580 } | 584 } |
581 } | 585 } |
599 out.writeInt(DUMMY_STACK_TRACE_ID); | 603 out.writeInt(DUMMY_STACK_TRACE_ID); |
600 out.writeInt((int) array.getLength()); | 604 out.writeInt((int) array.getLength()); |
601 writeObjectID(array.getKlass().getJavaMirror()); | 605 writeObjectID(array.getKlass().getJavaMirror()); |
602 final int length = (int) array.getLength(); | 606 final int length = (int) array.getLength(); |
603 for (int index = 0; index < length; index++) { | 607 for (int index = 0; index < length; index++) { |
604 long offset = OBJECT_BASE_OFFSET + index * OBJ_ID_SIZE; | 608 OopHandle handle = array.getOopHandleAt(index); |
605 OopHandle handle = array.getHandle().getOopHandleAt(offset); | |
606 writeObjectID(getAddressValue(handle)); | 609 writeObjectID(getAddressValue(handle)); |
607 } | 610 } |
608 } | 611 } |
609 | 612 |
610 protected void writePrimitiveArray(TypeArray array) throws IOException { | 613 protected void writePrimitiveArray(TypeArray array) throws IOException { |
801 case JVM_SIGNATURE_DOUBLE: | 804 case JVM_SIGNATURE_DOUBLE: |
802 out.writeDouble(((DoubleField)field).getValue(oop)); | 805 out.writeDouble(((DoubleField)field).getValue(oop)); |
803 break; | 806 break; |
804 case JVM_SIGNATURE_CLASS: | 807 case JVM_SIGNATURE_CLASS: |
805 case JVM_SIGNATURE_ARRAY: { | 808 case JVM_SIGNATURE_ARRAY: { |
806 OopHandle handle = ((OopField)field).getValueAsOopHandle(oop); | 809 if (VM.getVM().isCompressedOopsEnabled()) { |
807 writeObjectID(getAddressValue(handle)); | 810 OopHandle handle = ((NarrowOopField)field).getValueAsOopHandle(oop); |
811 writeObjectID(getAddressValue(handle)); | |
812 } else { | |
813 OopHandle handle = ((OopField)field).getValueAsOopHandle(oop); | |
814 writeObjectID(getAddressValue(handle)); | |
815 } | |
808 break; | 816 break; |
809 } | 817 } |
810 default: | 818 default: |
811 throw new RuntimeException("should not reach here"); | 819 throw new RuntimeException("should not reach here"); |
812 } | 820 } |