class Object

Constants

A
ARY
Ary
BAR
Base
C
CONST
F
Foo
FooBar
IMAGE_HEIGHT
IMAGE_WIDTH

AO render benchmark Original program (C) Syoyo Fujita in Javascript (and other languages)

https://code.google.com/p/aobench/

Ruby(yarv2llvm) version by Hideki Miura mruby version by Hideki Miura

INSN_TABLE
Insn
NAO_SAMPLES
NSUBSAMPLES
StringArray
V

Public Instance Methods

array(obj) click to toggle source
# File typeprof-0.15.2/smoke/array11.rb, line 1
def array(obj)
    Array(obj)
end
ary() click to toggle source
# File typeprof-0.15.2/smoke/masgn2.rb, line 1
def ary
  [1, "str", :sym, 1.0]
end
bar(x)
Alias for: foo
baz(n) click to toggle source
# File typeprof-0.15.2/smoke/array1.rb, line 5
def baz(n); end
clamp(f) click to toggle source
# File typeprof-0.15.2/testbed/ao.rb, line 142
def clamp(f)
  i = f * 255.5
  if i > 255.0
    i = 255.0
  end
  if i < 0.0
    i = 0.0
  end
  i.to_i
end
cond1?() click to toggle source
# File typeprof-0.15.2/smoke/flip-flop.rb, line 1
def cond1?
  rand < 0.5
end
cond2?() click to toggle source
# File typeprof-0.15.2/smoke/flip-flop.rb, line 5
def cond2?
  rand < 0.5
end
corge(*r, z) click to toggle source
# File typeprof-0.15.2/smoke/rest3.rb, line 19
def corge(*r, z)
end
dispatch(*ary) click to toggle source
# File typeprof-0.15.2/smoke/array-range-aref.rb, line 41
def dispatch(*ary)
  f1(*ary)
  f2(*ary)
  f3(*ary)
  f4(*ary)
  f5(*ary)
  f6(*ary)
  f7(*ary)
  f8(*ary)
  f9(*ary)
  f10(*ary)
end
dispatch_foo(n) click to toggle source
# File typeprof-0.15.2/smoke/huge_union.rb, line 15
def dispatch_foo(n)
  n.foo("str")
end
f(a, b, c) click to toggle source
# File typeprof-0.15.2/smoke/array14.rb, line 1
def f(a, b, c)
  ary = [nil]
  foo, bar, ary[0] = a, b, c
  ary[0]
end
f1() click to toggle source
# File typeprof-0.15.2/smoke/arguments2.rb, line 1
def f1
end
f10(&blk) click to toggle source
# File typeprof-0.15.2/smoke/arguments2.rb, line 37
def f10(&blk)
  blk.call(1)
end
f2(x, y, z) click to toggle source
# File typeprof-0.15.2/smoke/arguments2.rb, line 5
def f2(x, y, z)
end
f3(x = "str", y = "str") click to toggle source
# File typeprof-0.15.2/smoke/arguments2.rb, line 9
def f3(x = "str", y = "str")
end
f4(*r) click to toggle source
# File typeprof-0.15.2/smoke/arguments2.rb, line 13
def f4(*r)
end
f5(x, y = "str", z) click to toggle source
# File typeprof-0.15.2/smoke/arguments2.rb, line 17
def f5(x, y = "str", z)
end
f6(k:) click to toggle source
# File typeprof-0.15.2/smoke/arguments2.rb, line 21
def f6(k:)
end
f7(k: 42) click to toggle source
# File typeprof-0.15.2/smoke/arguments2.rb, line 25
def f7(k: 42)
end
f8(k: "str") click to toggle source
# File typeprof-0.15.2/smoke/arguments2.rb, line 29
def f8(k: "str")
end
f9(**kw) click to toggle source
# File typeprof-0.15.2/smoke/arguments2.rb, line 33
def f9(**kw)
end
fib(x) click to toggle source

recursive method

# File typeprof-0.15.2/smoke/demo.rb, line 30
def fib(x)
  if x <= 1
    x
  else
    fib(x - 1) + fib(x - 2)
  end
