Skip to content

Commit

Permalink
[Truffle] Move primitives into their own file.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisseaton committed Jun 23, 2015
1 parent b3e76ee commit 4be9644
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion truffle/src/main/ruby/core.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,17 @@ def self.omit(reason)

# Patch rubinius-core-api to make it work for us

require_relative 'core/rubinius/api/shims/mirror'
require_relative 'core/rubinius/api/shims/lookuptable'
require_relative 'core/rubinius/api/shims/rubinius'
require_relative 'core/rubinius/api/shims/thread'
require_relative 'core/rubinius/api/shims/tuple'
require_relative 'core/rubinius/api/shims/metrics'
require_relative 'core/rubinius/api/shims/hash'

# Rubinius primitives written in Ruby

require_relative 'core/rubinius/primitives'

# Load alpha.rb

require_relative 'core/rubinius/alpha'
Expand Down
2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/rubinius/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Charles Nutter, et al.

https://github.com/rubinius/rubinius-core-api

`api/shims` is our own code.
`api/shims` and `primitives.rb` is our own code.

We try not to modify files from Rubinius, so that they can easily be merged from
upstream in the future. In some cases there are shims that patch up Rubinius
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# GNU Lesser General Public License version 2.1

module Rubinius
class Mirror
module RubyPrimitives

def self.module_mirror(obj)
if obj.is_a?(::Numeric)
Expand All @@ -30,6 +30,7 @@ def self.module_mirror(obj)
end
end
end

Truffle::Primitive.install_rubinius_primitive self, :module_mirror

end
Expand Down

0 comments on commit 4be9644

Please sign in to comment.