Skip to content

Commit 9cda3b3

Browse files
author
Nicolas Laurent
committed
[GR-26132] Clean uses of Truffle::Graal.always_split for core methods.
PullRequest: truffleruby/1980
2 parents 574d6bd + 82dfe7a commit 9cda3b3

File tree

4 files changed

+5
-8
lines changed

4 files changed

+5
-8
lines changed

src/main/java/org/truffleruby/core/array/ArrayNodes.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
import org.truffleruby.language.control.RaiseException;
7373
import org.truffleruby.language.dispatch.DispatchNode;
7474
import org.truffleruby.language.library.RubyLibrary;
75+
import org.truffleruby.language.methods.Split;
7576
import org.truffleruby.language.objects.AllocateHelperNode;
7677
import org.truffleruby.language.objects.PropagateTaintNode;
7778
import org.truffleruby.language.objects.WriteObjectFieldNode;
@@ -250,6 +251,7 @@ protected Object at(RubyArray array, Object index,
250251

251252
@CoreMethod(
252253
names = { "[]", "slice" },
254+
split = Split.ALWAYS,
253255
required = 1,
254256
optional = 1,
255257
lowerFixnum = { 1, 2 },
@@ -304,6 +306,7 @@ protected Object sliceFallback(RubyArray array, Object start, Object length,
304306

305307
@CoreMethod(
306308
names = "[]=",
309+
split = Split.ALWAYS,
307310
required = 2,
308311
optional = 1,
309312
lowerFixnum = { 1, 2 },

src/main/java/org/truffleruby/core/string/StringNodes.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@
172172
import org.truffleruby.language.control.RaiseException;
173173
import org.truffleruby.language.dispatch.DispatchNode;
174174
import org.truffleruby.language.library.RubyLibrary;
175+
import org.truffleruby.language.methods.Split;
175176
import org.truffleruby.language.objects.AllocateHelperNode;
176177
import org.truffleruby.language.objects.WriteObjectFieldNode;
177178
import org.truffleruby.language.yield.YieldNode;
@@ -2453,7 +2454,7 @@ public boolean isStringSubclass(RubyString string) {
24532454

24542455
}
24552456

2456-
@CoreMethod(names = { "to_sym", "intern" })
2457+
@CoreMethod(names = { "to_sym", "intern" }, split = Split.ALWAYS)
24572458
@ImportStatic({ StringCachingGuards.class, StringGuards.class, StringOperations.class })
24582459
public abstract static class ToSymNode extends CoreMethodArrayArgumentsNode {
24592460

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

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,6 @@ def to_sym
5858
end
5959
end
6060

61-
class Array
62-
Truffle::Graal.always_split(instance_method(:[]))
63-
Truffle::Graal.always_split(instance_method(:[]=))
64-
end
65-
6661
module Truffle::Boot
6762
if preinitializing?
6863
TO_RUN_AT_INIT = []

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,6 @@
4141
class String
4242
include Comparable
4343

44-
Truffle::Graal.always_split(instance_method(:to_sym))
45-
4644
private def range_begin(range, size)
4745
first = Primitive.rb_num2int range.begin
4846
first += size if first < 0

0 commit comments

Comments
 (0)