51
51
import org .truffleruby .core .proc .ProcOperations ;
52
52
import org .truffleruby .core .proc .RubyProc ;
53
53
import org .truffleruby .core .regexp .RegexpCacheKey ;
54
+ import org .truffleruby .core .rope .NativeRope ;
54
55
import org .truffleruby .core .rope .PathToRopeCache ;
55
- import org .truffleruby .core .rope .Rope ;
56
- import org .truffleruby .core .string .FrozenStringLiterals ;
57
- import org .truffleruby .core .string .RubyString ;
58
56
import org .truffleruby .core .symbol .RubySymbol ;
59
57
import org .truffleruby .core .thread .ThreadManager ;
60
58
import org .truffleruby .core .time .GetTimeZoneNode ;
61
59
import org .truffleruby .debug .MetricsProfiler ;
62
60
import org .truffleruby .extra .ffi .Pointer ;
63
61
import org .truffleruby .interop .InteropManager ;
64
62
import org .truffleruby .language .CallStackManager ;
63
+ import org .truffleruby .language .ImmutableRubyString ;
65
64
import org .truffleruby .language .LexicalScope ;
66
65
import org .truffleruby .language .RubyBaseNode ;
67
66
import org .truffleruby .language .SafepointManager ;
@@ -117,7 +116,6 @@ public class RubyContext {
117
116
private final SharedObjects sharedObjects = new SharedObjects (this );
118
117
private final AtExitManager atExitManager = new AtExitManager (this );
119
118
private final CallStackManager callStack = new CallStackManager (this );
120
- private final FrozenStringLiterals frozenStringLiterals ;
121
119
private final CoreExceptions coreExceptions ;
122
120
private final EncodingManager encodingManager ;
123
121
private final MetricsProfiler metricsProfiler = new MetricsProfiler (this );
@@ -128,6 +126,7 @@ public class RubyContext {
128
126
private final Map <Source , Integer > sourceLineOffsets = Collections .synchronizedMap (new WeakHashMap <>());
129
127
/** (Symbol, refinements) -> Proc for Symbol#to_proc */
130
128
public final Map <Pair <RubySymbol , Map <RubyModule , RubyModule []>>, RootCallTarget > cachedSymbolToProcTargetsWithRefinements = new ConcurrentHashMap <>();
129
+ private final Map <ImmutableRubyString , NativeRope > immutableNativeRopes = new ConcurrentHashMap <>();
131
130
132
131
@ CompilationFinal private SecureRandom random ;
133
132
private final Hashing hashing ;
@@ -173,7 +172,6 @@ public RubyContext(RubyLanguage language, TruffleLanguage.Env env) {
173
172
options = createOptions (env , language .options );
174
173
175
174
safepointManager = new SafepointManager (this , language );
176
- frozenStringLiterals = new FrozenStringLiterals (this , language );
177
175
coreExceptions = new CoreExceptions (this , language );
178
176
encodingManager = new EncodingManager (this , language );
179
177
@@ -626,14 +624,6 @@ public CallStackManager getCallStack() {
626
624
return callStack ;
627
625
}
628
626
629
- public RubyString getFrozenStringLiteral (Rope rope ) {
630
- return frozenStringLiterals .getFrozenStringLiteral (rope );
631
- }
632
-
633
- public RubyString getInternedString (RubyString string ) {
634
- return frozenStringLiterals .getFrozenStringLiteral (string );
635
- }
636
-
637
627
public Object getClassVariableDefinitionLock () {
638
628
return classVariableDefinitionLock ;
639
629
}
@@ -758,6 +748,10 @@ public Map<Source, Integer> getSourceLineOffsets() {
758
748
return sourceLineOffsets ;
759
749
}
760
750
751
+ public Map <ImmutableRubyString , NativeRope > getImmutableNativeRopes () {
752
+ return immutableNativeRopes ;
753
+ }
754
+
761
755
private static SecureRandom createRandomInstance () {
762
756
try {
763
757
/* We want to use a non-blocking source because this is what MRI does (via /dev/urandom) and it's been found
0 commit comments