Skip to content

Commit c710062

Browse files
committed
[GR-13795] Removed deprecated DebugStackFrame#iterator and DebugStackFrame#getValue.
PullRequest: graal/2982
2 parents d2deb63 + 13c7dfb commit c710062

File tree

4 files changed

+4
-116
lines changed

4 files changed

+4
-116
lines changed

truffle/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ This changelog summarizes major changes between Truffle versions relevant to lan
4141
- GraalTruffleRuntime.getQueuedCallTargets
4242
- PrimitiveValueProfile.exactCompare
4343
- BranchProfile.isVisited
44+
- DebugStackFrame.iterator and DebugStackFrame.getValue
4445
* The [@Option](http://www.graalvm.org/truffle/javadoc/com/oracle/truffle/api/Option.html) annotation can now specify the [stability](https://www.graalvm.org/truffle/javadoc/org/graalvm/options/OptionStability.html) of an option.
4546
* Fixed the case of the method [`TruffleStackTrace.getStacktrace`](https://www.graalvm.org/truffle/javadoc/com/oracle/truffle/api/TruffleStackTrace.html#getStacktrace-java.lang.Throwable-) to `TruffleStackTrace.getStackTrace`.
4647

truffle/src/com.oracle.truffle.api.debug/snapshot.sigtest

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,19 +112,14 @@ supr java.lang.Object
112112
hfds debugger,event,frame,iterator,language,parent,root,scope,variables
113113

114114
CLSS public final com.oracle.truffle.api.debug.DebugStackFrame
115-
intf java.lang.Iterable<com.oracle.truffle.api.debug.DebugValue>
116115
meth public boolean equals(java.lang.Object)
117116
meth public boolean isInternal()
118117
meth public com.oracle.truffle.api.debug.DebugScope getScope()
119118
meth public com.oracle.truffle.api.debug.DebugValue eval(java.lang.String)
120-
meth public com.oracle.truffle.api.debug.DebugValue getValue(java.lang.String)
121-
anno 0 java.lang.Deprecated()
122119
meth public com.oracle.truffle.api.nodes.LanguageInfo getLanguage()
123120
meth public com.oracle.truffle.api.source.SourceSection getSourceSection()
124121
meth public int hashCode()
125122
meth public java.lang.String getName()
126-
meth public java.util.Iterator<com.oracle.truffle.api.debug.DebugValue> iterator()
127-
anno 0 java.lang.Deprecated()
128123
supr java.lang.Object
129124
hfds currentFrame,depth,event
130125

truffle/src/com.oracle.truffle.api.debug/src/com/oracle/truffle/api/debug/DebugStackFrame.java

Lines changed: 1 addition & 109 deletions
Original file line numberDiff line numberDiff line change
@@ -40,10 +40,7 @@
4040
*/
4141
package com.oracle.truffle.api.debug;
4242

43-
import java.util.HashSet;
4443
import java.util.Iterator;
45-
import java.util.NoSuchElementException;
46-
import java.util.Set;
4744

4845
import com.oracle.truffle.api.CallTarget;
4946
import com.oracle.truffle.api.RootCallTarget;
@@ -78,7 +75,7 @@
7875
* @see SuspendedEvent#getTopStackFrame()
7976
* @since 0.17
8077
*/
81-
public final class DebugStackFrame implements Iterable<DebugValue> {
78+
public final class DebugStackFrame {
8279

8380
final SuspendedEvent event;
8481
private final FrameInstance currentFrame;
@@ -236,38 +233,6 @@ public DebugScope getScope() throws DebugException {
236233
}
237234
}
238235

239-
/**
240-
* Lookup a stack value with a given name. If no value is available in the current stack frame
241-
* with that name <code>null</code> is returned. Stack values are only accessible as as long as
242-
* the {@link DebugStackFrame debug stack frame} is valid. Debug stack frames are only valid as
243-
* long as the source {@link SuspendedEvent suspended event} is valid.
244-
* <p>
245-
* This method is not thread-safe and will throw an {@link IllegalStateException} if called on
246-
* another thread than it was created with.
247-
*
248-
* @param name the name of the local variable to query.
249-
* @return the value from the stack
250-
* @since 0.17
251-
* @deprecated Use {@link #getScope()} and {@link DebugScope#getDeclaredValue(java.lang.String)}
252-
* .
253-
*/
254-
@Deprecated
255-
public DebugValue getValue(String name) {
256-
DebugScope scope = getScope();
257-
while (scope != null) {
258-
DebugValue value = scope.getDeclaredValue(name);
259-
if (value != null) {
260-
return value;
261-
}
262-
// Search for the value up to the function root, to be compatible.
263-
if (scope.isFunctionScope()) {
264-
break;
265-
}
266-
scope = scope.getParent();
267-
}
268-
return null;
269-
}
270-
271236
DebugValue wrapHeapValue(Object result) {
272237
LanguageInfo language;
273238
RootNode root = findCurrentRoot();
@@ -302,79 +267,6 @@ public DebugValue eval(String code) throws DebugException {
302267
return wrapHeapValue(result);
303268
}
304269

305-
/**
306-
* Returns an {@link Iterator iterator} for all stack values available in this frame. The
307-
* returned stack values remain valid as long as the current stack frame remains valid.
308-
*
309-
* <p>
310-
* This method is not thread-safe and will throw an {@link IllegalStateException} if called on
311-
* another thread than it was created with.
312-
*
313-
* @since 0.17
314-
* @deprecated Use {@link #getScope()} and {@link DebugScope#getDeclaredValues()}.
315-
*/
316-
@Deprecated
317-
public Iterator<DebugValue> iterator() {
318-
DebugScope cscope = getScope();
319-
// Merge non-masked variables from all scopes:
320-
return new Iterator<DebugValue>() {
321-
private DebugScope scope = cscope;
322-
private Iterator<DebugValue> variables;
323-
private DebugValue nextVar;
324-
private Set<String> names = new HashSet<>();
325-
326-
@Override
327-
public boolean hasNext() {
328-
if (nextVar != null) {
329-
return true;
330-
}
331-
for (;;) {
332-
if (variables == null && scope != null) {
333-
variables = scope.getDeclaredValues().iterator();
334-
if (!variables.hasNext()) {
335-
variables = null;
336-
}
337-
if (scope.isFunctionScope()) {
338-
// Stop at the function, do not go to closures, to be compatible.
339-
scope = null;
340-
} else {
341-
scope = scope.getParent();
342-
}
343-
if (variables == null) {
344-
continue;
345-
}
346-
}
347-
if (variables != null && variables.hasNext()) {
348-
nextVar = variables.next();
349-
String name = nextVar.getName();
350-
if (!names.contains(name)) {
351-
names.add(name);
352-
return true;
353-
}
354-
} else {
355-
variables = null;
356-
if (scope == null) {
357-
return false;
358-
}
359-
}
360-
}
361-
}
362-
363-
@Override
364-
public DebugValue next() {
365-
if (nextVar == null) {
366-
hasNext();
367-
}
368-
DebugValue var = nextVar;
369-
if (var == null) {
370-
throw new NoSuchElementException();
371-
}
372-
nextVar = null;
373-
return var;
374-
}
375-
};
376-
}
377-
378270
/**
379271
* @since 1.0
380272
*/

vm/mx.vm/suite.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
},
3838
{
3939
"name": "truffleruby",
40-
"version": "dd198f9c34e4e7bb5e1ed599b5d88eafb999b332",
40+
"version": "ea48af25ccebf1af8ce752b8cc886204d27566a3",
4141
"dynamic": True,
4242
"urls": [
4343
{"url": "https://github.com/oracle/truffleruby.git", "kind": "git"},
@@ -61,7 +61,7 @@
6161
},
6262
{
6363
"name": "fastr",
64-
"version": "6af23b2db13ba09242a46a7a7114a289a048abf5",
64+
"version": "2358e9762f9b102d3539a2e673e653e470a1bbf3",
6565
"dynamic": True,
6666
"urls": [
6767
{"url": "https://github.com/oracle/fastr.git", "kind": "git"},

0 commit comments

Comments
 (0)