@@ -71,10 +71,7 @@ public Collection<StackTrace> getStackTraces() {
71
71
public abstract static class StackTrace {
72
72
73
73
private final Instance thread ;
74
- final Heap heap ;
75
-
76
- private StackTrace (Heap h , Instance t ) {
77
- heap = h ;
74
+ private StackTrace (Instance t ) {
78
75
thread = t ;
79
76
}
80
77
@@ -90,13 +87,13 @@ public static class Frame {
90
87
private final String name ;
91
88
private final List <FieldValue > fieldValues ;
92
89
93
- private Frame (Heap heap , Instance callTarget , TruffleFrame localFrame ) {
94
- name = getFrameName (callTarget , heap );
90
+ private Frame (Instance callTarget , TruffleFrame localFrame ) {
91
+ name = getFrameName (callTarget );
95
92
fieldValues = localFrame .getFieldValues ();
96
93
}
97
94
98
- private Frame (Heap heap , Instance callTarget , Instance localFrame ) {
99
- name = getFrameName (callTarget , heap );
95
+ private Frame (Instance callTarget , Instance localFrame ) {
96
+ name = getFrameName (callTarget );
100
97
fieldValues = new TruffleFrame (localFrame ).getFieldValues ();
101
98
}
102
99
@@ -108,7 +105,7 @@ public List<FieldValue> getFieldValues() {
108
105
return fieldValues ;
109
106
}
110
107
111
- private static String getFrameName (Instance callTarget , Heap heap ) {
108
+ private static String getFrameName (Instance callTarget ) {
112
109
Instance rootNode = (Instance ) callTarget .getValueOfField ("rootNode" ); // NOI18N
113
110
114
111
if (rootNode != null ) {
@@ -117,7 +114,7 @@ private static String getFrameName(Instance callTarget, Heap heap) {
117
114
if (sourceSection != null ) {
118
115
Instance source = (Instance ) sourceSection .getValueOfField ("source" ); // NOI18N
119
116
if (source != null ) {
120
- String fileName = getFileName (source , heap );
117
+ String fileName = getFileName (source );
121
118
return name +" (" +fileName +":" +getLineNumber (sourceSection , source )+")" ; // NOI18N
122
119
}
123
120
}
@@ -127,7 +124,7 @@ private static String getFrameName(Instance callTarget, Heap heap) {
127
124
}
128
125
}
129
126
130
- private static String getFileName (Instance source , Heap heap ) {
127
+ private static String getFileName (Instance source ) {
131
128
Object key = source .getValueOfField ("key" ); // NOI18N
132
129
if (key instanceof Instance ) {
133
130
source = (Instance ) key ;
@@ -251,7 +248,7 @@ private Collection<StackTrace> getStackTraces(Heap heap, Instance stackTraces) {
251
248
Instance topFrame = getTruffleFrameInstance (thread , stackTraces );
252
249
253
250
if (topFrame != null ) {
254
- traces .add (new DefaultStackTrace (heap , thread , topFrame ));
251
+ traces .add (new DefaultStackTrace (thread , topFrame ));
255
252
}
256
253
}
257
254
}
@@ -297,8 +294,8 @@ private static class DefaultStackTrace extends StackTrace {
297
294
private final Instance topFrame ;
298
295
private List <Frame > frames ;
299
296
300
- private DefaultStackTrace (Heap h , Instance t , Instance f ) {
301
- super (h , t );
297
+ private DefaultStackTrace (Instance t , Instance f ) {
298
+ super (t );
302
299
topFrame = f ;
303
300
}
304
301
@@ -308,7 +305,7 @@ public synchronized List<Frame> getFrames() {
308
305
frames = new ArrayList ();
309
306
310
307
do {
311
- frames .add (new DefaultFrame (heap , frame ));
308
+ frames .add (new DefaultFrame (frame ));
312
309
frame = (Instance ) frame .getValueOfField ("callerFrame" ); // NOI18N
313
310
} while (frame != null );
314
311
}
@@ -318,10 +315,9 @@ public synchronized List<Frame> getFrames() {
318
315
319
316
private static class DefaultFrame extends Frame {
320
317
321
- private DefaultFrame (Heap heap , Instance frame ) {
322
- super (heap ,
323
- (Instance ) frame .getValueOfField ("target" ), // NOI18N
324
- (Instance ) frame .getValueOfField ("frame" ) // NOI18N
318
+ private DefaultFrame (Instance frame ) {
319
+ super ((Instance ) frame .getValueOfField ("target" ), // NOI18N
320
+ (Instance ) frame .getValueOfField ("frame" ) // NOI18N
325
321
);
326
322
}
327
323
}
@@ -369,7 +365,7 @@ private void computeStackTrace(Heap heap, FrameVisitor visitor) {
369
365
Map <Integer , List <JavaFrameGCRoot >> localsMap = javaFrameMap .get (threadRoot );
370
366
371
367
if (localsMap != null ) {
372
- HotSpotStackTrace hsStackTrace = new HotSpotStackTrace (heap , threadInstance );
368
+ HotSpotStackTrace hsStackTrace = new HotSpotStackTrace (threadInstance );
373
369
for (int i = 0 ; i < stack .length ; i ++) {
374
370
StackTraceElement stackElement = stack [i ];
375
371
List <JavaFrameGCRoot > locals = localsMap .get (Integer .valueOf (i ));
@@ -454,14 +450,14 @@ private Frame visitFrame(List<JavaFrameGCRoot> callTargetFrame, List<JavaFrameGC
454
450
localFrame = findLocalFrame (callNodeFrame );
455
451
456
452
if (callTarget != null && localFrame != null ) {
457
- return new Frame (heap , callTarget , localFrame );
453
+ return new Frame (callTarget , localFrame );
458
454
}
459
455
callTarget = findLocalInstance (callNodeFrame ,
460
456
DEFAULT_CALL_TARGET_FQN , OPTIMIZED_CALL_TARGET_FQN , ENT_OPTIMIZED_CALL_TARGET_FQN ,
461
457
OPTIMIZED_CALL_TARGET1_FQN , OPTIMIZED_CALL_TARGET2_FQN );
462
458
localFrame = findLocalFrame (callTargetFrame );
463
459
if (callTarget != null && localFrame != null ) {
464
- return new Frame (heap , callTarget , localFrame );
460
+ return new Frame (callTarget , localFrame );
465
461
}
466
462
return null ;
467
463
}
@@ -483,8 +479,8 @@ private static class HotSpotStackTrace extends StackTrace {
483
479
484
480
List <Frame > frames ;
485
481
486
- HotSpotStackTrace (Heap h , Instance t ) {
487
- super (h , t );
482
+ HotSpotStackTrace (Instance t ) {
483
+ super (t );
488
484
frames = new ArrayList ();
489
485
}
490
486
0 commit comments