Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: rubinius/rubinius
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2fd33bf3ad5d
Choose a base ref
...
head repository: rubinius/rubinius
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6f24fedf3ce2
Choose a head ref

Commits on Aug 31, 2015

  1. Copy the full SHA
    7444a80 View commit details
  2. Copy the full SHA
    2560bb8 View commit details
  3. Copy the full SHA
    7277010 View commit details
  4. Removed GCToken.

    This was a well-intentioned idea but not practical or useful.
    
    The idea was to have the compiler help check where in call paths a
    garbage-collection cycle could run. Unfortnately, adding this in as an
    after-thought resulted in all the places where GCTokens are created from thin
    air deep in some call path. It didn't change the fact that GC could happen
    pretty much anywhere.
    
    In a managed runtime, either GC can happen everywhere or it should only happen
    at a very small number of extremely well-defined points.  The middle ground of
    "it can happen at all these places" is an invitation for a low budget horror
    movie, dismembered objects strewn throughout the code.
    
    Along with the rework of the stop-the-world mechanism, the removal of GCToken
    and restricting the invocation of a GC cycle to a single well-defined method
    call in a few well-defined locations, and finally, making all allocation paths
    GC-safe (ie GC will NOT run when allocating an object), Rubinius will have much
    better defined GC behavior.
    
    The GC safe allocation path is important for cases like the string_dup
    instruction, where a young GC cycle could run when allocating the dup and the
    original String (eg a literal String in a method) is in the young generation
    and moved. Since the original String is on the C stack and not in a GC root
    object, the dup fails when copying the contents of the original String. It's
    better to make allocation GC-safe than to accept the performance cost of the GC
    root in these sorts of cases. Also, that case is only one well-defined instance
    of the issue. There are more complicated ones.
    brixen committed Aug 31, 2015
    Copy the full SHA
    bace448 View commit details
  5. Reworked allocation.

    These changes introduce a couple things:
    
    1. All allocation paths are GC-safe.
    
    What that means is that when requesting a new object be created, the request
    will be fulfilled *unless* the system (or process limits prevent it) *without*
    GC running. In other words, there are two possible results of allocating an
    object: 1) a new object, or 2) an exception because no more memory is
    available to the process.
    
    In either case, from the point the object is requested until that request
    returns (or the return is bypassed by the exception unwind), the GC will not
    run.
    
    There is a trade-off here between running the GC at the instant that some
    threshold is breached (eg the eden space is exhausted) and loosening some
    requirements that must be maintained for a generational, moving garbage
    collector (ie every object reference must be known to the GC at the time the
    GC runs). Since we run GC on method entry and loop back branches, there is no
    reasonable scenario in which deferring GC until allocation has completed will
    result in unwanted object graph thresholds being breached pathologically (eg
    an execution path where allocation can grow unbounded).
    
    2. All objects are allocated from the various heaps *uninitialized* and a
    protocol is established to call an initialization routine on the objects.
    
    The initialization routine is `T::initialize(State* state, T* obj)`, where T is
    the type of object being allocated. The method is a static method of the class
    of the object. This breaks with the protocol that Ruby uses where `new` is a
    module method and `initialize` is an instance method. The primary reason for
    choosing a static (ie C++ class) is to avoid an instance method operating on
    an incompletely initialized object.
    
    One purpose of this initialization protocol is to eliminate or reduce the
    double initialization that we were doing (ie setting all fields to nil and
    then initializing them to other default values). The main initialization
    method shown above may be an empty body, in which case the compiler will elide
    it anyway and there's no overhead to the protocol. In that case, another
    initialization method should be called on the newly created object. Since the
    allocation method is templated and if the initialization method is visible (ie
    in the header file), the compiler should be able to elide remaining double
    initialization in most contexts.
    brixen committed Aug 31, 2015
    Copy the full SHA
    ca3011d View commit details
  6. Fixed VM tests.

    brixen committed Aug 31, 2015
    Copy the full SHA
    3fde9fb View commit details
  7. Fixed triggering GC.

    brixen committed Aug 31, 2015
    Copy the full SHA
    3c05ffa View commit details
  8. Fixed some class creation.

    brixen committed Aug 31, 2015
    Copy the full SHA
    08372d6 View commit details
  9. Copy the full SHA
    1743a37 View commit details
  10. Copy the full SHA
    10323d5 View commit details
  11. Delay tracking VM objects until Thread is running.

    In the case of `Thread.new`, the OS thread will never run because a
    ThreadError exception is raised when no block is passed. If we track the VM
    object that would ultimately contain the reference to the OS thread, we either
    need a way to remove the VM object when eg `Thread.new` raises an exception or
    we will leak these objects. Instead of tracking and then untracking the VM
    object, we create the object untracked and track it if the OS thread starts
    executing.
    brixen committed Aug 31, 2015
    Copy the full SHA
    66fca42 View commit details
  12. Copy the full SHA
    2834234 View commit details
  13. Copy the full SHA
    37da04e View commit details
  14. Fixes to build on Trusty.

    brixen committed Aug 31, 2015
    Copy the full SHA
    efa33da View commit details
  15. Copy the full SHA
    dc4ad6e View commit details
  16. Copy the full SHA
    8d2a439 View commit details
  17. Copy the full SHA
    87821c5 View commit details

