Permalink
Browse files

Merge remote-tracking branch 'origin/master' into 2.0.0pre

Conflicts:
	lib/ext/melbourne/visitor.cpp
	spec/tags/18/ruby/library/cgi/htmlextension/checkbox_group_tags.txt
	spec/tags/18/ruby/library/cgi/htmlextension/file_field_tags.txt
	spec/tags/18/ruby/library/cgi/htmlextension/img_tags.txt
	spec/tags/18/ruby/library/cgi/htmlextension/radio_group_tags.txt
	spec/tags/20/ruby/library/cgi/cookie/value_tags.txt
	spec/tags/20/ruby/library/cgi/queryextension/multipart_tags.txt
	spec/tags/20/ruby/library/set/sortedset/add_tags.txt
	spec/tags/20/ruby/library/set/sortedset/initialize_tags.txt
	vm/drivers/cli.cpp
  • Loading branch information...
2 parents 4a8b9a4 + 4b59fc2 commit 6c5b9a4db181adc0d2efbcfbce59b4491e2b0898 @brixen brixen committed Jun 16, 2011
Showing with 2,063 additions and 484 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 AUTHORS
  3. +3 −3 README
  4. +1 −1 Rakefile
  5. +1 −1 benchmark/bin/bm-automatic
  6. +62 −0 benchmark/core/date/bench_parse.rb
  7. +8 −0 benchmark/core/string/bench_split.rb
  8. +17 −0 benchmark/core/string/bench_sub.rb
  9. +1 −1 benchmark/results/templates/rubinius.erb
  10. +4 −4 kernel/common/marshal.rb
  11. +1 −1 kernel/common/process.rb
  12. +19 −22 kernel/common/string.rb
  13. +1 −1 kernel/platform/library.rb
  14. +21 −2 lib/cgi.rb
  15. +1 −1 lib/ext/melbourne/visitor18.cpp
  16. +1 −1 lib/ext/melbourne/visitor19.cpp
  17. +1 −0 lib/set.rb
  18. +1 −1 lib/syslog.rb.ffi
  19. +2 −2 rakelib/git.rake
  20. +1 −1 rakelib/vm.rake
  21. +6 −0 spec/ruby/core/marshal/fixtures/marshal_data.rb
  22. +6 −0 spec/ruby/core/marshal/load_spec.rb
  23. +4 −0 spec/ruby/core/string/partition_spec.rb
  24. +0 −1 spec/ruby/library/cgi/htmlextension/checkbox_group_spec.rb
  25. +0 −2 spec/tags/18/ruby/library/cgi/cookie/value_tags.txt
  26. +0 −1 spec/tags/18/ruby/library/cgi/htmlextension/checkbox_group_tags.txt
  27. +0 −2 spec/tags/18/ruby/library/cgi/htmlextension/file_field_tags.txt
  28. +0 −2 spec/tags/18/ruby/library/cgi/htmlextension/img_tags.txt
  29. +0 −1 spec/tags/18/ruby/library/cgi/htmlextension/radio_group_tags.txt
  30. +0 −1 spec/tags/18/ruby/library/cgi/queryextension/multipart_tags.txt
  31. +0 −1 spec/tags/18/ruby/library/set/sortedset/add_tags.txt
  32. +0 −1 spec/tags/18/ruby/library/set/sortedset/initialize_tags.txt
  33. +0 −2 spec/tags/19/ruby/library/cgi/cookie/value_tags.txt
  34. +0 −8 spec/tags/19/ruby/library/cgi/htmlextension/checkbox_group_tags.txt
  35. +0 −10 spec/tags/19/ruby/library/cgi/htmlextension/file_field_tags.txt
  36. +0 −12 spec/tags/19/ruby/library/cgi/htmlextension/img_tags.txt
  37. +0 −8 spec/tags/19/ruby/library/cgi/htmlextension/radio_group_tags.txt
  38. +0 −1 spec/tags/19/ruby/library/cgi/queryextension/multipart_tags.txt
  39. +0 −1 spec/tags/19/ruby/library/set/sortedset/add_tags.txt
  40. +0 −1 spec/tags/19/ruby/library/set/sortedset/initialize_tags.txt
  41. +0 −2 spec/tags/20/ruby/library/cgi/cookie/value_tags.txt
  42. +0 −8 spec/tags/20/ruby/library/cgi/htmlextension/checkbox_group_tags.txt
  43. +0 −10 spec/tags/20/ruby/library/cgi/htmlextension/file_field_tags.txt
  44. +0 −12 spec/tags/20/ruby/library/cgi/htmlextension/img_tags.txt
  45. +0 −8 spec/tags/20/ruby/library/cgi/htmlextension/radio_group_tags.txt
  46. +0 −1 spec/tags/20/ruby/library/cgi/queryextension/multipart_tags.txt
  47. +0 −1 spec/tags/20/ruby/library/set/sortedset/add_tags.txt
  48. +0 −1 spec/tags/20/ruby/library/set/sortedset/initialize_tags.txt
  49. +0 −5 vm/builtin/string.cpp
  50. +0 −2 vm/builtin/string.hpp
  51. +0 −2 vm/capi/string.cpp
  52. +2 −2 vm/configuration.hpp
  53. +1 −1 vm/drivers/cli.cpp
  54. +1 −1 vm/llvm/jit_compiler.cpp
  55. +3 −3 vm/oop.hpp
  56. +2 −2 vm/vmmethod.hpp
  57. +1 −1 web/_posts/2010-12-15-rubinius-has-a-blog.markdown
  58. +3 −3 web/_posts/2011-02-25-why-use-rubinius.markdown
  59. +1 −1 web/_site/2010/12/15/rubinius-has-a-blog/index.html
  60. +3 −3 web/_site/2011/02/25/why-use-rubinius/index.html
  61. +4 −4 web/_site/blog/index.html
  62. +3 −3 web/_site/doc/en/build-system/index.html
  63. +6 −6 web/_site/doc/en/bytecode-compiler/ast/index.html
  64. +3 −3 web/_site/doc/en/bytecode-compiler/customization/index.html
  65. +9 −9 web/_site/doc/en/bytecode-compiler/generator/index.html
  66. +3 −3 web/_site/doc/en/bytecode-compiler/index.html
  67. +8 −8 web/_site/doc/en/bytecode-compiler/transformations/index.html
  68. +3 −3 web/_site/doc/en/contributing/index.html
  69. +1 −1 web/_site/doc/en/index.html
  70. +3 −3 web/_site/doc/en/jit/index.html
  71. +3 −3 web/_site/doc/en/ruby/index.html
  72. +74 −54 web/_site/doc/es/how-to/write-documentation/index.html
  73. +6 −6 web/_site/doc/pl/bytecode-compiler/ast/index.html
  74. +217 −0 web/_site/doc/pl/bytecode-compiler/customization/index.html
  75. +240 −0 web/_site/doc/pl/bytecode-compiler/encoder/index.html
  76. +135 −9 web/_site/doc/pl/bytecode-compiler/generator/index.html
  77. +30 −12 web/_site/doc/pl/bytecode-compiler/index.html
  78. +269 −0 web/_site/doc/pl/bytecode-compiler/packager/index.html
  79. +62 −12 web/_site/doc/pl/bytecode-compiler/parser/index.html
  80. +35 −35 web/_site/doc/pl/bytecode-compiler/transformations/index.html
  81. +244 −0 web/_site/doc/pl/bytecode-compiler/writer/index.html
  82. +2 −2 web/_site/doc/pl/how-to/write-a-ticket/index.html
  83. +8 −4 web/_site/doc/pl/index.html
  84. +4 −4 web/_site/feed/atom.xml
  85. +1 −1 web/doc/en/build-system.markdown
  86. +1 −1 web/doc/en/bytecode-compiler.markdown
  87. +3 −3 web/doc/en/bytecode-compiler/ast.markdown
  88. +2 −2 web/doc/en/bytecode-compiler/customization.markdown
  89. +6 −6 web/doc/en/bytecode-compiler/generator.markdown
  90. +5 −5 web/doc/en/bytecode-compiler/transformations.markdown
  91. +1 −1 web/doc/en/contributing.markdown
  92. +1 −1 web/doc/en/index.markdown
  93. +2 −2 web/doc/en/jit.markdown
  94. +1 −1 web/doc/en/ruby.markdown
  95. +69 −44 web/doc/es/how-to/write-documentation.markdown
  96. +27 −9 web/doc/pl/bytecode-compiler.markdown
  97. +3 −3 web/doc/pl/bytecode-compiler/ast.markdown
  98. +10 −0 web/doc/pl/bytecode-compiler/customization.markdown
  99. +38 −0 web/doc/pl/bytecode-compiler/encoder.markdown
  100. +128 −5 web/doc/pl/bytecode-compiler/generator.markdown
  101. +67 −0 web/doc/pl/bytecode-compiler/packager.markdown
  102. +56 −9 web/doc/pl/bytecode-compiler/parser.markdown
  103. +35 −35 web/doc/pl/bytecode-compiler/transformations.markdown
  104. +44 −0 web/doc/pl/bytecode-compiler/writer.markdown
  105. +1 −1 web/doc/pl/how-to/write-a-ticket.markdown
  106. +8 −4 web/doc/pl/index.markdown
  107. +1 −1 web/index.html
