Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin' into codedb-ffi-io
Browse files Browse the repository at this point in the history
  • Loading branch information
brixen committed Jun 2, 2016
2 parents 35eaf6c + 6d6d49e commit 06822ff
Show file tree
Hide file tree
Showing 74 changed files with 895 additions and 1,618 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ tmtags
/work
/staging
/bootstrap
/build/bin/cc
/build/bin/c++
Gemfile.installed.lock

# .revision tracks configure and code revision consistency
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ before_script:
- if [ $TRAVIS_OS_NAME == osx ]; then travis_retry ./configure; fi
script: rake ci
after_success:
- if [ $TRAVIS_OS_NAME == linux ]; then ./scripts/build_support.sh archive_core; fi
- if [ $TRAVIS_BRANCH == $TRAVIS_TAG ]; then ./scripts/deploy.sh release github website triggers; fi
branches:
only:
Expand Down
4 changes: 4 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ unless RedCard.check :ruby, :rubinius
exit 1
end

if BUILD_CONFIG[:build_bin]
ENV["PATH"] = "#{BUILD_CONFIG[:build_bin]}:#{ENV["PATH"]}"
end

def libprefixdir
if BUILD_CONFIG[:stagingdir]
"#{BUILD_CONFIG[:stagingdir]}#{BUILD_CONFIG[:libdir]}"
Expand Down
25 changes: 23 additions & 2 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,8 @@ class Configure
@ruby_version = "2.2.2"
@ruby_libversion = @ruby_version.split(/\./)[0..1].join.to_i

@build_bin = "#{@sourcedir}/build/bin"

# Configure settings
@release_build = !in_git?
end
Expand Down Expand Up @@ -325,11 +327,11 @@ class Configure

o.doc "\n Compiler settings"

o.on "--cc", "COMPILER", "Compiler to use for C code (eg gcc, clang)" do |cc|
o.on "--cc", "COMPILER", "Compiler to use for C code (eg clang)" do |cc|
@cc = cc
end

o.on "--cxx", "COMPILER", "Compiler to use for C++ code (eg g++, clang++)" do |cxx|
o.on "--cxx", "COMPILER", "Compiler to use for C++ code (eg clang++)" do |cxx|
@cxx = cxx
end

Expand Down Expand Up @@ -712,6 +714,24 @@ please notify us.
EOM
end

if File.exist? @build_bin
if !File.directory? @build_bin
fail "#{@build_bin} already exists and is not a directory"
end
else
FileUtils.mkdir_p @build_bin
end

if @cc != "cc"
cc = "#{@build_bin}/cc"
File.symlink `which #{@cc}`.chomp, cc unless File.exist? cc
end

if @cxx != "c++"
cxx = "#{@build_bin}/c++"
File.symlink `which #{@cxx}`.chomp, cxx unless File.exist? cxx
end

@make ||= ENV['MAKE'] || 'make'
@rake ||= ENV['RAKE'] || 'rake'
@tar ||= ENV['TAR'] || (@windows ? 'bsdtar' : 'tar')
Expand Down Expand Up @@ -1572,6 +1592,7 @@ int main() { return tgetnum(""); }
:bootstrap_gems_dir => @bootstrap_gems_dir,
:capi_includedir => @capi_includedir,
:build_exe => "#{@build_prefix}#{@bindir}/#{@program_name}",
:build_bin => @build_bin,
:prefixdir => @prefixdir,
:bindir => @bindir,
:libdir => @libdir,
Expand Down
4 changes: 4 additions & 0 deletions core/deprecations.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ module Rubinius
"Ruby 2.1 features that are incompatible with Ruby 2.2 are deprecated." =>
"Use Ruby 2.2 features if they are available.",
"Rubinius::KERNEL_PATH is deprecated." => "Use Rubinius::CORE_PATH instead.",
"Support for 32-bit platforms is deprecated." =>
"Use 64-bit platforms or open an issue if 32-bit support is a critical feature.",
"Support for the GCC compiler is deprecated." =>
"Use clang or open an issue if GCC support is a critical feature.",
}
end
4 changes: 3 additions & 1 deletion core/enumerator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,8 @@ def zip(*lists)

if Rubinius::Fiber::ENABLED
class FiberGenerator
STACK_SIZE = 163_840

attr_reader :result

def initialize(obj)
Expand Down Expand Up @@ -477,7 +479,7 @@ def rewind

def reset
@done = false
@fiber = Rubinius::Fiber.new(0) do
@fiber = Rubinius::Fiber.new stack_size: STACK_SIZE do
obj = @object
@result = obj.each do |*val|
Rubinius::Fiber.yield *val
Expand Down
11 changes: 5 additions & 6 deletions core/fiber.rb
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
module Rubinius
class Fiber
def self.create(callable)
Rubinius.primitive :fiber_new
raise NotImplementedError, "Fibers not supported on this platform"
end
attr_reader :stack_size

def self.new(size=0, &block)
def self.new(**kw, &block)
if block.nil?
raise ArgumentError, "Fiber.new requires a block"
end

create(block)
stack_size = Rubinius::Type.try_convert kw[:stack_size], Fixnum, :to_int

Rubinius.invoke_primitive :fiber_new, stack_size, block, self
end

def self.current
Expand Down
12 changes: 5 additions & 7 deletions core/jit.rb
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
module Rubinius
module JIT
class << self
attr_accessor :available
attr_accessor :enabled
attr_accessor :properties

@enabled = false

alias_method :available?, :available
alias_method :enabled?, :enabled