Commits on Sep 2, 2015

  1. Properly guard JIT specs.

    brixen committed Sep 2, 2015
    Copy the full SHA
    b5975f2 View commit details
  2. Copy the full SHA
    3291521 View commit details
  3. Reworked when GC is invoked.

    brixen committed Sep 2, 2015
    Copy the full SHA
    bb3864e View commit details
  4. Copy the full SHA
    6c2f41f View commit details

Commits on Sep 5, 2015

  1. Copy the full SHA
    f8271d2 View commit details
  2. Improve triggering GC.

    brixen committed Sep 5, 2015
    Copy the full SHA
    5a588d5 View commit details
  3. Copy the full SHA
    10b38c2 View commit details
  4. Copy the full SHA
    6dc58e3 View commit details
  5. Copy the full SHA
    951aeb0 View commit details
  6. Copy the full SHA
    0521c3b View commit details
  7. Copy the full SHA
    1f4f82d View commit details

Commits on Sep 12, 2015

  1. Immix sets collect flag.

    brixen committed Sep 12, 2015
    Copy the full SHA
    5daca40 View commit details

Commits on Nov 30, 2015

  1. Pulled check outside of loop.

    brixen committed Nov 30, 2015
    Copy the full SHA
    ff93ae9 View commit details

Commits on Dec 30, 2015

  1. Merge branch 'master' into stw

    brixen committed Dec 30, 2015
    Copy the full SHA
    891bbce View commit details
  2. Fixed VM tests.

    brixen committed Dec 30, 2015
    Copy the full SHA
    899dca7 View commit details

Commits on Dec 31, 2015

  1. Copy the full SHA
    d265ed9 View commit details
  2. Satisfy gcc 4.8.4.

    brixen committed Dec 31, 2015
    Copy the full SHA
    d43ae9c View commit details

Commits on Jan 17, 2016

  1. Copy the full SHA
    aa242ae View commit details
  2. Copy the full SHA
    a8fec90 View commit details

Commits on Jan 18, 2016

  1. Copy the full SHA
    5d651e9 View commit details
  2. Copy the full SHA
    172e032 View commit details
  3. Copy the full SHA
    f03ab0a View commit details

Commits on Jan 19, 2016

  1. Reworked ThreadNexus.

    brixen committed Jan 19, 2016
    Copy the full SHA
    ce0c08d View commit details
  2. Copy the full SHA
    6224161 View commit details
  3. Copy the full SHA
    d332e3e View commit details
  4. Copy the full SHA
    b603b61 View commit details

Commits on Jan 20, 2016

  1. Reworked triggering GC.

    brixen committed Jan 20, 2016
    Copy the full SHA
    78235a0 View commit details
  2. Copy the full SHA
    b5197aa View commit details

Commits on Jan 23, 2016

  1. Copy the full SHA
    20cd1d3 View commit details
  2. Copy the full SHA
    0d1859b View commit details

Commits on Jan 24, 2016

  1. Removed BakerGC.

    brixen committed Jan 24, 2016
    Copy the full SHA
    03f8943 View commit details
  2. Introduce SleepPhase.

    Thread semantics are ad hoc in Ruby so we make a best effort to mimic them
    where possible. The behavior of process exit when one or more threads are
    suspended in a sleep state is not well-defined. We assume that no sleeping
    thread should block the process from exiting. We introduce a specific "sleep
    phase" as one state a thread may be in. We then ignore sleeping threads when
    executing a process exit.
    
    Unfortunately, this is more complex than it appears on its face. While
    executing a process exit, we are essentially racing any sleeping threads that
    may wake up and attempt to access resources that are being destroyed (something
    like one of those scenes from Inception with the buildings crumbling around the
    participants). We cannot waking thread proceed once process exit has started,
    so we permanently lock a mutex that every waking thread must acquire before
    progressing.
    
    Ultimately, these lock resources will need to be in the program's data segment,
    so they are static memory, not dynamically allocated, as they are now.
    brixen committed Jan 24, 2016
    Copy the full SHA
    903aae1 View commit details

Commits on Jan 25, 2016

  1. Copy the full SHA
    4918136 View commit details
Showing 709 changed files with 8,988 additions and 8,901 deletions.
17 changes: 6 additions & 11 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -73,25 +73,20 @@ Gemfile.installed.lock
# don't ignore spec/tags
!/spec/tags

