File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed
src/main/java/org/truffleruby/language Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change 9
9
*/
10
10
package org .truffleruby .language ;
11
11
12
+ import com .oracle .truffle .api .TruffleLanguage .ContextReference ;
12
13
import org .truffleruby .RubyContext ;
13
14
import org .truffleruby .RubyLanguage ;
14
15
18
19
/** Has context but nothing else. */
19
20
public abstract class RubyContextNode extends RubyBaseNode implements RubyNode .WithContext {
20
21
21
- @ CompilationFinal private RubyContext context ;
22
-
23
- // Accessors
22
+ @ CompilationFinal private ContextReference <RubyContext > contextReference ;
24
23
25
24
@ Override
26
25
public RubyContext getContext () {
27
- if (context == null ) {
26
+ if (contextReference == null ) {
28
27
CompilerDirectives .transferToInterpreterAndInvalidate ();
29
- context = RubyLanguage .getCurrentContext ( );
28
+ contextReference = lookupContextReference ( RubyLanguage .class );
30
29
}
31
30
32
- return context ;
31
+ return contextReference . get () ;
33
32
}
34
-
35
33
}
You can’t perform that action at this time.
0 commit comments