Class: RubyVM::InlineCache

Inherits:
Node show all
Defined in:
ext/internal/vm/inline_cache/inline_cache.c

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#[], #_dump, _load, #address, #as_code, #as_expression, #as_paren_expression, #bytecode_compile, compile_string, define_code, define_expression, #eval, #flags, #inspect, #members, #nd_file, #nd_line, #nd_type, #obfusc, #pretty_print, #swap, #to_a, #tree, type

Class Method Details

.membersArray

Return an array of strings containing the names of the node class’s members.

Returns:

  • (Array)


2793
2794
2795
2796
# File 'ext/internal/node/nodeinfo.c', line 2793

VALUE node_s_members(VALUE klass)
{
  return rb_iv_get(klass, "__member__");
}

Instance Method Details

#classnil

Currently returns nil, because returning the real class can cause the interpreter to crash.

Returns:

  • (nil)


16
17
18
19
20
21
22
23
24
25
26
27
# File 'ext/internal/vm/inline_cache/inline_cache.c', line 16

static VALUE inline_cache_klass(VALUE self)
{
  IC inline_cache = (IC)unwrap_node(self);
  if (inline_cache->ic_class == Qundef)
  {
    return Qnil;
  }
  else
  {
    return inline_cache->ic_class;
  }
}

#valueObject

Returns the ic_cache member of the inline cache.

Returns:



35
36
37
38
39
# File 'ext/internal/vm/inline_cache/inline_cache.c', line 35

static VALUE inline_cache_value(VALUE self)
{
  /* TODO: Wrap the LABEL object (from compile.c) */
  return Qnil;
}

#vmstatObject

Returns the ic_vmstat member of the inline cache.

Returns:



47
48
49
50
51
# File 'ext/internal/vm/inline_cache/inline_cache.c', line 47

static VALUE inline_cache_vmstat(VALUE self)
{
  IC inline_cache = (IC)unwrap_node(self);
  return INT2NUM(inline_cache->ic_vmstat);
}