/vm/log
/vm/.deps
/vm/vm.exe
/machine/log
/machine/.deps
/machine/vm.exe

/vm/test/ruby.h
/machine/test/ruby.h

# rubysl-digest installs this header
vm/include/capi/ruby/digest.h
machine/include/capi/ruby/digest.h

/core/signature.rb
/core/build_config.rb

# Generated documentation
doc/generated/vm
web/doc/*/*.bak
web/doc/*/*.new

# Ignore generated DTrace header
vm/dtrace/probes.h
machine/dtrace/probes.h

# Ignore rubygems except bundled ones
vendor/cache/*
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -19,7 +19,7 @@ before_script:
- ./configure
script: rake ci
after_success:
- if [ $TRAVIS_BRANCH == $TRAVIS_TAG ]; then ./scripts/deploy.sh all; fi
- if [ $TRAVIS_BRANCH == $TRAVIS_TAG ]; then ./scripts/deploy.sh release github website triggers; fi
branches:
only:
- master
@@ -39,6 +39,7 @@ notifications:
on_start: always
env:
global:
- RBXOPT=-Xint
- LANG="en_US.UTF-8"
- secure: olbok/GN6rOYvPnHBYWGz7giCoCdLFpT/7WSBHukYO3E0uNeqAUOOgW2BFOwCVWdSEJ/iTvJXZQ4qVZHX+6jRfvILZeGv+D2P93VdD8UFQRoTOfFC7esAo525s9fuKm9ehUGWZxlzGOBHHckky1jn6pEf8mlXAVM5e76dlH0fck=
- secure: aqG9eB/PrzQ7XJQN6YX/00sNVvwSB77saxXQzguL2WFjAXB74h6168Hzq+awHtNX/vfOb6ta7fpWLHrA0D+gmZnvTR29VlP6nd0vs1tkdX1/jWbiBHjamRffp+NWVdKbJKYn5iLOGXcuUMOzY/opLKOdvxKZfkxGMxR2tTNLZUE=
21 changes: 0 additions & 21 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -6,27 +6,6 @@ performance improvements, and help with documentation. Every contribution is
meaningful, so thank you for participating. That being said, here are a few
guidelines that we ask you to follow so we can successfully address your issue.

### Submitting Issues

Please include the following:

* The Rubinius version (`rbx -v`)
* Your OS (`uname -a`) RVM/rbenv/chruby/etc version or the commit hash from git
if you're building off of a clone
* Stack trace (preferably as a Gist, since they're easier to read.) If you can
add a failing spec, that's great!
* Please include the simplest possible reproduction you can. This last point is
vital to fixing issues.

If available, please also include the contents of the following files as a
Gist:

* `configure.log`
* `config.rb`

These two files contain the output of the compilation process and the various
configuration options used (e.g. compiler options).

### Version Managers

We can *not* help you with any issues that might be caused by a Ruby version
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@ GEM
daedalus-core (0.5.0)
rake (10.5.0)
redcard (1.1.0)
rubinius-ast (3.0)
rubinius-ast (3.2)
rubinius-bridge (1.1.0)
redcard (~> 1.0)
rubinius-code (3.0)
@@ -14,9 +14,9 @@ GEM
rubinius-melbourne (~> 3)
rubinius-processor (~> 3)
rubinius-toolset (~> 3)
rubinius-compiler (3.0)
rubinius-compiler (3.1)
rubinius-instructions (3.0)
rubinius-melbourne (3.1)
rubinius-melbourne (3.4)
rubinius-processor (3.0)
rubinius-toolset (3.0)

2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -32,7 +32,7 @@ BUILD_CONFIG = {} unless Object.const_defined? :BUILD_CONFIG

def load_configuration
config_rb = File.expand_path "../config.rb", __FILE__
config_h = File.expand_path "../vm/gen/config.h", __FILE__
config_h = File.expand_path "../machine/gen/config.h", __FILE__

unless File.exist?(config_rb) and File.exist?(config_h)
if $cleaning
23 changes: 12 additions & 11 deletions configure
Original file line number Diff line number Diff line change
@@ -100,12 +100,12 @@ class Configure

@stagingdir = nil
@build_prefix = nil
@capi_includedir = "#{@sourcedir}/vm/include/capi"
@capi_includedir = "#{@sourcedir}/machine/include/capi"

@runtime_gems_dir = nil
@bootstrap_gems_dir = nil

@vm_release_h = File.join(root, "/vm/gen/release.h")
@vm_release_h = File.join(root, "/machine/gen/release.h")

@preserve_prefix = false

@@ -241,7 +241,7 @@ class Configure
@vendordir = @prefixdir + "/vendor" unless @vendordir
@mandir = @prefixdir + "/man" unless @mandir
@gemsdir = @prefixdir + "/gems" unless @gemsdir
@includedir = @prefixdir + "/vm/include/capi" unless @includedir
@includedir = @prefixdir + "/machine/include/capi" unless @includedir

@encdir = @libdir + "/encoding/converter"

@@ -667,8 +667,6 @@ int main() { LLVMContext &Context = getGlobalContext(); }
flags = '--ldflags'

if @llvm_api_version >= 305
@llvm_cxxflags << " -std=c++11"

# Starting with LLVM 3.5 the --system-libs option is required in order to
# link against libraries such as zlib. Prior to 3.5 this was handled by
# --ldflags.
@@ -678,6 +676,9 @@ int main() { LLVMContext &Context = getGlobalContext(); }
# Generate the actual flags. For whatever reason llvm-config also includes
# newlines in the output, so lets get rid of those while we're at it.
@llvm_ldflags = `#{@llvm_configure} #{flags}`.strip.gsub("\n", ' ')

# We use some C++11 features in the VM source, so we need to enable support.
@llvm_cxxflags << " -std=c++11"
end

def env(which)
@@ -1625,9 +1626,9 @@ int main() { return tgetnum(""); }
FileUtils.cp @config, "#{@sourcedir}/core/build_config.rb"

# Write the config file used to build the C++ VM.
Dir.mkdir "vm/gen" unless File.directory? "vm/gen"
Dir.mkdir "machine/gen" unless File.directory? "machine/gen"

vm_paths_h = "vm/gen/paths.h"
vm_paths_h = "machine/gen/paths.h"
File.open vm_paths_h, "wb" do |f|
f.puts <<-EOF
#define RBX_PREFIX_PATH "#{@prefixdir}"
@@ -1644,7 +1645,7 @@ int main() { return tgetnum(""); }
EOF
end

vm_config_h = "vm/gen/config.h"
vm_config_h = "machine/gen/config.h"
File.open vm_config_h, "wb" do |f|
f.puts <<-EOC
#define RBX_PROGRAM_NAME "#{@program_name}"
@@ -1745,8 +1746,8 @@ int main() { return tgetnum(""); }
end
end

# Create C-API header for vm/test
File.open "vm/test/ruby.h", "w" do |f|
# Create C-API header for machine/test
File.open "machine/test/ruby.h", "w" do |f|
f.puts %[#include "#{@capi_includedir}/ruby.h"]
end
end
@@ -1757,7 +1758,7 @@ int main() { return tgetnum(""); }
cat("config.rb")
puts "\nSetting the following defines for the VM"
puts "----------------------------------------"
cat("vm/gen/config.h")
cat("machine/gen/config.h")
end

def cat(file)
2 changes: 1 addition & 1 deletion core/autoload.rb
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ def resolve
unless @loaded && @thread == Thread.current
@loaded = true
@thread = Thread.current
Rubinius::CodeLoader.require @path
Rubinius::CodeLoader.require @path or Rubinius::CodeLoader.feature_provided? @path
end
end
end
5 changes: 4 additions & 1 deletion core/basic_object.rb
Original file line number Diff line number Diff line change
@@ -39,7 +39,10 @@ def __id__
end

def method_missing(meth, *args)
::Kernel.raise ::NoMethodError, "Unable to send '#{meth}' on instance of BasicObject"
error = ::NoMethodError
.new("Unable to send '#{meth}' on instance of BasicObject", receiver: self)

::Kernel.raise(error)
end
private :method_missing

2 changes: 1 addition & 1 deletion core/class.rb
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ def set_superclass(sup)

def initialize(sclass=Object, name=nil, under=nil)
raise TypeError, "already initialized class" if @instance_type
raise TypeError, "can't make subclass of Class" if sclass.equal?(Class)
raise TypeError, "can't make subclass of Class" if Class.equal?(sclass)

set_superclass sclass

2 changes: 1 addition & 1 deletion core/compiled_code.rb
Original file line number Diff line number Diff line change
@@ -173,7 +173,7 @@ def block_index
#
# @return [String]
def inspect
"#<#{self.class.name} #{@name} file=#{@file}>"
"#<#{self.class.name}:0x#{object_id.to_s(16)} #{@name} file=#{@file}>"
end

##
16 changes: 13 additions & 3 deletions core/exception.rb
Original file line number Diff line number Diff line change
@@ -237,18 +237,28 @@ class LocalJumpError < StandardError
class NameError < StandardError
attr_reader :name

def initialize(*args)
def initialize(*args, receiver: nil)
super(args.shift)

@name = args.shift
@receiver = receiver
end

def receiver
if @receiver
@receiver
else
raise ArgumentError, 'no receiver is available'
end
end
end

class NoMethodError < NameError
attr_reader :name
attr_reader :args

def initialize(*arguments)
super(arguments.shift)
def initialize(*arguments, **options)
super(arguments.shift, **options)
@name = arguments.shift
@args = arguments.shift
end
Loading