Skip to content

Commit a2dcde6

Browse files
wildmaplesnirvdrum
authored andcommitted
Shift TruffleBoundary around
1 parent d2532c2 commit a2dcde6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/main/java/org/truffleruby/core/regexp/TruffleRegexpNodes.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@
7575
@CoreModule("Truffle::RegexpOperations")
7676
public class TruffleRegexpNodes {
7777

78-
@TruffleBoundary
7978
public static Matcher createMatcher(RubyContext context, RubyRegexp regexp, Rope stringRope, byte[] stringBytes,
8079
boolean encodingConversion, int start, Node currentNode) {
8180
final Encoding enc = checkEncoding(regexp, stringRope.getEncoding(), stringRope.getCodeRange());
@@ -86,10 +85,9 @@ public static Matcher createMatcher(RubyContext context, RubyRegexp regexp, Rope
8685
regex = encodingCache.getOrCreate(enc, e -> makeRegexpForEncoding(context, regexp, e, currentNode));
8786
}
8887

89-
return regex.matcher(stringBytes, start, stringBytes.length);
88+
return getMatcher(regex, stringBytes, start);
9089
}
9190

92-
@TruffleBoundary
9391
public static Encoding checkEncoding(RubyRegexp regexp, Encoding strEnc, CodeRange codeRange) {
9492
final Encoding regexEnc = regexp.regex.getEncoding();
9593

@@ -103,6 +101,12 @@ public static Encoding checkEncoding(RubyRegexp regexp, Encoding strEnc, CodeRan
103101
return strEnc;
104102
}
105103

104+
@TruffleBoundary
105+
private static Matcher getMatcher(Regex regex, byte[] stringBytes, int start) {
106+
return regex.matcher(stringBytes, start, stringBytes.length);
107+
}
108+
109+
@TruffleBoundary
106110
private static Regex makeRegexpForEncoding(RubyContext context, RubyRegexp regexp, Encoding enc, Node currentNode) {
107111
final Encoding[] fixedEnc = new Encoding[]{ null };
108112
final Rope sourceRope = regexp.source;

0 commit comments

Comments
 (0)