class SyntaxTree::YARV::PutSpecialObject
### Summary
‘putspecialobject` pushes one of three special objects onto the stack. These are either the VM
core special object, the class base special object, or the constant base special object.
### Usage
~~~ruby alias foo bar ~~~
Constants
- OBJECT_CBASE
- OBJECT_CONST_BASE
- OBJECT_VMCORE
Attributes
Public Class Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 4819 def initialize(object) @object = object end
Public Instance Methods
Source
# File lib/syntax_tree/yarv/instructions.rb, line 4835 def ==(other) other.is_a?(PutSpecialObject) && other.object == object end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 4847 def call(vm) case object when OBJECT_VMCORE vm.push(vm.frozen_core) when OBJECT_CBASE value = vm.frame._self value = value.singleton_class unless value.is_a?(Class) vm.push(value) when OBJECT_CONST_BASE vm.push(vm.const_base) end end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 4831 def deconstruct_keys(_keys) { object: object } end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 4823 def disasm(fmt) fmt.instruction("putspecialobject", [fmt.object(object)]) end
Source
# File lib/syntax_tree/yarv/instructions.rb, line 4827 def to_a(_iseq) [:putspecialobject, object] end