Skip to content

Commit 06922c7

Browse files
nirvdrumparacycle
authored andcommitted
Replace the non-standard UnboundMethod#origin with a new primitive.
Co-authored-by: Ufuk Kayserilioglu <[email protected]>
1 parent f5d0b3d commit 06922c7

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

src/main/java/org/truffleruby/core/method/UnboundMethodNodes.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,8 @@ protected RubySymbol name(RubyUnboundMethod unboundMethod) {
137137

138138
}
139139

140-
// TODO: We should have an additional method for this but we need to access it for #inspect.
141-
@CoreMethod(names = "origin", visibility = Visibility.PRIVATE)
142-
public abstract static class OriginNode extends CoreMethodArrayArgumentsNode {
140+
@Primitive(name = "unbound_method_origin")
141+
public abstract static class OriginNode extends PrimitiveArrayArgumentsNode {
143142

144143
@Specialization
145144
protected RubyModule origin(RubyUnboundMethod unboundMethod) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
class UnboundMethod
1212
def inspect
13-
Truffle::MethodOperations.inspect_method(self, origin, owner)
13+
Truffle::MethodOperations.inspect_method(self, Primitive.unbound_method_origin(self), owner)
1414
end
1515
alias_method :to_s, :inspect
1616

0 commit comments

Comments
 (0)