comparison agent/src/share/classes/sun/jvm/hotspot/utilities/HeapHprofBinWriter.java @ 22944:89783a257836

8044416: serviceability/sa/jmap-hashcode/Test8028623.java fails with AssertionFailure: can not get class data for java/lang/UNIXProcess$Platform$$Lambda Summary: Lambda object is not counted when SA builds class data cache but is reached inside live region. Reviewed-by: sla, jbachorik
author dsamersoff
date Fri, 10 Apr 2015 05:25:47 -0700
parents 55fb97c4c58d
children dd9cc155639c
comparison
equal deleted inserted replaced
22943:2163da41681e 22944:89783a257836
1 /* 1 /*
2 * Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 2004, 2015, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
797 out.writeInt(DUMMY_STACK_TRACE_ID); 797 out.writeInt(DUMMY_STACK_TRACE_ID);
798 Klass klass = instance.getKlass(); 798 Klass klass = instance.getKlass();
799 writeObjectID(klass.getJavaMirror()); 799 writeObjectID(klass.getJavaMirror());
800 800
801 ClassData cd = (ClassData) classDataCache.get(klass); 801 ClassData cd = (ClassData) classDataCache.get(klass);
802 if (cd == null) {
803 // The class is not present in the system dictionary, probably Lambda.
804 // Add it to cache here
805 if (klass instanceof InstanceKlass) {
806 InstanceKlass ik = (InstanceKlass) klass;
807 List fields = getInstanceFields(ik);
808 int instSize = getSizeForFields(fields);
809 cd = new ClassData(instSize, fields);
810 classDataCache.put(ik, cd);
811 }
812 }
813
802 if (Assert.ASSERTS_ENABLED) { 814 if (Assert.ASSERTS_ENABLED) {
803 Assert.that(cd != null, "can not get class data for " + klass.getName().asString() + klass.getAddress()); 815 Assert.that(cd != null, "can not get class data for " + klass.getName().asString() + klass.getAddress());
804 } 816 }
805 List fields = cd.fields; 817 List fields = cd.fields;
806 int size = cd.instSize; 818 int size = cd.instSize;