13
13
import java .util .Collection ;
14
14
15
15
import org .truffleruby .RubyContext ;
16
+ import org .truffleruby .RubyLanguage ;
16
17
import org .truffleruby .core .binding .BindingNodes ;
17
18
import org .truffleruby .core .klass .RubyClass ;
18
19
import org .truffleruby .core .proc .RubyProc ;
22
23
import org .truffleruby .language .objects .LogicalClassNode ;
23
24
import org .truffleruby .shared .TruffleRuby ;
24
25
25
- import com .oracle .truffle .api .Assumption ;
26
26
import com .oracle .truffle .api .CompilerDirectives ;
27
27
import com .oracle .truffle .api .CompilerDirectives .TruffleBoundary ;
28
28
import com .oracle .truffle .api .frame .VirtualFrame ;
32
32
import com .oracle .truffle .api .instrumentation .SourceSectionFilter ;
33
33
import com .oracle .truffle .api .instrumentation .Tag ;
34
34
import com .oracle .truffle .api .profiles .ConditionProfile ;
35
- import com .oracle .truffle .api .utilities .CyclicAssumption ;
36
35
37
36
public class TraceManager {
38
37
public static class LineTag extends Tag {
@@ -49,20 +48,16 @@ public static class NeverTag extends Tag {
49
48
}
50
49
51
50
private final RubyContext context ;
51
+ private final RubyLanguage language ;
52
52
private final Instrumenter instrumenter ;
53
- private final CyclicAssumption unusedAssumption ;
54
53
55
54
private Collection <EventBinding <?>> instruments ;
56
55
private boolean isInTraceFunc = false ;
57
56
58
- public TraceManager (RubyContext context , Instrumenter instrumenter ) {
57
+ public TraceManager (RubyLanguage language , RubyContext context , Instrumenter instrumenter ) {
58
+ this .language = language ;
59
59
this .context = context ;
60
60
this .instrumenter = instrumenter ;
61
- this .unusedAssumption = new CyclicAssumption ("set_trace_func is not used" );
62
- }
63
-
64
- public Assumption getUnusedAssumption () {
65
- return unusedAssumption .getAssumption ();
66
61
}
67
62
68
63
@ TruffleBoundary
@@ -76,13 +71,13 @@ public synchronized void setTraceFunc(RubyProc traceFunc) {
76
71
77
72
if (traceFunc == null ) {
78
73
// Update to a new valid assumption
79
- unusedAssumption .invalidate ();
74
+ language . traceFuncUnusedAssumption .invalidate ();
80
75
instruments = null ;
81
76
return ;
82
77
}
83
78
84
79
// Invalidate current assumption
85
- unusedAssumption .getAssumption ().invalidate ();
80
+ language . traceFuncUnusedAssumption .getAssumption ().invalidate ();
86
81
87
82
instruments = new ArrayList <>();
88
83
0 commit comments