<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -13,7 +13,9 @@ yarv2llvm -- Yarv to LLVM Translater
    2. Copy yarv2llvm.rb and ./lib/*.* to any directory which is in 
       the ruby library path.
 
-  yarv2llvm need ruby1.9.x .
+  yarv2llvm need ruby1.9.2 or later.
+  If you want to use ruby 1.9.1, you must install methopara
+  (http://github.com/genki/methopara/tree/master).
 
 -- Usage
 </diff>
      <filename>README</filename>
    </modified>
    <modified>
      <diff>@@ -6,6 +6,26 @@
 module YARV2LLVM
   include LLVM
 
+def klass2instance(klass)
+  if klass == Fixnum then
+    1
+  elsif klass == Float then
+    1.0
+  elsif klass == Symbol then
+    :foo
+  else
+    klass.new
+  end
+end
+module_function :klass2instance
+
+def variable_argument?(para)
+  para.any? {|item|
+    item[0] != :rec
+  }
+end
+module_function :variable_argument?
+
 class RubyType
   include LLVM
   include RubyHelpers</diff>
      <filename>lib/type.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1207,7 +1207,7 @@ class YarvTranslator&lt;YarvVisitor
     if constarrp then
       arr = inits.map {|e| e[0].content}
       atype.type.content = arr
-#      EXPORTED_OBJECT[arr] = true
+      EXPORTED_OBJECT[arr] = true
       @expstack.push [atype,
         lambda {|b, context|
           context.rc = arr.llvm
@@ -1611,6 +1611,14 @@ class YarvTranslator&lt;YarvVisitor
     # minfo doesn't exist yet
     para = gen_arg_eval(args, receiver, ins, local_vars, info, nil, mname)
 
+    curlevel = @expstack.size
+    npara = para.size
+    if npara != 0 then
+      if @array_alloca_size == nil or @array_alloca_size &lt; npara + curlevel then
+        @array_alloca_size = npara + curlevel
+      end
+    end
+
     rett = RubyType.new(nil, info[3], &quot;Return forward type of #{mname}&quot;)
     @expstack.push [rett,
       lambda {|b, context|
@@ -1645,10 +1653,36 @@ class YarvTranslator&lt;YarvVisitor
           reck = eval(rectype.klass.to_s)
           mid = b.ashr(mname.llvm, 8.llvm)
           fp = b.call(ggmc, reck.llvm, mid)
-          ftype = Type.function(VALUE, [VALUE]* para.size)
-          ftype = Type.pointer(ftype)
-          fp = b.int_to_ptr(fp, ftype)
-          gen_call(fp, para, b, context)
+          inst = YARV2LLVM::klass2instance(reck)
+          painfo =  inst.method(mname).parameters
+          if YARV2LLVM::variable_argument?(painfo) then
+            ftype = Type.function(VALUE, [LONG, P_VALUE, VALUE])
+            ftype = Type.pointer(ftype)
+            fp = b.int_to_ptr(fp, ftype)
+            initarea = context.array_alloca_area
+            initarea2 =  b.gep(initarea, curlevel.llvm)
+            slfexp = para.shift
+            context = slfexp[1].call(b, context)
+            slf = context.rc
+            para.each_with_index do |e, n|
+              context = e[1].call(b, context)
+              sptr = b.gep(initarea2, n.llvm)
+              if e[0].type then
+                rcvalue = e[0].type.to_value(context.rc, b, context)
+              else
+                rcvalue = context.rc
+              end
+              b.store(rcvalue, sptr)
+            end
+
+            context.rc = b.call(fp, para.size.llvm, initarea2, slf)
+            context
+          else
+            ftype = Type.function(VALUE, [VALUE] * para.size)
+            ftype = Type.pointer(ftype)
+            fp = b.int_to_ptr(fp, ftype)
+            gen_call(fp, para, b, context)
+          end
           #          raise &quot;Undefined method \&quot;#{mname}\&quot; in #{info[3]}&quot;
         end
       }]</diff>
      <filename>lib/vmtraverse.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>5ea4fa0b84382ed976bef1e375ff5e490b186d39</id>
    </parent>
  </parents>
  <author>
    <name>U-KOZUE\kozue</name>
    <email>m-72@tf6.so-net.ne.jp</email>
  </author>
  <url>http://github.com/miura1729/yarv2llvm/commit/2a01a169d0415f2ebe5d0bd7e135aed8ecf52f80</url>
  <id>2a01a169d0415f2ebe5d0bd7e135aed8ecf52f80</id>
  <committed-date>2009-05-05T23:19:13-07:00</committed-date>
  <authored-date>2009-05-05T23:19:13-07:00</authored-date>
  <message>2nd Checkpoint of get dynamic C function address</message>
  <tree>55ef21efbd32182574545efc89e8f3fdc0289b42</tree>
  <committer>
    <name>U-KOZUE\kozue</name>
    <email>m-72@tf6.so-net.ne.jp</email>
  </committer>
</commit>