end
foo(x) click to toggle source
# File typeprof-0.15.2/smoke/alias.rb, line 1
def foo(x)
  x
end
Also aliased as: bar
fuga() click to toggle source
# File typeprof-0.15.2/smoke/enumerator.rb, line 4
def fuga
  1.then
end
gen_foobar() click to toggle source
# File typeprof-0.15.2/smoke/struct2.rb, line 7
def gen_foobar
  FooBar.new(1)
end
get_interface() click to toggle source
# File typeprof-0.15.2/smoke/rbs-interface.rb, line 9
def get_interface
  C.new.get_interface
end
get_interface_foo() click to toggle source
# File typeprof-0.15.2/smoke/rbs-interface.rb, line 13
def get_interface_foo
  C.new.get_interface.foo
end
get_module() click to toggle source
# File typeprof-0.15.2/smoke/rbs-interface.rb, line 1
def get_module
  C.new.get_module
end
get_module_foo() click to toggle source
# File typeprof-0.15.2/smoke/rbs-interface.rb, line 5
def get_module_foo
  C.new.get_module.foo
end
grault(a, o=1, *r, z) click to toggle source
# File typeprof-0.15.2/smoke/rest3.rb, line 23
def grault(a, o=1, *r, z)
end
gvar_test() click to toggle source
# File typeprof-0.15.2/smoke/rbs-vars.rb, line 1
def gvar_test
  $gvar
end
hoge() click to toggle source
# File typeprof-0.15.2/smoke/enumerator.rb, line 1
def hoge
  [1, 2, 3].map
end
identity(x) click to toggle source

overrided method

# File typeprof-0.15.2/smoke/demo.rb, line 16
def identity(x)
  x
end
log(x) click to toggle source
# File typeprof-0.15.2/smoke/array-each.rb, line 1
def log(x)
end
log1(x) click to toggle source
# File typeprof-0.15.2/smoke/block-ambiguous.rb, line 4
def log1(x); end
log2(x) click to toggle source
# File typeprof-0.15.2/smoke/block-ambiguous.rb, line 10
def log2(x); end
log3(x) click to toggle source
# File typeprof-0.15.2/smoke/block-ambiguous.rb, line 16
def log3(x); end
log4(x) click to toggle source
# File typeprof-0.15.2/smoke/block-ambiguous.rb, line 22
def log4(x); end
log5(a, o, c) click to toggle source
# File typeprof-0.15.2/smoke/block-args1-rest.rb, line 43
def log5(a, o, c); end
log6(a, o, r, c) click to toggle source
# File typeprof-0.15.2/smoke/block-args3-rest.rb, line 52
def log6(a, o, r, c); end
map_bang_test(a) click to toggle source
# File typeprof-0.15.2/smoke/array-map3.rb, line 4
def map_bang_test(a)
  a.map! {|n| n.to_s }
  a
end
map_bang_test_known_bug(a) click to toggle source
# File typeprof-0.15.2/smoke/array-map3.rb, line 8
def map_bang_test_known_bug(a)
  a.map! {|n| n.to_s }
end
map_test(a) click to toggle source
# File typeprof-0.15.2/smoke/array-map3.rb, line 1
def map_test(a)
  a.map {|n| n.to_s }
end
my_to_s(x) click to toggle source

override

# File typeprof-0.15.2/smoke/demo2.rb, line 2
def my_to_s(x)
  x.to_s
end
no_argument() click to toggle source
# File typeprof-0.15.2/smoke/function.rb, line 1
def no_argument
  "str"
end
number?(ty) click to toggle source
# File typeprof-0.15.2/smoke/type_var.rb, line 1
def number?(ty)
  %w[integer float].include?(ty).then { puts 1 }
