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: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f7a8a2e4e67a
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7b3160963260
Choose a head ref
  • 14 commits
  • 15 files changed
  • 1 contributor

Commits on Jun 13, 2016

  1. Copy the full SHA
    5c34605 View commit details
  2. Copy the full SHA
    f26cb94 View commit details
  3. Copy the full SHA
    29ef974 View commit details
  4. Copy the full SHA
    22d641b View commit details
  5. Copy the full SHA
    9ef0c60 View commit details
  6. Copy the full SHA
    f5eece9 View commit details
  7. Copy the full SHA
    1dc5ca0 View commit details
  8. Copy the full SHA
    be2713b View commit details
  9. Copy the full SHA
    8188c14 View commit details
  10. Copy the full SHA
    6bd703f View commit details
  11. Copy the full SHA
    7b77c64 View commit details
  12. Copy the full SHA
    bd95c46 View commit details
  13. Copy the full SHA
    f86416e View commit details
  14. Copy the full SHA
    7b31609 View commit details
Original file line number Diff line number Diff line change
@@ -1478,7 +1478,6 @@ public DynamicObjectFactory getHandleFactory() {
"/core/truffle/ctype.rb",
"/core/integer.rb",
"/core/fixnum.rb",
"/core/lru_cache.rb",
"/core/regexp.rb",
"/core/encoding.rb",
"/core/env.rb",
46 changes: 46 additions & 0 deletions truffle/src/main/ruby/core/atomic.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Copyright (c) 2007-2015, Evan Phoenix and contributors
# 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 Rubinius 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.

module Rubinius
# TODO (pitr-ch 11-Jun-2016): move under Truffle
class AtomicReference
def initialize(val=nil)
set(val) unless val.nil?
end

def marshal_dump
get
end

def marshal_load(val)
set(val)
end

alias_method :value, :get

alias_method :value=, :set
end
end
12 changes: 12 additions & 0 deletions truffle/src/main/ruby/core/channel.rb
Original file line number Diff line number Diff line change
@@ -53,5 +53,17 @@ def receive_timeout(duration)
@queue.receive_timeout(duration)
end
end

def try_receive
begin
@queue.pop(true)
rescue ThreadError # queue empty
nil
end
end

def inspect
"#<Rubinius::Channel:0x#{object_id.to_s(16)}>"
end
end
end
4 changes: 4 additions & 0 deletions truffle/src/main/ruby/core/dir.rb
Original file line number Diff line number Diff line change
@@ -255,6 +255,10 @@ def each
self
end

attr_reader :path

alias_method :to_path, :path

SeekKind = 0
RewindKind = 1
TellKind = 2
17 changes: 0 additions & 17 deletions truffle/src/main/ruby/core/dir_glob.rb
Original file line number Diff line number Diff line change
@@ -356,30 +356,13 @@ def self.glob(pattern, flags, matches=[])
return matches
end

ec_key = nil

if gc = @glob_cache
ec_key = [pattern, flags]
if patterns = gc.retrieve(ec_key)
patterns.each do |node|
run node, matches
end

return matches
end
end

if pattern.include? "{"
patterns = compile(pattern, flags)

gc.set ec_key, patterns if ec_key

patterns.each do |node|
run node, matches
end
elsif node = single_compile(pattern, flags)
gc.set ec_key, [node] if ec_key

run node, matches
else
matches
12 changes: 12 additions & 0 deletions truffle/src/main/ruby/core/encoding.rb
Original file line number Diff line number Diff line change
@@ -43,6 +43,10 @@ class Transcoding
attr_accessor :source
attr_accessor :target

def inspect
"#<#{super} #{source} to #{target}"
end

def self.create(source, target)
ret = new

@@ -604,6 +608,14 @@ def names
end
names
end

def _dump(depth)
name
end

def self._load(name)
find name
end
end

Encoding::TranscodingMap[:'UTF-16BE'] = Rubinius::LookupTable.new
62 changes: 28 additions & 34 deletions truffle/src/main/ruby/core/enumerator.rb
Original file line number Diff line number Diff line change
@@ -131,10 +131,8 @@ def next
@generator = @object.to_generator(@iter)
end

if !@generator and gen = FiberGenerator
@generator = gen.new(self)
else
@generator = ThreadGenerator.new(self, @object, @iter, @args)
if !@generator
@generator = FiberGenerator.new(self)
end
end

@@ -463,47 +461,43 @@ def zip(*lists)
end
end

if Rubinius::Fiber::ENABLED
class FiberGenerator
attr_reader :result
class FiberGenerator
attr_reader :result

def initialize(obj)
@object = obj
rewind
end
def initialize(obj)
@object = obj
rewind
end

def next?
!@done
end
def next?
!@done
end

def next
reset unless @fiber
def next
reset unless @fiber

val = @fiber.resume
val = @fiber.resume

raise StopIteration, "iteration has ended" if @done
raise StopIteration, "iteration has ended" if @done

return val
end
return val
end

def rewind
@fiber = nil
@done = false
end
def rewind
@fiber = nil
@done = false
end

def reset
@done = false
@fiber = Rubinius::Fiber.new(0) do
obj = @object
@result = obj.each do |*val|
Rubinius::Fiber.yield *val
end
@done = true
def reset
@done = false
@fiber = Rubinius::Fiber.new(0) do
obj = @object
@result = obj.each do |*val|
Rubinius::Fiber.yield *val
end
@done = true
end
end
else
FiberGenerator = nil
end
end
end
9 changes: 0 additions & 9 deletions truffle/src/main/ruby/core/hash.rb
Original file line number Diff line number Diff line change
@@ -36,15 +36,6 @@
class Hash
include Enumerable

Entries = Rubinius::Tuple

# Initial size of Hash. MUST be a power of 2.
MIN_SIZE = 16

# Allocate more storage when this full. This value grows with
# the size of the Hash so that the max load factor is 0.75.
MAX_ENTRIES = 12

def self.new_from_associate_array(associate_array)
hash = new
associate_array.each do |array|
6 changes: 6 additions & 0 deletions truffle/src/main/ruby/core/io.rb
Original file line number Diff line number Diff line change
@@ -336,6 +336,12 @@ def full?
@total == @used
end

def inspect # :nodoc:
content = (@start..@used).map { |i| @storage[i].chr }.join.inspect
format "#<IO::InternalBuffer:0x%x total=%p start=%p used=%p data=%p %s>",
object_id, @total, @start, @used, @storage, content
end

##
# Resets the buffer state so the buffer can be filled again.
def reset!
135 changes: 0 additions & 135 deletions truffle/src/main/ruby/core/lru_cache.rb

This file was deleted.

Loading