13
13
import java .util .HashMap ;
14
14
import java .util .Map ;
15
15
16
+ import com .oracle .truffle .api .CompilerDirectives .CompilationFinal ;
16
17
import org .jcodings .specific .ASCIIEncoding ;
17
18
import org .jcodings .specific .USASCIIEncoding ;
18
19
import org .jcodings .specific .UTF8Encoding ;
@@ -30,9 +31,9 @@ public class RopeConstants {
30
31
public static final LeafRope EMPTY_UTF8_ROPE = withHashCode (
31
32
new AsciiOnlyLeafRope (EMPTY_BYTES , UTF8Encoding .INSTANCE ));
32
33
33
- public static final LeafRope [] UTF8_SINGLE_BYTE_ROPES = new LeafRope [256 ];
34
- public static final LeafRope [] US_ASCII_SINGLE_BYTE_ROPES = new LeafRope [256 ];
35
- public static final LeafRope [] ASCII_8BIT_SINGLE_BYTE_ROPES = new LeafRope [256 ];
34
+ @ CompilationFinal ( dimensions = 1 ) public static final LeafRope [] UTF8_SINGLE_BYTE_ROPES = new LeafRope [256 ];
35
+ @ CompilationFinal ( dimensions = 1 ) public static final LeafRope [] US_ASCII_SINGLE_BYTE_ROPES = new LeafRope [256 ];
36
+ @ CompilationFinal ( dimensions = 1 ) public static final LeafRope [] ASCII_8BIT_SINGLE_BYTE_ROPES = new LeafRope [256 ];
36
37
37
38
static {
38
39
for (int i = 0 ; i < 128 ; i ++) {
@@ -128,7 +129,7 @@ public static LeafRope lookupUSASCII(String string) {
128
129
}
129
130
}
130
131
131
- private static final LeafRope [] PADDED_NUMBERS = createPaddedNumbersTable ();
132
+ @ CompilationFinal ( dimensions = 1 ) private static final LeafRope [] PADDED_NUMBERS = createPaddedNumbersTable ();
132
133
133
134
private static LeafRope [] createPaddedNumbersTable () {
134
135
final LeafRope [] table = new LeafRope [100 ];
@@ -147,7 +148,7 @@ public static LeafRope paddedNumber(int n) {
147
148
return PADDED_NUMBERS [n ];
148
149
}
149
150
150
- private static final LeafRope [] PADDING_ZEROS = createPaddingZeroTable ();
151
+ @ CompilationFinal ( dimensions = 1 ) private static final LeafRope [] PADDING_ZEROS = createPaddingZeroTable ();
151
152
152
153
private static LeafRope [] createPaddingZeroTable () {
153
154
final LeafRope [] table = new LeafRope [6 ];
0 commit comments