Skip to content

Commit

Permalink
Merge branch 'master' into codedb-ffi-io
Browse files Browse the repository at this point in the history
Conflicts:
	machine/builtin/io.cpp
  • Loading branch information
chuckremes committed May 2, 2016
2 parents 5e3dc89 + 4b2a14b commit 0b140bf
Show file tree
Hide file tree
Showing 145 changed files with 3,003 additions and 4,099 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ notifications:
webhooks:
urls:
- https://webhooks.gitter.im/e/9502afd22ca6c8e85fb3
on_success: change
on_success: always
on_failure: always
on_start: always
env:
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
- Ben Brinckerhoff:
- Ben Burkert:
- Ben Curren:
- Ben Feng: { github: fengb }
- Ben Hughes:
- Benjamin Andresen:
- Benjamin Klotz: { irc: bennyklotz, github: bennyklotz, twitter: BennyKlotz }
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ gem "rake", "~> 10.0"
gem "redcard", "~> 1.0"

gem "daedalus-core", "~> 0.1"
gem "rubinius-bridge", "~> 1.0"
gem "rubinius-bridge", "~> 2.0"

gem "rubinius-code", "~> 3"
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ GEM
daedalus-core (0.5.0)
rake (10.5.0)
redcard (1.1.0)
rubinius-ast (3.2)
rubinius-bridge (1.1.0)
rubinius-ast (3.5)
rubinius-bridge (2.2)
redcard (~> 1.0)
rubinius-code (3.0)
rubinius-ast (~> 3)
Expand All @@ -14,9 +14,9 @@ GEM
rubinius-melbourne (~> 3)
rubinius-processor (~> 3)
rubinius-toolset (~> 3)
rubinius-compiler (3.1)
rubinius-compiler (3.3)
rubinius-instructions (3.0)
rubinius-melbourne (3.4)
rubinius-melbourne (3.5)
rubinius-processor (3.0)
rubinius-toolset (3.0)

Expand All @@ -27,7 +27,7 @@ DEPENDENCIES
daedalus-core (~> 0.1)
rake (~> 10.0)
redcard (~> 1.0)
rubinius-bridge (~> 1.0)
rubinius-bridge (~> 2.0)
rubinius-code (~> 3)

BUNDLED WITH
Expand Down
2 changes: 1 addition & 1 deletion configure
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ class Configure
@ruby_libversion = @ruby_version.split(/\./)[0..1].join.to_i

# Configure settings
@release_build = !git_directory
@release_build = !in_git?
end

# Set up system commands to run in cmd.exe on Windows. Either Windows
Expand Down
2 changes: 1 addition & 1 deletion core/alpha.rb
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def to_s
#
# Redefined later.
#
def raise(cls, str, junk=nil)
def raise(cls, str="", junk=nil)
Rubinius::VM.write_error "Fatal error loading core library:\n "
Rubinius::VM.write_error str
Rubinius::VM.write_error "\n"
Expand Down
1 change: 0 additions & 1 deletion core/array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,6 @@ def combination(num)
def compact
out = dup
out.untaint if out.tainted?
out.trust if out.untrusted?

Array.new(out.compact! || out)
end
Expand Down
33 changes: 25 additions & 8 deletions core/call_site.rb
Original file line number Diff line number Diff line change
@@ -1,23 +1,40 @@
module Rubinius
class CallSite
attr_reader :name
attr_reader :executable

def hits
0
end
attr_reader :cache

def ip
Rubinius.primitive :call_site_ip
raise PrimitiveFailure, "CallSite#ip primitive failed"
end

def location
"#{@executable.file}:#{@executable.line_from_ip(ip)}"
def depth
Rubinius.primitive :call_site_depth
raise PrimitiveFailure, "CallSite#depth primitive failed"
end

def invokes
Rubinius.primitive :call_site_invokes
raise PrimitiveFailure, "CallSite#invokes primitive failed"
end

def hits
Rubinius.primitive :call_site_hits
raise PrimitiveFailure, "CallSite#hits primitive failed"
end

def misses
Rubinius.primitive :call_site_misses
raise PrimitiveFailure, "CallSite#misses primitive failed"
end

def reset
Rubinius.primitive :call_site_reset
raise PrimitiveFailure, "CallSite#reset primitive failed"
end