def compile(object, compiled_code, block_environment=nil)
Rubinius.invoke_primitive :jit_compile, self, object, compiled_code, block_environment
end

def enabled?
Rubinius.primitive :jit_enabled_p
raise PrimitiveFailure, "Rubinius::JIT.enabled? primitive failed"
end

# TODO: Fix configuration
def compile_threshold
Rubinius.primitive :jit_compile_threshold
Expand Down
5 changes: 2 additions & 3 deletions core/loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,9 @@ def options(argv=ARGV)
Available subcommands:
compile Run the bytecode compiler
console Run the Agent CLI
docs Run a local HTTP documentation server
gem Run RubyGems 'gem' command
report Create a gist of the last Rubinius toplevel exception
irb Run IRB
erb Run ERb
DOC

options.doc <<-DOC
Expand Down
12 changes: 6 additions & 6 deletions core/rbconfig.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,9 @@ module RbConfig
CONFIG["NROFF"] = "/usr/bin/nroff"
CONFIG["MAKEDIRS"] = "mkdir -p"
# compile tools
CONFIG["CC"] = (ENV["CC"] || Rubinius::BUILD_CONFIG[:cc].sub(/^(gcc|clang)/, "cc")).dup
CONFIG["CXX"] = (ENV["CXX"] || Rubinius::BUILD_CONFIG[:cxx].sub(/^(g|clang)\+\+/, "c++")).dup
CONFIG["CPP"] = "#{(ENV["CPP"] || Rubinius::BUILD_CONFIG[:cc].sub(/^(gcc|clang)/, "cc"))} -E"
CONFIG["CC"] = (ENV["CC"] || Rubinius::BUILD_CONFIG[:cc].sub(/^((gcc|clang)[-.0-9]*)/, "cc")).dup
CONFIG["CXX"] = (ENV["CXX"] || Rubinius::BUILD_CONFIG[:cxx].sub(/^((g|clang)\+\+[-.0-9]*)/, "c++")).dup
CONFIG["CPP"] = "#{(ENV["CPP"] || Rubinius::BUILD_CONFIG[:cc].sub(/^((gcc|clang)[-.0-9]*)/, "cc"))} -E"
CONFIG["YACC"] = "bison -y"
CONFIG["RANLIB"] = "ranlib"
CONFIG["AR"] = "ar"
Expand All @@ -113,7 +113,7 @@ module RbConfig
CONFIG["CFLAGS"] = "-g"
CONFIG["CXXFLAGS"] = "-g"
CONFIG["LDFLAGS"] = ""
if ENV['DEV']
if Rubinius::BUILD_CONFIG[:debug_build]
CONFIG["CFLAGS"] << " -O0 "
CONFIG["CXXFLAGS"] << " -O0 "
else
Expand Down Expand Up @@ -210,8 +210,8 @@ module RbConfig
CONFIG["PACKAGE_STRING"] = ""
CONFIG["PACKAGE_BUGREPORT"] = ""

ldshared = (ENV["LDSHARED"] || Rubinius::LDSHARED.sub(/^(gcc|clang)/, "cc")).dup
ldsharedxx = (ENV["LDSHAREDXX"] || Rubinius::LDSHAREDXX.sub(/^(g|clang)\+\+/, "c++")).dup
ldshared = (ENV["LDSHARED"] || Rubinius::LDSHARED.sub(/^((gcc|clang)[-.0-9]*)/, "cc")).dup
ldsharedxx = (ENV["LDSHAREDXX"] || Rubinius::LDSHAREDXX.sub(/^((g|clang)\+\+[-.0-9]*)/, "c++")).dup

CONFIG["LDSHARED"] = ldshared
CONFIG["LIBRUBY_LDSHARED"] = ldshared
Expand Down
8 changes: 4 additions & 4 deletions core/rubinius.rb
Original file line number Diff line number Diff line change
Expand Up @@ -239,12 +239,12 @@ def self.received_signal(sig)
def self.version
extra = ""

if Rubinius::JIT.enabled? and jit = Rubinius::JIT.properties
if Rubinius::JIT.enabled? # and jit = Rubinius::JIT.properties
extra << "J"

if jit.include? :inline_generic
extra << "I"
end
# if jit.include? :inline_generic
# extra << "I"
# end
end

extra << "P" if Rubinius::PROFILER != "none"
Expand Down
13 changes: 9 additions & 4 deletions core/thread.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,12 @@ class Thread
attr_reader :recursive_objects
attr_reader :pid
attr_reader :exception
attr_reader :stack_size

def self.new(*args, &block)
thr = Rubinius.invoke_primitive :thread_s_new, args, block, self
def self.new(*args, **kw, &block)
stack_size = Rubinius::Type.try_convert kw[:stack_size], Fixnum, :to_int

thr = Rubinius.invoke_primitive :thread_s_new, args, stack_size, block, self

Rubinius::VariableScope.of_sender.locked!

Expand All @@ -20,10 +23,12 @@ def self.new(*args, &block)
return thr
end

def self.start(*args, &block)
def self.start(*args, **kw, &block)
raise ArgumentError.new("no block passed to Thread.start") unless block

Rubinius.invoke_primitive :thread_s_start, args, block, self
stack_size = Rubinius::Type.try_convert kw[:stack_size], Fixnum, :to_int

Rubinius.invoke_primitive :thread_s_start, args, stack_size, block, self
end

class << self
Expand Down
5 changes: 0 additions & 5 deletions library/bin/docs.rb

This file was deleted.

Loading

0 comments on commit 06822ff

Please sign in to comment.