This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[subbu@earth jruby] java -cp lib/jruby.jar org.jruby.compiler.ir.IR_Builder -e "def fib(a); if a < 2; a; else; fib(a - 1) + fib(a - 2); end; end; fib(35)" | |
Script: | |
file: (string: "-e") | |
class: | |
Class: | |
className: _DUMMY_ | |
methods: | |
[Method: | |
name: __file__ | |
instrs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[subbu@earth jruby] java -cp lib/jruby.jar org.jruby.compiler.ir.IR_Builder -e 'class Test; TEST_VAL = 5; private; def foo(n); n > TEST_VAL ? 1 : 0; end; public; def bar(n, name); tmp = foo(n); if (tmp > 0); puts "Hi there #{name}"; else; puts "Sorry there #{name}"; end; end; end' | |
Script: | |
file: "-e" | |
class: | |
Class: | |
className: _DUMMY_ | |
instrs: | |
0 DEF_CLASS_METH(_DUMMY_, __file__) | |
methods: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[subbu@earth jruby] java -cp lib/jruby.jar org.jruby.compiler.ir.IR_Builder -e "class Foo; @@b = 5; @a = 1; def self.bar; puts @a; puts @@b; end; end; class Bar < Foo; @a = 2; def self.bar; super; end; bar; end" | |
Script: | |
file: "-e" | |
class: | |
Class: | |
className: _DUMMY_ | |
instrs: | |
0 DEF_CLASS_METH(_DUMMY_, __file__) | |
1 CONST(Class _DUMMY_, Foo) = Class Foo | |
2 %v_0 = GET_CONST(Class _DUMMY_, Foo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[subbu@earth jruby] java -cp lib/jruby.jar org.jruby.compiler.ir.IR_Builder -e "def foo(a); (1..10).collect { |i| i + a }; end;" | |
Script: | |
file: "-e" | |
class: | |
Class: | |
className: _DUMMY_ | |
instrs: | |
0 DEF_CLASS_METH(_DUMMY_, __file__) | |
1 DEF_INST_METH(_DUMMY_, foo) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[subbu@earth jruby] java -cp lib/jruby.jar org.jruby.compiler.ir.IR_Builder -e "class C < A; def foo(n, &blk); puts "hi!"; n = 0; super; end; end" | |
Script: | |
file: "-e" | |
class: | |
Class: | |
className: _DUMMY_ | |
instrs: | |
0 DEF_CLASS_METH(_DUMMY_, __file__) | |
1 %v_0 = GET_CONST(Class _DUMMY_, A) | |
2 CONST(Class _DUMMY_, C) = Class C |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[subbu@earth jruby] java -cp lib/jruby.jar org.jruby.compiler.ir.IR_Builder -e "a,(b,c,(d,e,(f,g,h))),d = 1,2,3,4" | |
Script: | |
file: "-e" | |
class: | |
Class: | |
className: _DUMMY_ | |
instrs: | |
0 DEF_CLASS_METH(_DUMMY_, __file__) | |
1 a = 1:fixnum | |
2 b = 2:fixnum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[subbu@earth ~] irb | |
irb(main):001:0> 1.to_ary | |
NoMethodError: undefined method `to_ary' for 1:Fixnum | |
from (irb):1 | |
irb(main):002:0> a,b,c=1; p a,b,c | |
1 | |
nil | |
nil | |
=> nil | |
irb(main):003:0> class Fixnum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[subbu@earth jruby] ant | |
Buildfile: build.xml | |
init: | |
jar: | |
init: | |
extract-rdocs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[subbu@earth jruby] java -cp ~/software/jruby/lib/jruby.jar org.jruby.compiler.ir.IR_Builder -e "a = 3; b = [a]; c = [1,a,b]; x,y,z = *c; p = y; i,j=*z;t = c[2][0]+ i*1.5-c[1]/c[0]" | |
------------------ Before local optimization pass --------------------- | |
Script: file: "-e" | |
constants: {__SCRIPT_ROOT__=Class __SCRIPT_ROOT__} | |
Class: __SCRIPT_ROOT__Module: __SCRIPT_ROOT__ | |
Method: :_ROOT_:__SCRIPT_ROOT__ | |
instrs: | |
0 self = RECV_ARG(0) | |
1 a = 3:fixnum |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ruby-head] [subbu@earth ~/jruby] cat ir.docs/kwargs.rb | |
def bar(a, defarg=9, *restargs, b, c: 'default', d: 'kwarg', **kwargs) | |
["a=#{a}", "defarg=#{defarg}", "restargs=#{restargs}", "b=#{b}", "c=#{c}", "d=#{d}", "kwargs=#{kwargs}"] | |
end | |
puts bar(1, 2).join('; ') | |
begin | |
puts bar(1, {:x => 32, :y => 'foo'} ).join('; ') | |
rescue Exception => e | |
puts "ERROR: #{e}" |
OlderNewer