class SyntaxTree::YARV::SetClassVariable
~~~
@@class_variable = 1
~~~ruby
### Usage
hierarchy every time.
inline cache to reduce the need to lookup the class variable in the class
sets its value to the value it pops off the top of the stack. It uses an
`setclassvariable` looks for a class variable in the current class and
### Summary
def ==(other)
def ==(other) other.is_a?(SetClassVariable) && other.name == name && other.cache == cache end
def call(vm)
def call(vm) clazz = vm.frame._self clazz = clazz.class unless clazz.is_a?(Class) clazz.class_variable_set(name, vm.pop) end
def deconstruct_keys(_keys)
def deconstruct_keys(_keys) { name: name, cache: cache } end
def disasm(fmt)
def disasm(fmt) fmt.instruction( "setclassvariable", [fmt.object(name), fmt.inline_storage(cache)] ) end
def initialize(name, cache)
def initialize(name, cache) @name = name @cache = cache end
def length
def length 3 end
def pops
def pops 1 end
def to_a(_iseq)
def to_a(_iseq) [:setclassvariable, name, cache] end