|
Lines 14-116
Link Here
|
| 14 |
|
14 |
|
| 15 |
package org.eclipse.tptp.trace.jvmti.internal.client.views; |
15 |
package org.eclipse.tptp.trace.jvmti.internal.client.views; |
| 16 |
|
16 |
|
|
|
17 |
import java.util.ArrayList; |
| 18 |
import java.util.HashMap; |
| 19 |
import java.util.Map; |
| 20 |
|
| 17 |
import org.eclipse.emf.common.util.EList; |
21 |
import org.eclipse.emf.common.util.EList; |
| 18 |
import org.eclipse.emf.ecore.EObject; |
|
|
| 19 |
import org.eclipse.hyades.models.trace.TRCClass; |
22 |
import org.eclipse.hyades.models.trace.TRCClass; |
|
|
23 |
import org.eclipse.hyades.models.trace.TRCFullTraceObject; |
| 24 |
import org.eclipse.hyades.models.trace.TRCMethod; |
| 20 |
import org.eclipse.hyades.models.trace.TRCObjectAllocationAnnotation; |
25 |
import org.eclipse.hyades.models.trace.TRCObjectAllocationAnnotation; |
| 21 |
import org.eclipse.hyades.trace.ui.ITraceSelection; |
26 |
import org.eclipse.hyades.models.trace.TRCPackage; |
| 22 |
import org.eclipse.hyades.trace.ui.TraceViewerPage; |
27 |
import org.eclipse.hyades.trace.ui.TraceViewerPage; |
| 23 |
import org.eclipse.hyades.trace.ui.UIPlugin; |
|
|
| 24 |
import org.eclipse.hyades.trace.ui.ViewSelectionChangedEvent; |
| 25 |
import org.eclipse.hyades.trace.views.internal.view.columnlabels.ContextUpdaterHelper; |
| 26 |
import org.eclipse.hyades.trace.views.util.internal.ColumnData; |
28 |
import org.eclipse.hyades.trace.views.util.internal.ColumnData; |
| 27 |
import org.eclipse.hyades.trace.views.util.internal.StatisticTableColumnInfo; |
29 |
import org.eclipse.hyades.trace.views.util.internal.StatisticTableColumnInfo; |
| 28 |
import org.eclipse.hyades.ui.provisional.context.ContextManager; |
30 |
import org.eclipse.hyades.ui.provisional.context.IContextLabelFormatProvider; |
|
|
31 |
import org.eclipse.hyades.ui.util.GridUtil; |
| 29 |
import org.eclipse.jface.viewers.Viewer; |
32 |
import org.eclipse.jface.viewers.Viewer; |
|
|
33 |
import org.eclipse.swt.events.SelectionEvent; |
| 34 |
import org.eclipse.swt.graphics.Color; |
| 35 |
import org.eclipse.swt.graphics.Font; |
| 36 |
import org.eclipse.swt.graphics.FontData; |
| 30 |
import org.eclipse.swt.graphics.Image; |
37 |
import org.eclipse.swt.graphics.Image; |
| 31 |
import org.eclipse.swt.widgets.Composite; |
38 |
import org.eclipse.swt.widgets.Composite; |
|
|
39 |
import org.eclipse.swt.widgets.Label; |
| 40 |
import org.eclipse.tptp.trace.jvmti.internal.client.AllocationSite; |
| 32 |
import org.eclipse.tptp.trace.jvmti.internal.client.context.TIContextAttributes; |
41 |
import org.eclipse.tptp.trace.jvmti.internal.client.context.TIContextAttributes; |
|
|
42 |
import org.eclipse.tptp.trace.jvmti.internal.client.context.TIContextProvider; |
| 43 |
import org.eclipse.tptp.trace.jvmti.internal.client.widgets.Utils; |
| 33 |
|
44 |
|
| 34 |
public class AllocationDetailsView extends BaseStatisticView { |
45 |
public class AllocationDetailsView extends BaseStatisticView { |
| 35 |
|
46 |
|
| 36 |
TRCClass _class; |
47 |
static public final int AD_COL_METHOD_NAME = 0; |
| 37 |
BaseMemoryStatisticView _memView; |
48 |
static public final int AD_COL_LINE_NO = 1; |
|
|
49 |
static public final int AD_COL_CLASS_NAME = 2; |
| 50 |
static public final int AD_COL_PACKAGE_NAME = 3; |
| 51 |
static public final int AD_COL_LIVE_INST = 4; |
| 52 |
static public final int AD_COL_LIVE_SIZE = 5; |
| 53 |
static public final int AD_COL_TOTAL_INST = 6; |
| 54 |
static public final int AD_COL_TOTAL_SIZE = 7; |
| 55 |
static public final int AD_COL_AVG_AGE = 8; |
| 56 |
|
| 57 |
private Map _allocSites = new HashMap(); |
| 58 |
private TRCClass _class; |
| 59 |
private int _nextIndex; |
| 60 |
private Label _label; |
| 38 |
static final Object _emptyArr[] = new Object[0]; |
61 |
static final Object _emptyArr[] = new Object[0]; |
| 39 |
|
62 |
|
| 40 |
protected AllocationDetailsView(Composite parent, TraceViewerPage page, |
63 |
protected AllocationDetailsView(Composite parent, TraceViewerPage page) { |
| 41 |
BaseMemoryStatisticView memView) { |
|
|
| 42 |
super(parent, page); |
64 |
super(parent, page); |
| 43 |
_memView = memView; |
|
|
| 44 |
} |
65 |
} |
| 45 |
|
66 |
|
| 46 |
protected String getColumnsPreferencesKey() { |
67 |
protected String getColumnsPreferencesKey() { |
| 47 |
return "org.eclipse.hyades.trace.views.statistic.allocdetails03"; |
68 |
return "org.eclipse.hyades.trace.views.statistic.allocdetails04"; |
| 48 |
} |
69 |
} |
| 49 |
|
70 |
|
| 50 |
protected String getViewTypeStr() { |
71 |
protected String getViewTypeStr() { |
| 51 |
return "viewoption.allocdetails"; |
72 |
return "viewoption.allocdetails"; |
| 52 |
} |
73 |
} |
|
|
74 |
|
| 75 |
protected Composite createControl(Composite parent, ArrayList cols) { |
| 76 |
Composite comp = super.createControl(parent, cols); |
| 77 |
_label = _toolkit.createLabel(comp, null); |
| 78 |
Font font = _label.getFont(); |
| 79 |
FontData fd = font.getFontData()[0]; |
| 80 |
font = new Font(null, new FontData(fd.getName(), fd.getHeight() * 3 / 2, fd.getStyle())); |
| 81 |
_label.setFont(font); |
| 82 |
_label.setBackground(comp.getBackground()); |
| 83 |
_label.setForeground(new Color(null, 0, 0, 200)); |
| 84 |
_label.setLayoutData(GridUtil.createHorizontalFill()); |
| 85 |
return comp; |
| 86 |
} |
| 53 |
|
87 |
|
| 54 |
protected String getDefaultColumnsTemplate() { |
88 |
protected String getDefaultColumnsTemplate() { |
| 55 |
return "" |
89 |
return "" |
| 56 |
+ TIContextAttributes.METHOD_NAME + ":" + 0 + ":" + String.valueOf(ColumnData.NONDELETABLE | ColumnData.IS_VISIBLE | ColumnData.NONMOVABLE) + ":left:150," |
90 |
+ TIContextAttributes.METHOD_NAME + ":" + AD_COL_METHOD_NAME + ":" + String.valueOf(ColumnData.NONDELETABLE | ColumnData.IS_VISIBLE | ColumnData.NONMOVABLE) + ":left:150," |
| 57 |
+ TIContextAttributes.METHOD_LINE_NUMBER + ":" + 1 + ":" + String.valueOf(ColumnData.IS_VISIBLE) + ":left:120," |
91 |
+ TIContextAttributes.METHOD_LINE_NUMBER + ":" + AD_COL_LINE_NO + ":" + String.valueOf(ColumnData.IS_VISIBLE) + ":right:80," |
| 58 |
+ TIContextAttributes.CLASS_NAME + ":" + 2 + ":" + String.valueOf(ColumnData.IS_VISIBLE) + ":left:150," |
92 |
+ TIContextAttributes.CLASS_NAME + ":" + AD_COL_CLASS_NAME + ":" + String.valueOf(ColumnData.IS_VISIBLE) + ":left:150," |
| 59 |
+ TIContextAttributes.PACKAGE_NAME + ":" + 3 + ":" + String.valueOf(ColumnData.IS_VISIBLE) + ":left:120," |
93 |
+ TIContextAttributes.PACKAGE_NAME + ":" + AD_COL_PACKAGE_NAME + ":" + String.valueOf(ColumnData.IS_VISIBLE) + ":left:120," |
| 60 |
+ TIContextAttributes.CLASS_LIVE_INST + ":" + 4 + ":" + String.valueOf(ColumnData.IS_VISIBLE) + ":right:80," |
94 |
+ TIContextAttributes.CLASS_LIVE_INST + ":" + AD_COL_LIVE_INST + ":" + String.valueOf(ColumnData.IS_VISIBLE) + ":right:80," |
| 61 |
+ TIContextAttributes.CLASS_ACTIVE_SIZE + ":" + 5 + ":" + String.valueOf(ColumnData.IS_VISIBLE) + ":right:80," |
95 |
+ TIContextAttributes.CLASS_ACTIVE_SIZE + ":" + AD_COL_LIVE_SIZE + ":" + String.valueOf(ColumnData.IS_VISIBLE) + ":right:80," |
| 62 |
+ TIContextAttributes.CLASS_TOTAL_INST + ":" + 6 + ":" + String.valueOf(ColumnData.IS_VISIBLE) + ":right:80," |
96 |
+ TIContextAttributes.CLASS_TOTAL_INST + ":" + AD_COL_TOTAL_INST + ":" + String.valueOf(ColumnData.IS_VISIBLE) + ":right:80," |
| 63 |
+ TIContextAttributes.CLASS_TOTAL_SIZE + ":" + 7 + ":" + String.valueOf(ColumnData.IS_VISIBLE) + ":right:80," |
97 |
+ TIContextAttributes.CLASS_TOTAL_SIZE + ":" + AD_COL_TOTAL_SIZE + ":" + String.valueOf(ColumnData.IS_VISIBLE) + ":right:80," |
| 64 |
+ TIContextAttributes.CLASS_AVG_AGE + ":" + 8 + ":" + String.valueOf(ColumnData.IS_VISIBLE) + ":right:80" |
98 |
+ TIContextAttributes.CLASS_AVG_AGE + ":" + AD_COL_AVG_AGE + ":" + String.valueOf(ColumnData.IS_VISIBLE) + ":right:80" |
| 65 |
//+ TIContextAttributes.CLASS_GENERATIONS + ":" + 9 + ":" + String.valueOf(ColumnData.IS_VISIBLE) + ":right:80" |
99 |
//+ TIContextAttributes.CLASS_GENERATIONS + ":" + 9 + ":" + String.valueOf(ColumnData.IS_VISIBLE) + ":right:80" |
| 66 |
; |
100 |
; |
| 67 |
} |
101 |
} |
| 68 |
|
102 |
|
| 69 |
public String getColumnText(Object element, int columnIndex) { |
103 |
public String getColumnText(Object element, int columnIndex) { |
| 70 |
StatisticTableColumnInfo info = StatisticTableColumnInfo.getStatisticTableColumnInfo(getTree().getColumn(columnIndex)); |
104 |
StatisticTableColumnInfo info = StatisticTableColumnInfo |
|
|
105 |
.getStatisticTableColumnInfo(getTree().getColumn(columnIndex)); |
| 71 |
int pos = info.getColumnData().getInitalPos(); |
106 |
int pos = info.getColumnData().getInitalPos(); |
| 72 |
String label = ""; |
107 |
String label = ""; |
| 73 |
if (!(element instanceof TRCObjectAllocationAnnotation)) |
108 |
if (!(element instanceof AllocationSite)) |
| 74 |
return label; |
109 |
return label; |
|
|
110 |
AllocationSite allocSite = (AllocationSite) element; |
| 75 |
switch (pos) { |
111 |
switch (pos) { |
| 76 |
case 0: label = "method name"; break; |
112 |
case AD_COL_METHOD_NAME: |
| 77 |
case 1: label = "line number"; break; |
113 |
if (allocSite._method != null) |
| 78 |
case 2: break; |
114 |
label = allocSite._method.getName(); |
| 79 |
case 3: break; |
115 |
break; |
| 80 |
case 4: break; |
116 |
case AD_COL_CLASS_NAME: |
|
|
117 |
if (allocSite._method != null && |
| 118 |
allocSite._method.getDefiningClass() != null) |
| 119 |
label = allocSite._method.getDefiningClass().getName(); |
| 120 |
break; |
| 121 |
case AD_COL_PACKAGE_NAME: |
| 122 |
if (allocSite._method != null && |
| 123 |
allocSite._method.getDefiningClass() != null && |
| 124 |
allocSite._method.getDefiningClass().getPackage() != null) |
| 125 |
label = allocSite._method.getDefiningClass().getPackage().getName(); |
| 126 |
break; |
| 127 |
case AD_COL_LINE_NO: |
| 128 |
label = "" + allocSite._lineNo; |
| 129 |
break; |
| 130 |
case AD_COL_TOTAL_INST: |
| 131 |
label = "" + allocSite._total; |
| 132 |
break; |
| 133 |
case AD_COL_TOTAL_SIZE: |
| 134 |
label = "" + allocSite._totalSize; |
| 135 |
break; |
| 136 |
case AD_COL_LIVE_INST: |
| 137 |
label = "" + (allocSite._total - allocSite._collected); |
| 138 |
break; |
| 139 |
case AD_COL_LIVE_SIZE: |
| 140 |
label = "" + (allocSite._totalSize - allocSite._collectedSize); |
| 141 |
break; |
| 142 |
case AD_COL_AVG_AGE: |
| 143 |
double age = 0; |
| 144 |
if (allocSite._total > 0) { |
| 145 |
age = (double) allocSite._sumAges / allocSite._total; |
| 146 |
label = "" + age; |
| 147 |
} |
| 148 |
IContextLabelFormatProvider formatter = TIContextProvider.instance().getContextLabelFormatProvider(TIContextAttributes.CALL_SITE_AVG_AGE); |
| 149 |
label = formatter.getDisplayStringFromElement(new Double(age), null, IContextLabelFormatProvider.MODE_COLUMN_CONTENT); |
| 150 |
break; |
| 81 |
} |
151 |
} |
| 82 |
return label; |
152 |
return label; |
| 83 |
} |
153 |
} |
| 84 |
|
154 |
|
| 85 |
public Image getColumnImage(Object element, int columnIndex) { |
155 |
public Image getColumnImage(Object element, int columnIndex) { |
| 86 |
return null; |
156 |
StatisticTableColumnInfo info = StatisticTableColumnInfo.getStatisticTableColumnInfo(getTree().getColumn(columnIndex)); |
|
|
157 |
int pos = info.getColumnData().getInitalPos(); |
| 158 |
Image image = null; |
| 159 |
if (!(element instanceof AllocationSite)) |
| 160 |
return image; |
| 161 |
AllocationSite allocSite = (AllocationSite) element; |
| 162 |
switch (pos) { |
| 163 |
case AD_COL_METHOD_NAME: |
| 164 |
if (allocSite._method != null) { |
| 165 |
IContextLabelFormatProvider formatter = TIContextProvider.instance().getContextLabelFormatProvider(TIContextAttributes.METHOD_NAME); |
| 166 |
image = formatter.getDisplayImageByElement(allocSite._method.getName(), allocSite._method, IContextLabelFormatProvider.MODE_COLUMN_CONTENT); |
| 167 |
} |
| 168 |
break; |
| 169 |
case AD_COL_CLASS_NAME: |
| 170 |
if (allocSite._method != null && |
| 171 |
allocSite._method.getDefiningClass() != null) { |
| 172 |
TRCClass cls = allocSite._method.getDefiningClass(); |
| 173 |
IContextLabelFormatProvider formatter = TIContextProvider.instance().getContextLabelFormatProvider(TIContextAttributes.CLASS_NAME); |
| 174 |
image = formatter.getDisplayImageByElement(cls.getName(), cls, IContextLabelFormatProvider.MODE_COLUMN_CONTENT); |
| 175 |
} |
| 176 |
break; |
| 177 |
case AD_COL_PACKAGE_NAME: |
| 178 |
if (allocSite._method != null && |
| 179 |
allocSite._method.getDefiningClass() != null && |
| 180 |
allocSite._method.getDefiningClass().getPackage() != null) { |
| 181 |
TRCPackage pkg = allocSite._method.getDefiningClass().getPackage(); |
| 182 |
IContextLabelFormatProvider formatter = TIContextProvider.instance().getContextLabelFormatProvider(TIContextAttributes.PACKAGE_NAME); |
| 183 |
image = formatter.getDisplayImageByElement(pkg.getName(), pkg, IContextLabelFormatProvider.MODE_COLUMN_CONTENT); |
| 184 |
} |
| 185 |
break; |
| 186 |
} |
| 187 |
return image; |
| 87 |
} |
188 |
} |
| 88 |
|
189 |
|
| 89 |
TRCClass getSelectedClass() { |
190 |
public int compareElements(Object e1, Object e2, int pos, boolean isDelta) { |
| 90 |
return _class; |
191 |
int ret = 0; |
| 91 |
/*if (null == _memView || _memView.getControl().isDisposed()) |
192 |
if (!(e1 instanceof AllocationSite && e2 instanceof AllocationSite)) |
| 92 |
return null; |
193 |
return ret; |
| 93 |
IStructuredSelection selection = (IStructuredSelection) _memView.getTreeViewer().getSelection(); |
194 |
AllocationSite a1 = (AllocationSite) e1; |
| 94 |
if (null == selection || selection.isEmpty()) |
195 |
AllocationSite a2 = (AllocationSite) e2; |
| 95 |
return null; |
196 |
switch (pos) { |
| 96 |
Object element = selection.getFirstElement(); |
197 |
case AD_COL_METHOD_NAME: |
| 97 |
if (!(element instanceof TRCClass)) |
198 |
ret = Utils.compare(a1._method != null ? a1._method.getName() : null |
| 98 |
return null; |
199 |
, a2._method != null ? a2._method.getName() : null); |
| 99 |
return (TRCClass) element;*/ |
200 |
break; |
|
|
201 |
case AD_COL_CLASS_NAME: |
| 202 |
ret = Utils.compare(a1._method != null && |
| 203 |
a1._method.getDefiningClass() != null ? |
| 204 |
a1._method.getDefiningClass().getName() : null |
| 205 |
, a2._method != null && |
| 206 |
a2._method.getDefiningClass() != null ? |
| 207 |
a2._method.getDefiningClass().getName() : null); |
| 208 |
break; |
| 209 |
case AD_COL_PACKAGE_NAME: |
| 210 |
ret = Utils.compare(a1._method != null && |
| 211 |
a1._method.getDefiningClass() != null && |
| 212 |
a1._method.getDefiningClass().getPackage() != null ? |
| 213 |
a1._method.getDefiningClass().getPackage().getName() : null |
| 214 |
, a2._method != null && |
| 215 |
a2._method.getDefiningClass() != null && |
| 216 |
a2._method.getDefiningClass().getPackage() != null ? |
| 217 |
a2._method.getDefiningClass().getPackage().getName() : null); |
| 218 |
break; |
| 219 |
case AD_COL_LINE_NO: |
| 220 |
ret = a1._lineNo - a2._lineNo; |
| 221 |
break; |
| 222 |
case AD_COL_TOTAL_INST: |
| 223 |
ret = a1._total - a2._total; |
| 224 |
break; |
| 225 |
case AD_COL_TOTAL_SIZE: |
| 226 |
ret = a1._totalSize - a2._totalSize; |
| 227 |
break; |
| 228 |
case AD_COL_LIVE_INST: |
| 229 |
ret = (a1._total - a1._collected) - (a2._total - a2._collected); |
| 230 |
break; |
| 231 |
case AD_COL_LIVE_SIZE: |
| 232 |
ret = (a1._totalSize - a1._collectedSize) - (a2._totalSize - a2._collectedSize); |
| 233 |
break; |
| 234 |
case AD_COL_AVG_AGE: |
| 235 |
double age1 = a1._total > 0 ? a1._sumAges / a1._total : 0; |
| 236 |
double age2 = a2._total > 0 ? a2._sumAges / a2._total : 0; |
| 237 |
ret = Utils.compare(age1, age2); |
| 238 |
break; |
| 239 |
} |
| 240 |
return ret; |
| 100 |
} |
241 |
} |
| 101 |
|
242 |
|
| 102 |
public Object[] getElements(Object inputElement) { |
243 |
public Object[] getElements(Object inputElement) { |
| 103 |
TRCClass cls = getSelectedClass(); |
244 |
updateData(); |
| 104 |
if (null == cls) |
245 |
return _allocSites.values().toArray(); |
| 105 |
return _emptyArr; |
|
|
| 106 |
EList list = cls.getAnnotations(); |
| 107 |
if (null == list) |
| 108 |
return _emptyArr; |
| 109 |
return list.toArray(); |
| 110 |
} |
| 111 |
|
| 112 |
public int compare(Viewer viewer, Object e1, Object e2, int pos) { |
| 113 |
return 0; |
| 114 |
} |
246 |
} |
| 115 |
|
247 |
|
| 116 |
public Object[] getChildren(Object parentElement) { |
248 |
public Object[] getChildren(Object parentElement) { |
|
Lines 123-148
Link Here
|
| 123 |
|
255 |
|
| 124 |
protected StatisticSorter getViewerSorterInstance() { |
256 |
protected StatisticSorter getViewerSorterInstance() { |
| 125 |
return new StatisticSorter() { |
257 |
return new StatisticSorter() { |
|
|
258 |
public int compare(Viewer viewer, Object e1, Object e2) { |
| 259 |
return _sortSequence * compareElements(e1, e2, _pos, _info.isDeltaColumn()); |
| 260 |
} |
| 126 |
}; |
261 |
}; |
| 127 |
} |
262 |
} |
| 128 |
|
263 |
|
| 129 |
protected void populateData(Object obj) { |
264 |
protected void showAllocDetails(Object obj) { |
| 130 |
if (obj instanceof TRCClass) { |
265 |
if (obj == null || obj instanceof TRCClass) { |
| 131 |
_class = (TRCClass) obj; |
266 |
_class = (TRCClass) obj; |
| 132 |
refresh(); |
267 |
_nextIndex = 0; |
|
|
268 |
_allocSites.clear(); |
| 269 |
String text = Utils.getPackageClassName(_class); |
| 270 |
if (text.length() > 0) |
| 271 |
text = "Allocation details for '" + text + "'"; |
| 272 |
_label.setText(text); |
| 273 |
//_label.getParent().layout(); |
| 133 |
} |
274 |
} |
|
|
275 |
refresh(); |
| 134 |
} |
276 |
} |
| 135 |
|
277 |
|
| 136 |
public void handleViewSelectionChangedEvent(ViewSelectionChangedEvent event) { |
278 |
void updateData() { |
| 137 |
Object source = event.getSource(); |
279 |
if (null == _class) |
| 138 |
if (source != this) { |
280 |
return; |
| 139 |
ITraceSelection model = UIPlugin.getDefault().getSelectionModel(_page.getMOFObject()); |
281 |
TRCObjectAllocationAnnotation aa = Utils.getAllocationAnnotation(_class); |
| 140 |
if (model.size() > 0) { |
282 |
if (null == aa) |
| 141 |
Object sel = model.getFirstElement(); |
283 |
return; |
| 142 |
if (sel != null) { |
284 |
EList listGC = _class.getPackage().getProcess().getGcEvents(); |
| 143 |
populateData(sel); |
285 |
EList lineNumbers = aa.getLineNumbers(); |
|
|
286 |
EList methods = aa.getMethods(); |
| 287 |
EList objects = _class.getObjects(); |
| 288 |
int lineNoLen = lineNumbers.size(); |
| 289 |
int methodsLen = methods.size(); |
| 290 |
int objectsLen = objects.size(); |
| 291 |
// gather alloc sites by line No |
| 292 |
for (int i = _nextIndex; i < lineNoLen; i++) { |
| 293 |
Integer lineNo = (Integer) lineNumbers.get(i); |
| 294 |
AllocationSite allocSite = (AllocationSite) _allocSites.get(lineNo); |
| 295 |
if (null == allocSite) { |
| 296 |
TRCMethod method = null; |
| 297 |
int line = lineNo.intValue(); |
| 298 |
// find corresponding method |
| 299 |
for (int j = 0; j < methodsLen; j++) { |
| 300 |
TRCMethod method0 = (TRCMethod) methods.get(j); |
| 301 |
if (line >= method0.getLineNo() && line <= method0.getLineNo() + method0.getLineCount()) { |
| 302 |
method = method0; |
| 303 |
break; |
| 304 |
} |
| 305 |
} |
| 306 |
allocSite = new AllocationSite(line, method); |
| 307 |
_allocSites.put(lineNo, allocSite); |
| 308 |
} |
| 309 |
int j = i + i + 1; |
| 310 |
if (j < objectsLen && objects.get(j) instanceof TRCFullTraceObject) { |
| 311 |
TRCFullTraceObject trObj = (TRCFullTraceObject) objects.get(j); |
| 312 |
if (trObj.getCollectTime() > 0) { |
| 313 |
allocSite._collected++; |
| 314 |
allocSite._collectedSize += trObj.getSize(); |
| 144 |
} |
315 |
} |
|
|
316 |
allocSite._totalSize += trObj.getSize(); |
| 317 |
int age = Utils.getObjAge(trObj, listGC); |
| 318 |
allocSite._sumAges += age; |
| 319 |
allocSite._total++; |
| 145 |
} |
320 |
} |
| 146 |
} |
321 |
} |
|
|
322 |
_nextIndex = lineNoLen; |
| 323 |
} |
| 324 |
|
| 325 |
public void widgetDefaultSelected(SelectionEvent event) { |
| 326 |
if (event.item.getData() instanceof AllocationSite) { |
| 327 |
AllocationSite allocSite = (AllocationSite) event.item.getData(); |
| 328 |
String pattern = Utils.composeMethodName(allocSite); |
| 329 |
Utils.openSource(pattern); |
| 330 |
} |
| 147 |
} |
331 |
} |
| 148 |
} |
332 |
} |