Skip to content

Commit f35e273

Browse files
committed
Remove unused allocator field in ArrayBuilderNode subnodes
1 parent e3f0134 commit f35e273

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

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

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@ public Object finish(BuilderState state, int length) {
9191
private AppendArrayNode getAppendArrayNode() {
9292
if (appendArrayNode == null) {
9393
CompilerDirectives.transferToInterpreterAndInvalidate();
94-
appendArrayNode = insert(AppendArrayNode.create(getContext(), startNode.allocator));
94+
appendArrayNode = insert(AppendArrayNode.create(getContext()));
9595
}
9696
return appendArrayNode;
9797
}
9898

9999
private AppendOneNode getAppendOneNode() {
100100
if (appendOneNode == null) {
101101
CompilerDirectives.transferToInterpreterAndInvalidate();
102-
appendOneNode = insert(AppendOneNode.create(getContext(), startNode.allocator));
102+
appendOneNode = insert(AppendOneNode.create(getContext()));
103103
}
104104
return appendOneNode;
105105
}
@@ -129,10 +129,10 @@ public synchronized ArrayAllocator updateStrategy(ArrayStoreLibrary.ArrayAllocat
129129

130130
if (newStrategy != oldStrategy) {
131131
if (appendArrayNode != null) {
132-
appendArrayNode.replace(AppendArrayNode.create(getContext(), updatedAllocator));
132+
appendArrayNode.replace(AppendArrayNode.create(getContext()));
133133
}
134134
if (appendOneNode != null) {
135-
appendOneNode.replace(AppendOneNode.create(getContext(), updatedAllocator));
135+
appendOneNode.replace(AppendOneNode.create(getContext()));
136136
}
137137
}
138138

@@ -184,16 +184,14 @@ public BuilderState start(int length) {
184184
@ImportStatic(ArrayGuards.class)
185185
public abstract static class AppendOneNode extends ArrayBuilderBaseNode {
186186

187-
public static AppendOneNode create(RubyContext context, ArrayStoreLibrary.ArrayAllocator allocator) {
188-
return AppendOneNodeGen.create(context, allocator);
187+
public static AppendOneNode create(RubyContext context) {
188+
return AppendOneNodeGen.create(context);
189189
}
190190

191191
private final RubyContext context;
192-
protected final ArrayStoreLibrary.ArrayAllocator allocator;
193192

194-
public AppendOneNode(RubyContext context, ArrayStoreLibrary.ArrayAllocator allocator) {
193+
public AppendOneNode(RubyContext context) {
195194
this.context = context;
196-
this.allocator = allocator;
197195
}
198196

199197
public abstract void executeAppend(BuilderState array, int index, Object value);
@@ -249,16 +247,14 @@ protected void appendNewStrategy(BuilderState state, int index, Object value,
249247
@ImportStatic(ArrayGuards.class)
250248
public abstract static class AppendArrayNode extends ArrayBuilderBaseNode {
251249

252-
public static AppendArrayNode create(RubyContext context, ArrayStoreLibrary.ArrayAllocator allocator) {
253-
return AppendArrayNodeGen.create(context, allocator);
250+
public static AppendArrayNode create(RubyContext context) {
251+
return AppendArrayNodeGen.create(context);
254252
}
255253

256254
private final RubyContext context;
257-
protected final ArrayStoreLibrary.ArrayAllocator allocator;
258255

259-
public AppendArrayNode(RubyContext context, ArrayStoreLibrary.ArrayAllocator allocator) {
256+
public AppendArrayNode(RubyContext context) {
260257
this.context = context;
261-
this.allocator = allocator;
262258
}
263259

264260
public abstract void executeAppend(BuilderState state, int index, RubyArray value);

0 commit comments

Comments
 (0)