Skip to content

Commit 7341767

Browse files
committed
Rename Primitive.class_of to Primitive.metaclass
1 parent efc8fd3 commit 7341767

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

lib/truffle/pathname.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ module Kernel
10921092
#
10931093
# This method is available since 1.8.5.
10941094
def Pathname(path) # :doc:
1095-
return path if Primitive.class_of(path) == Pathname
1095+
return path if Primitive.metaclass(path) == Pathname
10961096
Pathname.new(path)
10971097
end
10981098
module_function :Pathname

lib/truffle/truffle/cext.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -451,7 +451,7 @@ def rb_obj_classname(object)
451451
end
452452

453453
def rb_class_of(object)
454-
Primitive.class_of(object)
454+
Primitive.metaclass(object)
455455
end
456456

457457
def rb_class_real(ruby_class)

lib/truffle/truffle/cext_structs.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -244,7 +244,7 @@ def polyglot_read_member(name)
244244
when 'flags'
245245
compute_flags
246246
when 'klass'
247-
Primitive.cext_wrap(Primitive.class_of(@object))
247+
Primitive.cext_wrap(Primitive.metaclass(@object))
248248
else
249249
raise Truffle::Interop::UnknownIdentifierException
250250
end

src/main/java/org/truffleruby/core/support/TypeNodes.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,10 @@ protected RubyClass objectClass(Object object,
9494
}
9595
}
9696

97-
@Primitive(name = "class_of")
98-
public abstract static class ClassOfNode extends PrimitiveArrayArgumentsNode {
97+
@Primitive(name = "metaclass")
98+
public abstract static class MetaClassPrimitiveNode extends PrimitiveArrayArgumentsNode {
9999
@Specialization
100-
protected RubyClass classOf(Object object,
100+
protected RubyClass metaClass(Object object,
101101
@Cached MetaClassNode metaClassNode) {
102102
return metaClassNode.execute(object);
103103
}

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -731,7 +731,7 @@ def construct(ivar_index = nil, call_proc = true, postpone_freezing = false)
731731
end
732732

733733
if @freeze && !postpone_freezing && !(Primitive.is_a?(obj, Class) || Primitive.is_a?(obj, Module))
734-
obj = -obj if Primitive.class_of(obj) == String
734+
obj = -obj if Primitive.metaclass(obj) == String
735735
Primitive.object_freeze(obj)
736736
end
737737

@@ -1118,7 +1118,7 @@ def serialize(obj)
11181118
end
11191119

11201120
def serialize_extended_object(obj)
1121-
metaclass = Primitive.class_of(obj)
1121+
metaclass = Primitive.metaclass(obj)
11221122
if metaclass.singleton_class? &&
11231123
(Primitive.singleton_methods?(obj) || Primitive.any_instance_variable?(metaclass))
11241124
raise TypeError, "singleton can't be dumped"

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

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

1111
class Method
1212
def inspect
13-
Truffle::MethodOperations.inspect_method(self, Primitive.class_of(receiver), owner, receiver)
13+
Truffle::MethodOperations.inspect_method(self, Primitive.metaclass(receiver), owner, receiver)
1414
end
1515
alias_method :to_s, :inspect
1616

0 commit comments

Comments
 (0)