-
Notifications
You must be signed in to change notification settings - Fork 608
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into compiler
Conflicts: rakelib/blueprint.rb
- Loading branch information
Showing
168 changed files
with
6,525 additions
and
25,278 deletions.
There are no files selected for viewing
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,29 @@ | |||
require 'digest/sha1' | |||
require 'openssl' | |||
require 'openssl/digest' | |||
require 'benchmark' | |||
require 'benchmark/ips' | |||
|
|||
input = 'hello, world!' * 100 | |||
|
|||
Benchmark.ips do |bench| | |||
bench.report 'Digest SHA1' do |times| | |||
digest = Digest::SHA1.new | |||
i = 0 | |||
|
|||
while i < times | |||
digest.hexdigest(input) | |||
i += 1 | |||
end | |||
end | |||
|
|||
bench.report 'OpenSSL SHA1' do |times| | |||
digest = OpenSSL::Digest::SHA1.new | |||
i = 0 | |||
|
|||
while i < times | |||
digest.hexdigest(input) | |||
i += 1 | |||
end | |||
end | |||
end |
This file was deleted.
Oops, something went wrong.
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
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
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
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
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,31 @@ | |||
require File.expand_path('../../../spec_helper', __FILE__) | |||
|
|||
describe "Module#set_class_visibility" do | |||
before :each do | |||
@module = Module.new { def self.public_method; end } | |||
end | |||
|
|||
it "is a private method" do | |||
Module.should have_private_instance_method(:set_class_visibility, false) | |||
end | |||
|
|||
it "modifies class method visibility" do | |||
@module.send :set_class_visibility, :public_method, :protected | |||
@module.protected_methods(false).should include(stasy(:public_method)) | |||
|
|||
@module.send :set_class_visibility, :public_method, :private | |||
@module.should have_private_method(:public_method, false) | |||
|
|||
@module.send :set_class_visibility, :public_method, :public | |||
@module.public_methods(false).should include(stasy(:public_method)) | |||
end | |||
|
|||
it "accepts a String name as Symbol" do | |||
@module.send :set_class_visibility, "public_method", :private | |||
@module.should have_private_method(:public_method, false) | |||
end | |||
|
|||
it "returns the coerced name" do | |||
@module.send(:set_class_visibility, "public_method", :private).should equal(:public_method) | |||
end | |||
end |
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,27 @@ | |||
require File.expand_path('../../../spec_helper', __FILE__) | |||
|
|||
describe "Module#set_visibility" do | |||
before :each do | |||
@module = Module.new { def public_method; end } | |||
end | |||
|
|||
it "modifies instance method visibility" do | |||
@module.set_visibility :public_method, :protected | |||
@module.should have_protected_instance_method(:public_method, false) | |||
|
|||
@module.set_visibility :public_method, :private | |||
@module.should have_private_instance_method(:public_method, false) | |||
|
|||
@module.set_visibility :public_method, :public | |||
@module.should have_public_instance_method(:public_method, false) | |||
end | |||
|
|||
it "accepts a String name as Symbol" do | |||
@module.set_visibility "public_method", :private | |||
@module.should have_private_instance_method(:public_method, false) | |||
end | |||
|
|||
it "returns the coerced name" do | |||
@module.set_visibility("public_method", :private).should equal(:public_method) | |||
end | |||
end |
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,23 @@ | |||
require File.expand_path('../../../spec_helper', __FILE__) | |||
|
|||
describe "Module#thunk_method" do | |||
before :each do | |||
@class = Class.new | |||
@value = Object.new | |||
end | |||
|
|||
it "defines a reader method that always returns same value" do | |||
@class.thunk_method :a_reader, @value | |||
@class.new.a_reader.should equal(@value) | |||
@class.new.a_reader.should equal(@value) | |||
end | |||
|
|||
it "accepts a String name as Symbol" do | |||
@class.thunk_method "a_reader", @value | |||
@class.new.a_reader.should equal(@value) | |||
end | |||
|
|||
it "returns the coerced name" do | |||
@class.thunk_method("a_reader", @value).should equal(:a_reader) | |||
end | |||
end |
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
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,2 @@ | |||
fails:Float#to_s uses e format for a positive value with whole part having 16 significant figures | |||
fails:Float#to_s uses e format for a negative value with whole part having 16 significant figures |
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -1,4 +1,2 @@ | |||
fails:Float#to_s uses non-e format for a positive value with whole part having 17 significant figures | fails:Float#to_s uses non-e format for a positive value with whole part having 17 significant figures | ||
fails:Float#to_s uses non-e format for a negative value with whole part having 17 significant figures | fails:Float#to_s uses non-e format for a negative value with whole part having 17 significant figures | ||
fails:Float#to_s uses non-e format for a positive value with whole part having 16 significant figures | |||
fails:Float#to_s uses non-e format for a negative value with whole part having 16 significant figures |
This file was deleted.
Oops, something went wrong.
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,2 @@ | |||
*.o | |||
*.a |
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,12 @@ | |||
# Below is a list of people and organizations that have contributed | |||
# to the double-conversion project. Names should be added to the | |||
# list like so: | |||
# | |||
# Name/Organization <email address> | |||
|
|||
Google Inc. | |||
Mozilla Foundation | |||
|
|||
Jeff Muizelaar <jmuizelaar@mozilla.com> | |||
Mike Hommey <mhommey@mozilla.com> | |||
Martin Olsson <mnemo@minimum.se> |
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,26 @@ | |||
Copyright 2006-2011, the V8 project authors. All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
|
|||
* Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
* Redistributions in binary form must reproduce the above | |||
copyright notice, this list of conditions and the following | |||
disclaimer in the documentation and/or other materials provided | |||
with the distribution. | |||
* Neither the name of Google Inc. nor the names of its | |||
contributors may be used to endorse or promote products derived | |||
from this software without specific prior written permission. | |||
|
|||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,11 @@ | |||
2012-06-10: | |||
Tagged v1.1.1. | |||
Null terminate exponent buffer (only an issue when asserts are enabled). | |||
Support more architectures. | |||
|
|||
2012-02-05: | |||
Merged in Single-branch with single-precision support. | |||
Tagged v1.1 (based on b28450f33e1db493948a535d8f84e88fa211bd10). | |||
|
|||
2012-02-05: | |||
Tagged v1.0 (based on eda0196e9ac8fcdf59e92cb62885ee0af5391969). |
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,26 @@ | |||
Copyright 2006-2011, the V8 project authors. All rights reserved. | |||
Redistribution and use in source and binary forms, with or without | |||
modification, are permitted provided that the following conditions are | |||
met: | |||
|
|||
* Redistributions of source code must retain the above copyright | |||
notice, this list of conditions and the following disclaimer. | |||
* Redistributions in binary form must reproduce the above | |||
copyright notice, this list of conditions and the following | |||
disclaimer in the documentation and/or other materials provided | |||
with the distribution. | |||
* Neither the name of Google Inc. nor the names of its | |||
contributors may be used to endorse or promote products derived | |||
from this software without specific prior written permission. | |||
|
|||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |||
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |||
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |||
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |||
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |||
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |||
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,20 @@ | |||
SRCS = src/bignum-dtoa.cc src/bignum.cc src/cached-powers.cc src/diy-fp.cc src/double-conversion.cc src/fast-dtoa.cc src/fixed-dtoa.cc src/strtod.cc | |||
DCLIB = libdoubleconversion.a | |||
OBJS = $(SRCS:.cc=.o) | |||
|
|||
ifeq ($(RANLIB),) | |||
RANLIB=ranlib | |||
endif | |||
|
|||
CXXFLAGS = -Wall -g -O2 | |||
LOADLIBES = -L./src | |||
|
|||
$(DCLIB): $(OBJS) | |||
$(AR) $(ARFLAGS) $(DCLIB) $(OBJS) | |||
$(RANLIB) $(DCLIB) | |||
|
|||
.cc.o: | |||
$(CXX) $(INCLUDES) $(CXXFLAGS) -c $< -o $@ | |||
|
|||
clean: | |||
rm -f $(OBJS) $(DCLIB) |
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
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,11 @@ | |||
http://code.google.com/p/double-conversion | |||
|
|||
This project (double-conversion) provides binary-decimal and decimal-binary | |||
routines for IEEE doubles. | |||
|
|||
The library consists of efficient conversion routines that have been extracted | |||
from the V8 JavaScript engine. The code has been refactored and improved so that | |||
it can be used more easily in other projects. | |||
|
|||
There is extensive documentation in src/double-conversion.h. Other examples can | |||
be found in test/cctest/test-conversions.cc. |
Oops, something went wrong.