Skip to content

Commit 6d75b61

Browse files
committed
AllocationTracing only needs the instance and a Node now
1 parent ab586f8 commit 6d75b61

File tree

4 files changed

+7
-18
lines changed

4 files changed

+7
-18
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ protected RubyString makeStringFromRope(Rope rope, RubyEncoding encoding, NotPro
283283
false,
284284
rope,
285285
encoding);
286-
AllocationTracing.trace(language, context, string, this);
286+
AllocationTracing.trace(string, this);
287287
return string;
288288
}
289289

@@ -301,7 +301,7 @@ protected RubyString makeStringFromBytes(byte[] bytes, RubyEncoding encoding, Co
301301
false,
302302
rope,
303303
encoding);
304-
AllocationTracing.trace(language, context, string, this);
304+
AllocationTracing.trace(string, this);
305305
return string;
306306
}
307307

src/main/java/org/truffleruby/language/backtrace/Backtrace.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ public Object getBacktraceLocations(RubyContext context, RubyLanguage language,
295295
language.threadBacktraceLocationShape,
296296
this,
297297
i);
298-
AllocationTracing.trace(language, context, instance, node);
298+
AllocationTracing.trace(instance, node);
299299
locations[i] = instance;
300300
}
301301
return ArrayHelpers.createArray(context, language, locations);

src/main/java/org/truffleruby/language/methods/GetMethodObjectNode.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ protected RubyMethod getMethodObject(Frame frame, Object self, Object name, Disp
9393
language.methodShape,
9494
self,
9595
method);
96-
AllocationTracing.trace(language, context, instance, this);
96+
AllocationTracing.trace(instance, this);
9797
return instance;
9898
}
9999

src/main/java/org/truffleruby/language/objects/AllocationTracing.java

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.truffleruby.core.string.RubyString;
2222
import org.truffleruby.core.string.StringOperations;
2323
import org.truffleruby.language.LexicalScope;
24-
import org.truffleruby.language.RubyContextNode;
2524
import org.truffleruby.language.RubyContextSourceNode;
2625
import org.truffleruby.language.RubyDynamicObject;
2726
import org.truffleruby.language.arguments.RubyArguments;
@@ -37,20 +36,10 @@
3736

3837
public abstract class AllocationTracing {
3938

40-
public static void trace(RubyDynamicObject instance, RubyContextNode node) {
41-
traceObject(node.getLanguage(), node.getContext(), instance, node);
42-
}
43-
44-
public static void trace(RubyDynamicObject instance, RubyContextSourceNode node) {
45-
traceObject(node.getLanguage(), node.getContext(), instance, node);
46-
}
47-
48-
public static void trace(RubyLanguage language, RubyContext context, RubyDynamicObject instance, Node node) {
49-
traceObject(language, context, instance, node);
50-
}
39+
public static void trace(RubyDynamicObject instance, Node currentNode) {
40+
final RubyLanguage language = RubyLanguage.get(currentNode);
41+
final RubyContext context = RubyContext.get(currentNode);
5142

52-
private static void traceObject(RubyLanguage language, RubyContext context, RubyDynamicObject instance,
53-
Node currentNode) {
5443
truffleTracing(language, instance);
5544

5645
if (context.getObjectSpaceManager().isTracing(language)) {

0 commit comments

Comments
 (0)