Skip to content

Commit 7b937ba

Browse files
committed
Split all the transient callers of Truffle::Type.coerce_to_regexp
1 parent 8e663ee commit 7b937ba

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/main/ruby/truffleruby/core/string.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,7 @@ def sub(pattern, replacement = undefined, &block)
654654
Primitive.string_replace(s, res) if res
655655
s
656656
end
657+
Truffle::Graal.always_split(instance_method(:sub))
657658

658659
def sub!(pattern, replacement = undefined, &block)
659660
if Primitive.undefined?(replacement) && !block_given?
@@ -672,6 +673,7 @@ def sub!(pattern, replacement = undefined, &block)
672673
nil
673674
end
674675
end
676+
Truffle::Graal.always_split(instance_method(:sub!))
675677

676678
def slice!(one, two = undefined)
677679
Primitive.check_mutable_string self
@@ -899,6 +901,7 @@ def gsub(pattern, replacement = undefined, &block)
899901
Primitive.string_replace(s, res) if res
900902
s
901903
end
904+
Truffle::Graal.always_split(instance_method(:gsub))
902905

903906
def gsub!(pattern, replacement = undefined, &block)
904907
if Primitive.undefined?(replacement) && !block_given?
@@ -917,6 +920,7 @@ def gsub!(pattern, replacement = undefined, &block)
917920
nil
918921
end
919922
end
923+
Truffle::Graal.always_split(instance_method(:gsub!))
920924

921925
def match(pattern, pos = 0)
922926
pattern = Truffle::Type.coerce_to_regexp(pattern) unless Primitive.is_a?(pattern, Regexp)
@@ -931,11 +935,13 @@ def match(pattern, pos = 0)
931935
Primitive.regexp_last_match_set(Primitive.caller_special_variables, $~)
932936
result
933937
end
938+
Truffle::Graal.always_split(instance_method(:match))
934939

935940
def match?(pattern, pos = 0)
936941
pattern = Truffle::Type.coerce_to_regexp(pattern) unless Primitive.is_a?(pattern, Regexp)
937942
pattern.match? self, pos
938943
end
944+
Truffle::Graal.always_split(instance_method(:match?))
939945

940946
def scrub(replace = nil, &block)
941947
return Primitive.dup_as_string_instance(self) if valid_encoding?

src/main/ruby/truffleruby/core/symbol.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ def match?(pattern, pos = 0)
108108
pattern = Truffle::Type.coerce_to_regexp(pattern) unless Primitive.is_a?(pattern, Regexp)
109109
pattern.match? to_s, pos
110110
end
111+
Truffle::Graal.always_split(instance_method(:match?))
111112

112113
def encoding
113114
Primitive.encoding_get_object_encoding self

src/main/ruby/truffleruby/core/truffle/string_operations.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def self.gsub_internal_matches(global, orig, pattern)
7676
gsub_other_matches(global, orig, pattern)
7777
end
7878
end
79+
Truffle::Graal.always_split(method(:gsub_internal_matches))
7980

8081
def self.gsub_new_offset(orig, match)
8182
start_pos = Primitive.match_data_byte_begin(match, 0)
@@ -127,6 +128,7 @@ def self.gsub_other_matches(global, orig, pattern)
127128
end
128129
res
129130
end
131+
Truffle::Graal.always_split(method(:gsub_other_matches))
130132

131133
def self.gsub_internal_yield_matches(orig, matches)
132134
return nil if matches.empty?

0 commit comments

Comments
 (0)