end
one_argument(x) click to toggle source
# File typeprof-0.15.2/smoke/function.rb, line 5
def one_argument(x)
end
otherBasis(n) click to toggle source
# File typeprof-0.15.2/testbed/ao.rb, line 153
def otherBasis(n)
  zero = Vec.new(0.0, 0.0, 0.0)
  basis = [zero, zero, zero]
  basis[2] = Vec.new(n.x, n.y, n.z)
  basis[1] = Vec.new(0.0, 0.0, 0.0)

  if n.x < 0.6 and n.x > -0.6
    basis[1].x = 1.0
  elsif n.y < 0.6 and n.y > -0.6
    basis[1].y = 1.0
  elsif n.z < 0.6 and n.z > -0.6
    basis[1].z = 1.0
  else
    basis[1].x = 1.0
  end

  basis[0] = basis[1].vcross(basis[2])
  basis[0] = basis[0].vnormalize

  basis[1] = basis[2].vcross(basis[0])
  basis[1] = basis[1].vnormalize

  basis
end
out(*out) click to toggle source
# File typeprof-0.15.2/smoke/identifier_keywords.rb, line 4
def out(*out)
end
quux(n) click to toggle source
# File typeprof-0.15.2/smoke/array1.rb, line 7
def quux(n); end
qux(n) click to toggle source
# File typeprof-0.15.2/smoke/array1.rb, line 6
def qux(n); end
read_test_1() click to toggle source
# File typeprof-0.15.2/smoke/rbs-attr.rb, line 1
def read_test_1
  Foo.new.reader_example
end
read_test_2() click to toggle source
# File typeprof-0.15.2/smoke/rbs-attr.rb, line 5
def read_test_2
  Foo.new.accessor_example
end
ret_int() click to toggle source
# File typeprof-0.15.2/smoke/manual-rbs.rb, line 12
def ret_int
  foo(42)
end
ret_str() click to toggle source
# File typeprof-0.15.2/smoke/manual-rbs.rb, line 16
def ret_str
  foo("str")
end
seq_get() click to toggle source
# File typeprof-0.15.2/smoke/array13.rb, line 18
def seq_get
  ary = [:a, :b, :c] + []
  ary[-1]
end
seq_set() click to toggle source
# File typeprof-0.15.2/smoke/array13.rb, line 12
def seq_set
  ary = [:a, :b, :c] + []
  ary[-1] = :z
  ary
end
swap(a) click to toggle source
# File typeprof-0.15.2/smoke/demo11.rb, line 1
def swap(a)
  [a[1], a[0]]
end
test_bar() click to toggle source
# File typeprof-0.15.2/smoke/rbs-record.rb, line 6
def test_bar
  h = { }
  h[:a] = 42
  C.new.bar(h)
end
test_foo() click to toggle source
# File typeprof-0.15.2/smoke/rbs-record.rb, line 1
def test_foo
  h = C.new.foo
  return h[:aaa], h[:bbb]
end
test_yield() { || ... } click to toggle source
# File typeprof-0.15.2/smoke/array12.rb, line 4
def test_yield
  yield
end
top() click to toggle source
# File typeprof-0.15.2/testbed/ao.rb, line 288
def top
  Scene.new.render(IMAGE_WIDTH, IMAGE_HEIGHT, NSUBSAMPLES)
end
tuple_get() click to toggle source
# File typeprof-0.15.2/smoke/array13.rb, line 7
def tuple_get
  ary = [:a, :b, :c]
  ary[-1]
end
tuple_set() click to toggle source
# File typeprof-0.15.2/smoke/array13.rb, line 1
def tuple_set
  ary = [:a, :b, :c]
  ary[-1] = :z
  ary
end
type(type) click to toggle source
# File typeprof-0.15.2/smoke/identifier_keywords.rb, line 1
def type(type)
end
untyped(untyped:) click to toggle source
# File typeprof-0.15.2/smoke/identifier_keywords.rb, line 7
def untyped(untyped:)
end
write_test() click to toggle source
# File typeprof-0.15.2/smoke/rbs-attr.rb, line 9
def write_test
  Foo.new.writer_example = 1
  Foo.new.writer_example = "str"
  Foo.new.accessor_example = 1
  Foo.new.accessor_example = "str"
end