Permalink
Commits on Jun 17, 2011
  1. Merge pull request #31 from MSch/master

    alloy committed Jun 17, 2011
    Testcase for #30
  2. Merge pull request #30 from MSch/master

    Laurent Sansonetti
    Laurent Sansonetti committed Jun 17, 2011
    ruby_deploy's fix_install_name doesn't perform a deep search in Contents/Resources
  3. revert 528a72b (fix a #1331)

    Watson1978 committed Jun 17, 2011
Commits on Jun 16, 2011
  1. fixed below.

    takaokouji committed Jun 16, 2011
    (fixes #1285 and #1292)
    
    however, this changes has regresion that does not support alias eval, instance_eval, module_eval and class_eval.
    
    ---
    Squashed commit of the following:
    
    commit 5da9a951b2e483753b2bab0929037af2d3c30b23
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Wed Jun 15 20:49:45 2011 +0900
    
        fixed memory error in Binding#dup, Binding#clone.
        removed fails tag for spec/frozen/tags/macruby/core/binding/clone_tags.txt and spec/frozen/tags/macruby/core/binding/dup_tags.txt.
    
    commit f03f4a48869978764f7d92c5fb556f0dec003c50
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Wed Jun 15 20:19:26 2011 +0900
    
        fixed memory leak in proc + outer_stack.
        fixed segv with RBO.
    
    commit e0bd18a4225f1f16f7a967d89cbbd063fb2b4a9c
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Sat Jun 4 00:49:22 2011 +0900
    
        passed failed test in test_vm/block.rb below.
        ---
        assert ':ok', %{
          proc do
            def proc_caller(&b) b.call end
            def enclosing_method
              proc_caller { return :ok }
              :nok
            end
            p enclosing_method
          end.call
        }
    
        raise TypeError below.
        ---
        1.instance_eval "def f; end"
        1.instance_eval { def f; end }
    
    commit 87657c9de4df385319e4729b3a8c30c15b823a72
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Fri Jun 3 22:36:29 2011 +0900
    
        added fails tags, because segfault on BigDecimal with raise exception.
    
    commit 3ff39e9fa36758f69ce2faded063c066e3abf3c8
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Fri Jun 3 22:31:33 2011 +0900
    
        reset current_class, outer_stack and current_outer in rb_vm_aot_feature_load().
    
    commit da2dfc2c48ad668b5898a233c8585d7cdfea4596
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Fri Jun 3 22:30:43 2011 +0900
    
        added initialize outer_stack.
    
    commit 0638482e0c91584d9a6ef981066bb0f1292fe5f3
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Fri Jun 3 22:30:22 2011 +0900
    
        fixed segfault on rubyspec.
    
    commit 66c81e720c55641453a543d90691c541d7ffa3a9
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Thu Jun 2 23:20:47 2011 +0900
    
        reset outer_stack when loading rbo.
    
    commit 55beb0c2922839210215938a1c9462ffab639b7c
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Thu Jun 2 19:24:34 2011 +0900
    
        removed outer_mask from RoxorCompiler, because It is not used now.
    
    commit ccbb5b390bebe3849904921210201d5ccd2e52c8
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Thu Jun 2 18:51:11 2011 +0900
    
        fixed bug, retain outer_stack in RoxorVM copy constructer and release outer_stack in RoxorVM destructer.
    
    commit e78a418480d41fdaffb6962dd5b386ddb7769892
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Thu Jun 2 17:22:34 2011 +0900
    
        fixed bug, defined?(<expected constants>)
    
    commit bdfde05de4cf1b7777894383afd1fb1c1aa80827
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Thu Jun 2 14:44:07 2011 +0900
    
        implemented Binding#dup and Binding#clone.
    
    commit 227017b27d2ce39692f10b51b95d20f3f4097dbf
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Thu Jun 2 14:27:26 2011 +0900
    
        removed rb_vm_set_outer() and rb_vm_get_outer().
        because does not use original outer now.
    
    commit 3c11376eb514301a2474693a8e4cd893e0dab833
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Thu Jun 2 11:46:18 2011 +0900
    
        fixed segfault on defined?(CONSTANT) in method below.
        ---
        class A
          CONST = 42
          def f
            p(defined? CONST)
          end
        end
        GC.start # GC [A] outer_stack
    
        A.new.f # before SEGV
    
    commit 96cf97a5a6315d684297685fc05d95c223dd4949
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Wed Jun 1 23:19:51 2011 +0900
    
        occurs TypeError exception below. This is CRuby spec. (like above)
        ---
        1.instance_eval "class A; end"
    
    commit a51d5415c9d6ef1532a0f2a4b1cd37d9b0c9afa8
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Wed Jun 1 23:07:05 2011 +0900
    
        occurs TypeError exception below. This is CRuby spec.
        ---
        1.instance_eval "A = 10"
    
    commit 6a55eac0bec96de075e648683298cae1ec40d50f
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Wed Jun 1 22:00:29 2011 +0900
    
        fixed memory leak below. (but MacRuby has memory leak calling eval with string now)
        ---
        Array.class_eval <<-EOS
          def f
          end
        EOS
    
    commit b1aa927a45085305a317a7fbc96212582e12c0b7
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Wed Jun 1 16:38:16 2011 +0900
    
        does not push outer in eval.
    
    commit 4f8696d7c095cbc311b8f3a1e5f7af37c2f1de2b
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Wed Jun 1 16:11:22 2011 +0900
    
        fixed bug below.
        ---
        module M1
          B = 42
          module M2
            eval("B") # before uninitialized constant M1::M2::B (NameError), after none.
          end
        end
    
    commit ba3b3110139003b970c207e8c68ec9591fd36cad
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Wed Jun 1 15:06:40 2011 +0900
    
        fixed memory leak below.
        ---
        loop do
          1.instance_eval do
            42
          end
        end
    
    commit c0b3bbf22383a1fd9689698a6b2df4801a851bfc
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Wed Jun 1 14:41:08 2011 +0900
    
        Revert "removed rb_vm_outer_t.pushed_by_eval struct member. it use detecting current class on cRuby, but MacRuby has rb_vm_t.current_class."
    
        This reverts commit 5f6cf8fd924a07553e59a474d508274e2ec2b275.
    
    commit 1446c62436ba5fc7a9d71dc929fc84278778f718
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Wed Jun 1 14:40:54 2011 +0900
    
        Revert "fixed bug below."
    
        This reverts commit 3531dfc0c48af2b610946159a5f621db52d42b4e.
    
    commit d297f371b9d4fd3ebf03fb1534e9bcbb80f524ce
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Wed Jun 1 14:37:15 2011 +0900
    
        fixed bug below.
        ---
        class EvalSpecs
          class A
            def c
              eval "class C; end"
            end
          end
        end
    
        EvalSpecs::A.new.c
    
        p EvalSpecs::A::C.name #=> "EvalSpecs::A::C"
    
    commit 7f0595b4d23a0494949bf7c23b11a0e007f5e25b
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Wed Jun 1 13:40:16 2011 +0900
    
        removed rb_vm_outer_t.pushed_by_eval struct member. it use detecting current class on cRuby, but MacRuby has rb_vm_t.current_class.
    
    commit dad53ecafda46ebe7c08a8836260c577df805503
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Wed Jun 1 13:24:23 2011 +0900
    
        fixed memory leak like below.
        ---
        class A
          Module.nesting
        end
    
    commit a3e956ba4681d16686178fe5f8b93eaae9d89e28
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Wed Jun 1 02:08:26 2011 +0900
    
        fixed memory leak when run below.
        ---
        loop do
          class A
          end
        end
    
    commit d40229a6dfc92571803e858310cf7bb5fdbf3f3d
    Author: Kouji Takao <kouji@takao7.net>
    Date:   Sun May 29 21:10:54 2011 +0900
    
        Revert "fixed displays "reference count underflow" message (fixes #1284)" and "fixed RoxorVM::pop_outer() leaks memory. (fixes #1267)"
    
        This reverts commit 3b4d10e and 68ac3fc.
  2. Optimize the rary_erase() using the GC_MEMMOVE.

    Watson1978 committed Jun 16, 2011
    * before
          user     system      total        real
      0.850000   0.000000   0.850000 (  0.844986)
    
    * after
          user     system      total        real
      0.020000   0.000000   0.020000 (  0.012210)
    
    {{{
    require 'benchmark'
    
    times =  100_000
    
    Benchmark.bm do |x|
      strings =  []
      5000.times do
        strings << "abcd"
      end
    
      x.report do
        i =  0
        while i < times
          strings.delete_at(2)
          i +=  1
        end
      end
    end
    }}}
Commits on Jun 15, 2011
  1. that change isn't needed

    lrz committed Jun 15, 2011
  2. adding missing write barriers

    lrz committed Jun 15, 2011
Commits on Jun 13, 2011
  1. some work on garbage collecting singleton classes - disabled for now …

    Laurent Sansonetti
    Laurent Sansonetti committed Jun 13, 2011
    …since it breaks rubyspec
Commits on Jun 12, 2011
  1. Fix error message in rb_define_module_under

    ferrous26 committed Jun 12, 2011
    This fixes calls like:
    
    rb_define_module_under("JSON::GeneratorMethods","NSString")
    
    Raising errors like:
    
    "JSON::GeneratorMethods::Class is not a module (TypeError)"
    
    Which would indicate that I was trying to declare a module called Class in
    JSON::GeneratorMethods, when in fact I was trying to declare "NSString", but
    it found a class named "NSString".
    
    Now the error message will be appropriateTo look like:
    
    "JSON::GeneratorMethods::NSString:Class is not a module (TypeError)"
  2. update spec's tags

    Watson1978 committed Jun 12, 2011
Commits on Jun 10, 2011
  1. Remove obsoleted tests

    ferrous26 committed Jun 10, 2011
Commits on Jun 9, 2011
  1. fix memory leaks in JSON.generate

    Watson1978 committed Jun 9, 2011
    Test Script:
    {{{
    require 'json'
    
    loop do
      JSON.generate("key1" => "foo", "key2" => "bar")
    end
    }}}
  2. fix memory leaks in JSON.parse

    Watson1978 committed Jun 9, 2011
    Test Script:
    {{{
    require 'json'
    
    ary = (0 .. 100).map{|x| x}
    str = '[' + ary.join(',') + ']'
    
    loop do
      JSON.parse(str)
    end
    }}}
Commits on Jun 6, 2011
  1. add NSString#encode which returns a properly encoded RubyString, and …

    Laurent Sansonetti
    Laurent Sansonetti committed Jun 6, 2011
    …NSString#encode! which raises an exception
  2. make NSString#dup return a RubyString

    Laurent Sansonetti
    Laurent Sansonetti committed Jun 6, 2011
  3. Refactor using MacRuby::Compiler by adding .compile_file

    ferrous26 committed Jun 6, 2011
    And update the code which uses the Compiler.
Commits on Jun 5, 2011
  1. eliminate processing when was passed receiver in Array#replace.

    Watson1978 committed Jun 5, 2011
    - before
          user     system      total        real
      0.250000   0.000000   0.250000 (  0.251814)
    
    - after
          user     system      total        real
      0.210000   0.000000   0.210000 (  0.214612)
    
    ----
    require 'benchmark'
    
    Benchmark.bm do |x|
      ary = ["a", "b", 1.0] * 100
      x.report{
        1_000_000.times do
          ary.replace(ary)
        end
      }
    end
  2. eliminate processing when was passed receiver in String#replace.

    Watson1978 committed Jun 5, 2011
    - before
          user     system      total        real
      0.250000   0.000000   0.250000 (  0.255896)
    
    - after
          user     system      total        real
      0.200000   0.000000   0.200000 (  0.201582)
    
    ----
    require 'benchmark'
    
    Benchmark.bm do |x|
      str = "a" * 100
      x.report{
        1_000_000.times do
          str.replace(str)
        end
      }
    end
  3. reduce the number of calls of xmalloc family in rary_reserve().

    Watson1978 committed Jun 5, 2011
    - before
          user     system      total        real
      0.190000   0.010000   0.200000 (  0.185828)
    
    - after
          user     system      total        real
      0.190000   0.000000   0.190000 (  0.178484)
    
    ----
    require 'benchmark'
    
    Benchmark.bm do |x|
      ary = []
      x.report{
        1_000_000.times do
          ary << 1
        end
      }
    end
Commits on Jun 3, 2011
  1. More fast String#times.

    Watson1978 committed Jun 3, 2011
    - Before
          user     system      total        real
      0.590000   0.090000   0.680000 (  0.671640)
    
    - After
          user     system      total        real
      0.120000   0.080000   0.200000 (  0.190022)
    
    - Note: CRuby 1.9
          user     system      total        real
      0.080000   0.080000   0.160000 (  0.175766)
    
    ----
    require 'benchmark'
    
    Benchmark.bm do |x|
      x.report {
        str = "123" * 100_000_000
      }
    end
  2. don't crash when creating a binding if the current binding isn't set …

    Laurent Sansonetti
    Laurent Sansonetti committed Jun 3, 2011
    …(as it can happen if the user is smarter than the compiler)
  3. Performance improvement in String#times.

    Watson1978 committed Jun 3, 2011
    - Before
          user     system      total        real
      1.620000   0.080000   1.700000 (  1.703623)
    
    - After
          user     system      total        real
      0.590000   0.090000   0.680000 (  0.671640)
    
    ----
    require 'benchmark'
    
    Benchmark.bm do |x|
      x.report {
        str = "123" * 100_000_000
      }
    end
Commits on Jun 2, 2011
  1. revert my previous commit (d5d1e6f). because IO#read is broken after …

    Watson1978 committed Jun 2, 2011
    …calling IO#ungetc.
    
    Test Script:
    {{{
    require 'test/unit/assertions.rb'
    include Test::Unit::Assertions
    
    r, w = IO.pipe
    w.write "foobar"
    w.close
    
    c = r.read(1)
    r.ungetc(c)
    assert_equal("foo", r.read(3))
    assert_equal("bar", r.read(3))
    r.close
    
    puts :ok
    }}}