def inspect
"#<#{self.class.name}:0x#{self.object_id.to_s(16)} #{location}##{@name}(#{hits})>"
"#<#{self.class.name}:0x#{self.object_id.to_s(16)} name=#{@name} ip=#{ip} depth=#{depth} invokes=#{invokes} hits=#{hits} misses=#{misses}>"
end
end
end
43 changes: 26 additions & 17 deletions core/kernel.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,20 +69,9 @@ def untaint
raise PrimitiveFailure, "Kernel#untaint primitive failed"
end

def trust
Rubinius.primitive :object_trust
raise PrimitiveFailure, "Kernel#trust primitive failed"
end

def untrust
Rubinius.primitive :object_untrust
raise PrimitiveFailure, "Kernel#untrust primitive failed"
end

def untrusted?
Rubinius.primitive :object_untrusted_p
raise PrimitiveFailure, "Kernel#untrusted? primitive failed"
end
alias_method :untrust, :taint
alias_method :trust, :untaint
alias_method :untrusted?, :tainted?

# NOTE: The bootstrap method used to add method definitions to the class
# method_table still returns a CompiledCode instance, so this chaining
Expand Down Expand Up @@ -725,9 +714,29 @@ def private_singleton_methods
end
private :private_singleton_methods

def proc(&prc)
raise ArgumentError, "block required" unless prc
return prc
def proc
env = nil

Rubinius.asm do
push_block
# assign a pushed block to the above local variable "env"
set_local 0
end

unless env
# Support for ancient pre-block-pass style:
# def something
# proc
# end
# something { a_block } => Proc instance
env = Rubinius::BlockEnvironment.of_sender

unless env
raise ArgumentError, "tried to create a Proc object without a block"
end
end

Proc.new(&env)
end
module_function :proc

Expand Down
2 changes: 0 additions & 2 deletions core/load_order.txt
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ metrics.rb
mirror.rb
missing_method.rb
module.rb
mono_inline_cache.rb
mutex.rb
native_method.rb
nil.rb
Expand All @@ -88,7 +87,6 @@ options.rb
pack.rb
pointer.rb
pointer_accessors.rb
poly_inline_cache.rb
proc.rb
proc_mirror.rb
process.rb
Expand Down
4 changes: 3 additions & 1 deletion core/marshal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -572,7 +572,9 @@ def construct(ivar_index = nil, call_proc = true)

call obj if @proc and call_proc

@stream.tainted? && !obj.frozen? ? obj.taint : obj
Rubinius::Type.infect obj, @stream unless obj.frozen?

obj
end

def construct_class
Expand Down
25 changes: 0 additions & 25 deletions core/mono_inline_cache.rb

This file was deleted.

16 changes: 10 additions & 6 deletions core/numeric.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,23 +31,27 @@ def <=>(other)
return nil
end

def step(limit, step=1)
def step(limit=nil, step=nil, to: nil, by: nil)
unless block_given?
return to_enum(:step, limit, step) do
Rubinius::Mirror::Numeric.reflect(self).step_size(limit, step)
return to_enum(:step, limit, step, to: to, by: by) do
Rubinius::Mirror::Numeric.reflect(self).step_size(limit, step, to, by)
end
end

raise ArgumentError, "step cannot be 0" if step == 0

m = Rubinius::Mirror::Numeric.reflect(self)
values = m.step_fetch_args(limit, step)
values = m.step_fetch_args(limit, step, to, by)
value = values[0]
limit = values[1]
step = values[2]
asc = values[3]
is_float = values[4]

if step == 0
while true
yield value
end
end

if is_float
n = m.step_float_size(value, limit, step, asc)

Expand Down
12 changes: 9 additions & 3 deletions core/numeric_mirror.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,16 @@ def step_float_size(value, limit, step, asc)
end
end

def step_size(limit, step)
values = step_fetch_args(limit, step)
def step_size(limit, step, to, by)
values = step_fetch_args(limit, step, to, by)
value = values[0]
limit = values[1]
step = values[2]
asc = values[3]
is_float = values[4]

return Float::INFINITY if step == 0

if is_float
# Ported from MRI

Expand All @@ -43,9 +45,13 @@ def step_size(limit, step)
end
end

def step_fetch_args(limit, step)
def step_fetch_args(limit, step, to, by)
raise ArgumentError, "limit is given twice" if limit && to
raise ArgumentError, "step is given twice" if step && by
raise ArgumentError, "step cannot be 0" if step == 0

limit ||= to
step ||= by || 1
value = @object
asc = step > 0
if value.kind_of? Float or limit.kind_of? Float or step.kind_of? Float
Expand Down
52 changes: 0 additions & 52 deletions core/poly_inline_cache.rb

This file was deleted.

Loading

0 comments on commit 0b140bf

Please sign in to comment.