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

Commits on Dec 22, 2014

  1. Copy the full SHA
    00c7d79 View commit details
  2. Copy the full SHA
    da56754 View commit details
10 changes: 4 additions & 6 deletions core/src/main/ruby/jruby/truffle/core.rb
Original file line number Diff line number Diff line change
@@ -16,12 +16,7 @@

require_relative 'core/rubinius/api/compat/type'

require_relative 'core/rubinius/api/kernel/bootstrap/channel'

require_relative 'core/rubinius/api/kernel/common/bytearray'
require_relative 'core/rubinius/api/kernel/common/channel'
require_relative 'core/rubinius/api/kernel/common/thread'
require_relative 'core/rubinius/api/kernel/common/tuple'
require_relative 'core/rubinius/api/kernel/common/type'

require_relative 'core/rubinius/api/shims/rubinius'
@@ -31,10 +26,13 @@
require_relative 'core/rubinius/api/shims/enumerator'
require_relative 'core/rubinius/api/shims/undefined'

require_relative 'core/rubinius/kernel/common/undefined'
require_relative 'core/rubinius/kernel/bootstrap/time'

require_relative 'core/rubinius/kernel/common/kernel'
require_relative 'core/rubinius/kernel/common/array'
require_relative 'core/rubinius/kernel/common/struct'
require_relative 'core/rubinius/kernel/common/enumerable'
require_relative 'core/rubinius/kernel/common/undefined'
require_relative 'core/rubinius/kernel/common/time'

require_relative 'core/shims'

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -13,3 +13,5 @@ def self.single_block_arg
end

end

PrimitiveFailures = StandardError
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2011, Evan Phoenix
# Copyright (c) 2007-2014, Evan Phoenix and contributors
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
@@ -9,7 +9,7 @@
# * 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 the Evan Phoenix nor the names of its contributors
# * 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.
#
@@ -24,27 +24,44 @@
# 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.

##
# An array of bytes, used as a low-level data store for implementing various
# other classes.
class Time
# TODO(CS)
#def self.now
# Rubinius.primitive :time_s_now
# raise PrimitiveFailure, "Time.now primitive failed"
#end

class Rubinius::ByteArray
def self.duplicate(other)
Rubinius.primitive :time_s_dup
raise ArgumentError, "descriptors reference invalid time"
end

def self.specific(sec, nsec, from_gmt, offset)
Rubinius.primitive :time_s_specific
raise ArgumentError, "descriptors reference invalid time"
end

def each
i = 0
max = size()
def dup
self.class.duplicate(self)
end

def seconds
Rubinius.primitive :time_seconds
raise PrimitiveFailure, "Time#second primitive failed"
end

while i < max
yield get_byte(i)
i += 1
end
def usec
Rubinius.primitive :time_useconds
raise PrimitiveFailure, "Time#usec primitive failed"
end

def inspect
"#<#{self.class}:0x#{object_id.to_s(16)} #{size} bytes>"
def to_a
Rubinius.primitive :time_decompose
raise PrimitiveFailure, "Time#to_a primitive failed"
end

def <=>(other)
compare_bytes other, size, other.size
def strftime(format)
Rubinius.primitive :time_strftime
raise PrimitiveFailure, "Time#strftime primitive failed"
end
end
500 changes: 500 additions & 0 deletions core/src/main/ruby/jruby/truffle/core/rubinius/kernel/common/time.rb

Large diffs are not rendered by default.