Skip to content

Instantly share code, notes, and snippets.

@brixen
Created February 10, 2018 00:31
Show Gist options
  • Select an option

  • Save brixen/df2ab38b1e845a64adcad595b109d3bd to your computer and use it in GitHub Desktop.

Select an option

Save brixen/df2ab38b1e845a64adcad595b109d3bd to your computer and use it in GitHub Desktop.
$ bin/rbx compile -B -e 'class A; def m; end; end'
============= :__script__ ==============
Arguments: 0 required, 0 post, 0 total
Arity: 0
Locals: 0
Stack size: 4
Registers: 0
Literals: 4: :A, :open_class, <compiled code>, :call_under
Lines to IP: 1: 0..25
0000: push_rubinius
0001: push_literal :A
0003: push_nil
0004: push_scope
0005: send_stack :open_class, 3
0008: unwind 0
0010: create_block #<Rubinius::CompiledCode:0x1d8 name=A file=(snippet) line=1>
0012: unwind 0
0014: swap
0015: push_scope
0016: push_true
0017: send_stack :call_under, 3
0020: unwind 0
0022: pop
0023: push_true
0024: ret 0
----------------------------------------
================== :A ==================
Arguments: 0 required, 0 post, 0 total
Arity: 0
Locals: 0
Stack size: 5
Registers: 0
Literals: 4: :m, <compiled code>, :method_visibility, :add_defn_method
Lines to IP: 1: 2..19
0000: push_self
0001: add_scope
0002: push_rubinius
0003: push_literal :m
0005: push_literal #<Rubinius::CompiledCode:0x234 name=m file=(snippet) line=1>
0007: push_scope
0008: push_variables
0009: send_method :method_visibility
0011: unwind 0
0013: send_stack :add_defn_method, 4
0016: unwind 0
0018: ret 0
----------------------------------------
================== :m ==================
Arguments: 0 required, 0 post, 0 total
Arity: 0
Locals: 0
Stack size: 1
Registers: 0
Literals: 0
Line: 1
Lines to IP:
0000: push_nil
0001: ret 0
----------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment