Skip to content

Instantly share code, notes, and snippets.

View evanphx's full-sized avatar

Evan Phoenix evanphx

View GitHub Profile
0000: meta_push_1
0001: ret
define %"struct.rubinius::Object"* @0(%"struct.rubinius::VM"*, %"struct.rubinius::CallFrame"*, %"struct.rubinius::Dispatch"*, %"struct.rubinius::Arguments"*) {
entry:
%cf_alloca = alloca %"struct.rubinius::CallFrame" ; <%"struct.rubinius::CallFrame"*> [#uses=0]
%stk_alloca = alloca %"struct.rubinius::Object"* ; <%"struct.rubinius::Object"**> [#uses=2]
%var_mem = alloca %"struct.rubinius::Object"*, i32 10 ; <%"struct.rubinius::Object"**> [#uses=1]
%vars_alloca = bitcast %"struct.rubinius::Object"** %var_mem to %"struct.rubinius::VariableScope"* ; <%"struct.rubinius::VariableScope"*> [#uses=0]
%cast_to_obj = inttoptr i32 3 to %"struct.rubinius::Object"* ; <%"struct.rubinius::Object"*> [#uses=1]
0000: meta_push_1
0001: meta_push_1
0002: meta_send_op_equal
0003: ret
define %"struct.rubinius::Object"* @0(%"struct.rubinius::VM"*, %"struct.rubinius::CallFrame"*, %"struct.rubinius::Dispatch"*, %"struct.rubinius::Arguments"*) {
entry:
%cf_alloca = alloca %"struct.rubinius::CallFrame" ; <%"struct.rubinius::CallFrame"*> [#uses=0]
%stk_alloca = alloca %"struct.rubinius::Object"*, i32 2 ; <%"struct.rubinius::Object"**> [#uses=7]
%var_mem = alloca %"struct.rubinius::Object"*, i32 10 ; <%"struct.rubinius::Object"**> [#uses=1]
define %"struct.rubinius::Object"* @0(%"struct.rubinius::VM"*, %"struct.rubinius::CallFrame"*, %"struct.rubinius::Dispatch"*, %"struct.rubinius::Arguments"*) {
entry:
%stk_alloca8 = alloca [2 x %"struct.rubinius::Object"*], align 4 ; <[2 x %"struct.rubinius::Object"*]*> [#uses=3]
%stk_alloca8.sub9 = bitcast [2 x %"struct.rubinius::Object"*]* %stk_alloca8 to %"struct.rubinius::Object"** ; <%"struct.rubinius::Object"**> [#uses=1]
store %"struct.rubinius::Object"* inttoptr (i32 3 to %"struct.rubinius::Object"*), %"struct.rubinius::Object"** %stk_alloca8.sub9
%4 = getelementptr [2 x %"struct.rubinius::Object"*]* %stk_alloca8, i32 0, i32 1 ; <%"struct.rubinius::Object"**> [#uses=1]
store %"struct.rubinius::Object"* inttoptr (i32 3 to %"struct.rubinius::Object"*), %"struct.rubinius::Object"** %4
%5 = getelementptr [2 x %"struct.rubinius::Object"*]* %stk_alloca8, i32 0, i32 3 ; <%"struct.rubinius::Object"**> [#uses=1]
store %"struct.rubinius::Object"* inttoptr (i32 18 to %"struct.rubinius::Object"*), %"st
0000: meta_push_1
0001: push_literal :blah
0003: meta_send_op_equal
0004: ret
define %"struct.rubinius::Object"* @0(%"struct.rubinius::VM"*, %"struct.rubinius::CallFrame"*, %"struct.rubinius::Dispatch"*, %"struct.rubinius::Arguments"*) {
entry:
%cf_alloca = alloca %"struct.rubinius::CallFrame" ; <%"struct.rubinius::CallFrame"*> [#uses=0]
%stk_alloca = alloca %"struct.rubinius::Object"*, i32 2 ; <%"struct.rubinius::Object"**> [#uses=7]
%var_mem = alloca %"struct.rubinius::Object"*, i32 10 ; <%"struct.rubinius::Object"**> [#uses=1]
0000: push_int 9
0002: push_int 10
0004: meta_send_op_equal
0005: ret
define %"struct.rubinius::Object"* @0(%"struct.rubinius::VM"*, %"struct.rubinius::CallFrame"*, %"struct.rubinius::Dispatch"*, %"struct.rubinius::Arguments"*) {
entry:
%cf_alloca = alloca %"struct.rubinius::CallFrame" ; <%"struct.rubinius::CallFrame"*> [#uses=1]
%stk_alloca = alloca %"struct.rubinius::Object"*, i32 2 ; <%"struct.rubinius::Object"**> [#uses=8]
%var_mem = alloca %"struct.rubinius::Object"*, i32 10 ; <%"struct.rubinius::Object"**> [#uses=1]
kernel/common/compiled_method.rb:150 in Rubinius::CompiledMethod#activate_as_script
kernel/common/compiled_method.rb:143 in Rubinius::CompiledMethod#as_script
kernel/compiler/compile.rb:244 in Compiler::Utils.single_load
kernel/compiler/compile.rb:131 in Compiler::Utils.unified_load {}
kernel/bootstrap/array.rb:48 in Array#each
kernel/compiler/compile.rb:95 in Compiler::Utils.unified_load
kernel/common/kernel.rb:714 in Kernel(Object)#gem_original_require (require)
/Users/evan/git/rbx-master/lib/rubygems/custom_require.rb:31 in Kernel(Object)#require
/Users/evan/git/rbx-master/gems/1.8/gems/sinatra-0.9.1.1/lib/sinatra.rb:5 in main.__script__
kernel/common/compiled_method.rb:150 in Rubinius::CompiledMethod#activate_as_script
* Simple translator from bytecode to LLVM IR
* Background JIT thread
* Primitive inlining phase 1 based on Type feedback
* tuple and bytearray primitives emitted as IR directly
* FFI inlining
* Simple method inlining
* No blocks, one return, no exception handlers
* Buildup knowledge for inliner
* Experiment with code quality produced by using LLVM inliner directly
* LLVM passes aware of CallFrame semantics
0x29800cb and $0x7ffffffe, %eax
0x29800d1 shr , %eax
0x29800d3 add $0x32, %eax
0x29800d6 lea (%eax,%eax), %ecx
0x29800d9 sar , %ecx
0x29800db cmp %eax, %ecx
0x29800dd setnz %cl
0x29800e0 jnz 0x111 ; 0x2980121
kendall :: git/rbx-master » TOTAL=5000 bin/rbx benchmark/rubinius/bm_array_each.rb
Rehearsal ----------------------------------------------
loop 0.001118 0.000000 0.001118 ( 0.001084)
Array#each 7.303627 0.000000 7.303627 ( 7.303699)
------------------------------------- total: 7.304745sec
user system total real
loop 0.001097 0.000000 0.001097 ( 0.001098)
Array#each 7.466074 0.000000 7.466074 ( 7.466092)
kendall :: git/rbx » TOTAL=5000 bin/rbx benchmark/rubinius/bm_array_each.rb
Rehearsal ----------------------------------------------
loop 0.001164 0.000000 0.001164 ( 0.001038)
Array#each 5.908798 0.000000 5.908798 ( 5.908842)
------------------------------------- total: 5.909962sec
user system total real
loop 0.001836 0.000000 0.001836 ( 0.001742)
Array#each 5.973085 0.000000 5.973085 ( 5.973097)
kendall :: git/rbx » TOTAL=5000 bin/rbx --fast benchmark/rubinius/bm_array_each.rb