Skip to content

Instantly share code, notes, and snippets.

@leocassarani
Created May 26, 2012 17:28
Show Gist options
  • Save leocassarani/2794719 to your computer and use it in GitHub Desktop.
Save leocassarani/2794719 to your computer and use it in GitHub Desktop.
Rbx Hash bytecode
============= :__script__ ==============
Arguments: 0 required, 0 post, 0 total
Arity: 0
Locals: 0
Stack size: 6
Lines to IP: 1: 0..28
0000: push_rubinius
0001: push_literal :User
0003: push_nil
0004: push_scope
0005: send_stack :open_class, 3
0008: dup_top
0009: push_rubinius
0010: swap_stack
0011: push_literal :__class_init__
0013: swap_stack
0014: push_literal #<Rubinius::CompiledMethod User file=benchmark/single_method/literals/hash_literal.rb>
0016: swap_stack
0017: push_scope
0018: swap_stack
0019: send_stack :attach_method, 4
0022: pop
0023: send_stack :__class_init__, 0
0026: pop
0027: push_true
0028: ret
----------------------------------------
================ :User =================
Arguments: 0 required, 0 post, 0 total
Arity: 0
Locals: 0
Stack size: 5
Lines to IP: 2: 2..15
0000: push_self
0001: add_scope
0002: push_rubinius
0003: push_literal :passwords
0005: push_literal #<Rubinius::CompiledMethod passwords file=benchmark/single_method/literals/hash_literal.rb>
0007: push_scope
0008: push_variables
0009: send_stack :method_visibility, 0
0012: send_stack :add_defn_method, 4
0015: ret
----------------------------------------
============== :passwords ==============
Arguments: 0 required, 0 post, 0 total
Arity: 0
Locals: 0
Stack size: 4
Lines to IP: 2: -1..-1, 6: 0..7, 4: 8..18, 5: 19..29
0000: push_cpath_top
0001: find_const 0
0003: meta_push_2
0004: send_stack :new_from_literal, 1
0007: dup_top
0008: push_literal "google.com"
0010: string_dup
0011: push_literal "letmein"
0013: string_dup
0014: send_stack :[]=, 2
0017: pop
0018: dup_top
0019: push_literal "facebook.com"
0021: string_dup
0022: push_literal "letmeout"
0024: string_dup
0025: send_stack :[]=, 2
0028: pop
0029: ret
----------------------------------------
class User
def passwords
{
'google.com' => 'letmein',
'facebook.com' => 'letmeout'
}
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment