Skip to content

Commit 450b5fe

Browse files
committed
Merge branch 'master' into graal
2 parents c3124ec + 9a43222 commit 450b5fe

File tree

7 files changed

+52
-21
lines changed

7 files changed

+52
-21
lines changed

visualvm/jvmstat/src/org/graalvm/visualvm/jvmstat/JRockitJvmJvmstatModelProvider.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
package org.graalvm.visualvm.jvmstat;
2727

28-
import org.graalvm.visualvm.core.model.AbstractModelProvider;
2928
import org.graalvm.visualvm.application.Application;
3029
import org.graalvm.visualvm.tools.jvmstat.JvmstatModel;
3130
import org.graalvm.visualvm.tools.jvmstat.JvmstatModelFactory;

visualvm/libs.profiler/lib.profiler.ui/src/org/graalvm/visualvm/lib/ui/components/HTMLTextArea.java

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -560,6 +560,8 @@ private static synchronized Map getEntities() {
560560

561561
// --- Lazy setting text ---------------------------------------------------
562562
private String pendingText;
563+
private int pendingDot = -1;
564+
563565
private String currentText;
564566
private boolean forceSetText;
565567

@@ -587,8 +589,8 @@ public void keyPressed(KeyEvent e) {
587589
public void hierarchyChanged(HierarchyEvent e) {
588590
if ((e.getChangeFlags() & HierarchyEvent.SHOWING_CHANGED) != 0) {
589591
if (isShowing() && pendingText != null) setText(pendingText);
592+
}
590593
}
591-
}
592594
});
593595
}
594596

@@ -626,6 +628,11 @@ public void setShowPopup(boolean showPopup) {
626628
public boolean getShowPopup() {
627629
return showPopup;
628630
}
631+
632+
public void setCaretPosition(int position) {
633+
if (pendingText == null) super.setCaretPosition(position);
634+
else pendingDot = position;
635+
}
629636

630637
public void setText(String value) {
631638
if (value == null) return;
@@ -653,6 +660,11 @@ public void setText(String value) {
653660
setDocument(getEditorKit().createDefaultDocument()); // Workaround for http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5042872
654661
super.setText(newText);
655662

663+
if (pendingDot != -1) {
664+
try { setCaretPosition(pendingDot); }
665+
catch (IllegalArgumentException ex) {} // expected
666+
pendingDot = -1;
667+
}
656668
}
657669

658670
forceSetText = false;

visualvm/libs.profiler/lib.profiler.ui/src/org/graalvm/visualvm/lib/ui/jdbc/SQLFilterPanel.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,16 @@ void set(Configuration o) {
338338
statements.clear();
339339
statements.addAll(o.statements);
340340
}
341+
342+
@Override
343+
public int hashCode() {
344+
int hash = 7;
345+
hash = 37 * hash + filter.hashCode();
346+
hash = 37 * hash + commands.hashCode();
347+
hash = 37 * hash + tables.hashCode();
348+
hash = 37 * hash + statements.hashCode();
349+
return hash;
350+
}
341351

342352
public boolean equals(Object o) {
343353
Configuration c = (Configuration)o;

visualvm/libs.profiler/lib.profiler/src/org/graalvm/visualvm/lib/jfluid/heap/HprofHeap.java

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -670,26 +670,28 @@ void computeReferences() {
670670
if (tag == INSTANCE_DUMP) {
671671
long classId = dumpBuffer.getID(start+1+idSize+4);
672672
ClassDump classDump = (ClassDump) classIdToClassMap.get(new Long(classId));
673-
long instanceId = dumpBuffer.getID(start+1);
674-
long inOff = start+1+idSize+4+idSize+4;
675-
List fields = classDump.getAllInstanceFields();
676-
Iterator fit = fields.iterator();
677-
678-
while(fit.hasNext()) {
679-
HprofField field = (HprofField) fit.next();
680-
if (field.getValueType() == HprofHeap.OBJECT) {
681-
long outId = dumpBuffer.getID(inOff);
682-
683-
if (outId != 0) {
684-
LongMap.Entry entry = idToOffsetMap.get(outId);
685-
if (entry != null) {
686-
entry.addReference(instanceId);
687-
} else {
688-
// System.err.println("instance entry:" + Long.toHexString(outId));
673+
if (classDump != null) {
674+
long instanceId = dumpBuffer.getID(start+1);
675+
long inOff = start+1+idSize+4+idSize+4;
676+
List fields = classDump.getAllInstanceFields();
677+
Iterator fit = fields.iterator();
678+
679+
while(fit.hasNext()) {
680+
HprofField field = (HprofField) fit.next();
681+
if (field.getValueType() == HprofHeap.OBJECT) {
682+
long outId = dumpBuffer.getID(inOff);
683+
684+
if (outId != 0) {
685+
LongMap.Entry entry = idToOffsetMap.get(outId);
686+
if (entry != null) {
687+
entry.addReference(instanceId);
688+
} else {
689+
// System.err.println("instance entry:" + Long.toHexString(outId));
690+
}
689691
}
690692
}
693+
inOff += field.getValueSize();
691694
}
692-
inOff += field.getValueSize();
693695
}
694696
} else if (tag == OBJECT_ARRAY_DUMP) {
695697
long instanceId = dumpBuffer.getID(start+1);

visualvm/libs.profiler/profiler.attach/src/org/graalvm/visualvm/lib/profiler/attach/providers/TargetPlatformEnum.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,11 @@ public boolean equals(Object obj) {
9191
return ((TargetPlatformEnum) obj).jvmIndex == this.jvmIndex;
9292
}
9393

94+
@Override
95+
public int hashCode() {
96+
return jvmIndex;
97+
}
98+
9499
public static Iterator iterator() {
95100
List jvmList = new ArrayList(8);
96101
jvmList.add(JDK5);

visualvm/libs.profiler/profiler.snaptracer/src/org/graalvm/visualvm/lib/profiler/snaptracer/ItemValueFormatter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ public String formatValue(long value, int format) {
181181
return FORMAT.format(value);
182182
case FORMAT_UNITS:
183183
String est = value == 0 ? "" : "~";
184-
return est + FORMAT.format(Math.round(value / 1024 / 1024));
184+
return est + FORMAT.format(Math.round((double)value / 1024 / 1024));
185185
default:
186186
return null;
187187
}

visualvm/sa/src/org/graalvm/visualvm/sa/SaModelProvider.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,10 @@ public SaModel createModelFor(DataSource ds) {
5757
if (Host.LOCALHOST.equals(app.getHost())) {
5858
JvmJvmstatModel jvmstat = JvmJvmstatModelFactory.getJvmstatModelFor(app);
5959

60-
if (jvmstat != null && Utilities.isWindows()) {
60+
if (jvmstat == null) {
61+
return null;
62+
}
63+
if (Utilities.isWindows()) {
6164
// on Windows, SA can only attach to the process of the same
6265
// architecture ( 32bit / 64bit )
6366
Boolean this64bitArch = is64BitArchitecture();

0 commit comments

Comments
 (0)