View
@@ -9,6 +9,7 @@ artifacts/
*.lo
*.o
*.rbc
+.rbx
*.so
*.swp
*~
View
@@ -121,6 +121,7 @@
- Matthew Elder: { irc: mae }
- Matthias Reitinger:
- Matthijs Langenberg:
+- Maximilian Lupke: { irc: malumalu }
- MenTaLguY: { irc: MenTaLguY }
- Michael Fellinger: { irc: manveru }
- Michael Klishin:
View
@@ -24,7 +24,7 @@ For more information about building and running Rubinius, run 'rake docs'.
To install Rubinius, use the following steps:
1. Ensure you have MRI 1.8.7+, rubygems, rake, and git installed
- 2. git clone git://github.com/evanphx/rubinius.git
+ 2. git clone git://github.com/rubinius/rubinius.git
3. cd rubinius
4. ./configure --prefix=/path/to/install/dir
5. rake install
@@ -34,7 +34,7 @@ executable (bin) directory to your PATH.
Rubinius comes with RubyGems built-in. To install a gem, run the following:
- rbx gem install <gem_name>
+ rbx -S gem install <gem_name>
After installing Rubinius, you can access the built-in documentation at any
time by running 'rbx docs'.
@@ -105,7 +105,7 @@ improves, overall performance of your code under Rubinius will improve.
6. Tickets
Please file tickets for bugs or problems that you encounter. The issue tracker
-is: http://github.com/evanphx/rubinius/issues. Run 'rake docs' for more
+is: http://github.com/rubinius/rubinius/issues. Run 'rake docs' for more
details.
View
@@ -7,7 +7,7 @@ if ENV["RUBYLIB"]
end
# Wipe out CDPATH, it interferes with building in some cases,
-# see http://github.com/evanphx/rubinius/issues#issue/555
+# see http://github.com/rubinius/rubinius/issues#issue/555
if ENV["CDPATH"]
ENV.delete("CDPATH")
end
@@ -62,7 +62,7 @@ class Commit
def benchmark
begin
- execute "git clone git://github.com/evanphx/rubinius.git #{working_path}"
+ execute "git clone git://github.com/rubinius/rubinius.git #{working_path}"
Dir.chdir working_path
execute 'rake build'
@@ -0,0 +1,62 @@
+require 'benchmark'
+require 'benchmark/ips'
+require 'date'
+
+Benchmark.ips do |x|
+ iso_8601_date_only_locale_neutral = "2011-03-08"
+ iso_8601_date_only_modified = "2011-Mar-08"
+ rfc2822_date = "08 Mar 11"
+
+ format_c = "Fri Jan 02 2004"
+ format_d = "Fri, 02 Jan 2004"
+ format_e = "2011/03/08"
+
+ x.report "parse '#{iso_8601_date_only_locale_neutral}'" do |times|
+ i = 0
+ while i < times
+ Date.parse(iso_8601_date_only_locale_neutral)
+ i += 1
+ end
+ end
+
+ x.report "parse '#{iso_8601_date_only_modified}'" do |times|
+ i = 0
+ while i < times
+ Date.parse(iso_8601_date_only_modified)
+ i += 1
+ end
+ end
+
+ x.report "parse '#{rfc2822_date}'" do |times|
+ i = 0
+ while i < times
+ Date.parse(rfc2822_date)
+ i += 1
+ end
+ end
+
+ x.report "parse '#{format_c}'" do |times|
+ i = 0
+ while i < times
+ Date.parse(format_c)
+ i += 1
+ end
+ end
+
+ x.report "parse '#{format_d}'" do |times|
+ i = 0
+ while i < times
+ Date.parse(format_d)
+ i += 1
+ end
+ end
+
+ x.report "parse '#{format_e}'" do |times|
+ i = 0
+ while i < times
+ Date.parse(format_e)
+ i += 1
+ end
+ end
+
+end
@@ -11,6 +11,14 @@
x.report "mismatched delimiter" do
string.split('.')
end
+
+ x.report "matching delimiter regexp" do
+ string.split(/\|/)
+ end
+
+ x.report "mismatched delimiter regexp" do
+ string.split(/\./)
+ end
irc_str = ":irc.malkier.net UID UqdTi59atgtYoV9NUKvE7qMOwG2Fl 1 1305135275 +x UqdTi59atgtYoV9NUKvE7qMOwG2Fl UqdTi59atgtYoV9NUKvE7qMOwG2Fl 127.0.0.1 XXX :fake omg"
@@ -27,6 +27,23 @@
end
end
+ x.report "gsub single character" do |times|
+ i = 0
+ while i < times
+ para_string.gsub(/./, 'X')
+ i += 1
+ end
+ end
+
+ x.report "gsub! single character" do |times|
+ i = 0
+ para_string2 = para_string.dup
+ while i < times
+ para_string2.gsub(/./, 'X')
+ i += 1
+ end
+ end
+
x.report "gsub to shorter size" do |times|
i = 0
while i < times
@@ -28,7 +28,7 @@
<div id="site-subtitle">Use Ruby &#8482;</div>
-<div id="site-download"><a href="http://github.com/evanphx/rubinius/tree/master"><img src="http://74.217.48.135/assets/2/down_24.png" alt="download git" /> Download with git</a></div>
+<div id="site-download"><a href="http://github.com/rubinius/rubinius/tree/master"><img src="http://74.217.48.135/assets/2/down_24.png" alt="download git" /> Download with git</a></div>
</div>
</div>
@@ -401,10 +401,6 @@ def construct_array
obj = []
store_unique_object obj
- construct_integer.times do
- obj << construct
- end
-
if @user_class
cls = get_user_class()
if cls < Array
@@ -415,6 +411,10 @@ def construct_array
end
end
+ construct_integer.times do
+ obj << construct
+ end
+
obj
end
@@ -92,7 +92,7 @@ def self.fork
# Do not use Kernel.exit. This raises a SystemExit exception, which
# will run ensure blocks. This is not what MRI does and causes bugs
- # in programs. See issue http://github.com/evanphx/rubinius/issues#issue/289 for
+ # in programs. See issue http://github.com/rubinius/rubinius/issues#issue/289 for
# an example
Kernel.exit! status
@@ -7,7 +7,6 @@ class String
attr_accessor :data
attr_accessor :num_bytes
- attr_accessor :characters
alias_method :__data__, :data
alias_method :__data__=, :data=
@@ -16,7 +15,6 @@ def self.allocate
str = super()
str.__data__ = Rubinius::CharArray.new(1)
str.num_bytes = 0
- str.characters = 0
str
end
@@ -521,7 +519,7 @@ def chomp!(sep=undefined)
# don't use modify! because it will dup the data when we don't need to.
@hash_value = nil
- @num_bytes = @characters = @num_bytes - 1
+ @num_bytes = @num_bytes - 1
return self
end
@@ -540,7 +538,7 @@ def chomp!(sep=undefined)
# don't use modify! because it will dup the data when we don't need to.
@hash_value = nil
- @num_bytes = @characters = @num_bytes - 1
+ @num_bytes = @num_bytes - 1
elsif sep.size == 0
size = @num_bytes
while size > 0 && @data[size-1] == ?\n
@@ -557,7 +555,7 @@ def chomp!(sep=undefined)
# don't use modify! because it will dup the data when we don't need to.
@hash_value = nil
- @num_bytes = @characters = size
+ @num_bytes = size
else
size = sep.size
return if size > @num_bytes || sep.compare_substring(self, -size, size) != 0
@@ -566,7 +564,7 @@ def chomp!(sep=undefined)
# don't use modify! because it will dup the data when we don't need to.
@hash_value = nil
- @num_bytes = @characters = @num_bytes - size
+ @num_bytes = @num_bytes - size
end
return self
@@ -598,9 +596,9 @@ def chop!
if @num_bytes > 1 and @data[@num_bytes-1] == ?\n \
and @data[@num_bytes-2] == ?\r
- @num_bytes = @characters = @num_bytes - 2
+ @num_bytes = @num_bytes - 2
else
- @num_bytes = @characters = @num_bytes - 1
+ @num_bytes = @num_bytes - 1
end
self
@@ -964,7 +962,7 @@ def gsub(pattern, replacement=undefined)
raise RuntimeError, "string modified"
end
else
- ret.append replacement.to_sub_replacement(match)
+ replacement.to_sub_replacement(ret, match)
end
tainted ||= val.tainted?
@@ -1045,7 +1043,7 @@ def gsub!(pattern, replacement=undefined)
raise RuntimeError, "string modified" unless @num_bytes == orig_len
else
- ret.append replacement.to_sub_replacement(match)
+ replacement.to_sub_replacement(ret, match)
end
tainted ||= val.tainted?
@@ -1259,7 +1257,7 @@ def lstrip!
return if start == 0
modify!
- @num_bytes = @characters = @num_bytes - start
+ @num_bytes = @num_bytes - start
@data.move_bytes start, @num_bytes, 0
self
end
@@ -1313,7 +1311,6 @@ def replace(other)
other.shared!
@data = other.__data__
@num_bytes = other.num_bytes
- @characters = other.characters
@hash_value = nil
taint if other.tainted?
@@ -1407,7 +1404,7 @@ def rindex(sub, finish=undefined)
# "hello".partition("x") #=> ["hello", "", ""]
#
def partition(pattern=nil)
- return super() if block_given?
+ return super() if pattern == nil && block_given?
if pattern.kind_of? Regexp
if m = pattern.match(self)
@@ -1510,7 +1507,7 @@ def rstrip!
return if (stop += 1) == @num_bytes
modify!
- @num_bytes = @characters = stop
+ @num_bytes = stop
self
end
@@ -1927,15 +1924,16 @@ def sub(pattern, replacement=undefined)
if replacement.equal?(undefined)
replacement = yield(match[0].dup).to_s
out.taint if replacement.tainted?
+ out << replacement << match.post_match
else
out.taint if replacement.tainted?
- replacement = StringValue(replacement).to_sub_replacement(match)
+ StringValue(replacement).to_sub_replacement(out, match)
+ out << match.post_match
end
# We have to reset it again to match the specs
Regexp.last_match = match
- out << replacement << match.post_match
out.taint if self.tainted?
else
out = self
@@ -1975,15 +1973,16 @@ def sub!(pattern, replacement=undefined)
if replacement.equal?(undefined)
replacement = yield(match[0].dup).to_s
out.taint if replacement.tainted?
+ out << replacement << match.post_match
else
out.taint if replacement.tainted?
- replacement = StringValue(replacement).to_sub_replacement(match)
+ replacement = StringValue(replacement).to_sub_replacement(out, match)
+ out << match.post_match
end
# We have to reset it again to match the specs
Regexp.last_match = match
- out << replacement << match.post_match
out.taint if self.tainted?
else
out = self
@@ -2318,9 +2317,8 @@ def tr_trans(source, replacement, squeeze)
return modified ? self : nil
end
- def to_sub_replacement(match)
+ def to_sub_replacement(result, match)
index = 0
- result = ""
while index < @num_bytes
current = index
while current < @num_bytes && @data[current] != ?\\
@@ -2356,7 +2354,6 @@ def to_sub_replacement(match)
end
index += 1
end
- return result
end
def to_inum(base, check)
@@ -2561,7 +2558,7 @@ def suffix?(other)
def shorten!(size)
self.modify!
return if @num_bytes == 0
- @num_bytes = @characters = @num_bytes - size
+ @num_bytes = @num_bytes - size
end
def dump
@@ -51,7 +51,7 @@ def ffi_lib(*names)
# If .new worked, then lib is set and we can use it.
unless lib
- raise LoadError, "Unable to find libary among: #{x.inspect}"
+ raise LoadError, "Unable to find library among: #{x.inspect}"
end
lib
Oops, something went wrong.

0 comments on commit 6c5b9a4

Please sign in to comment.