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

Commits on May 20, 2016

  1. Copy the full SHA
    13c5cc5 View commit details
  2. 3
    Copy the full SHA
    025812e View commit details
  3. Copy the full SHA
    171f512 View commit details
Showing with 30 additions and 35 deletions.
  1. +2 −3 truffle/src/main/java/org/jruby/truffle/language/loader/FeatureLoader.java
  2. +28 −32 truffle/src/main/ruby/core/truffle/cext.rb
Original file line number Diff line number Diff line change
@@ -237,9 +237,8 @@ private boolean doRequire(
break;

default:
throw new RaiseException(
context.getCoreExceptions().internalError(
"unknown language " + expandedPath,
throw new RaiseException(context.getCoreExceptions().internalError(
"unknown language " + mimeType + " for " + expandedPath,
callNode));
}

60 changes: 28 additions & 32 deletions truffle/src/main/ruby/core/truffle/cext.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Copyright (c) 2015, 2016 Oracle and/or its affiliates. All rights reserved. This
# code is released under a tri EPL/GPL/LGPL license. You can use it,
# redistribute it and/or modify it under the terms of the:
#
#
# Eclipse Public License version 1.0
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1
@@ -13,126 +13,122 @@ module CExt
def supported?
Interop.mime_type_supported?('application/x-sulong-library')
end

def Qfalse
false
end

def Qtrue
true
end

def Qnil
nil
end

def rb_cObject
Object
end

def rb_cArray
Array
end

def rb_cHash
Hash
end

def rb_eRuntimeError
raise 'not implemented'
end

def FIXNUM_P(value)
value.is_a?(Fixnum)
end

def rb_float_new(value)
value.to_f
end

def RSTRING_PTR(string)
string
end

def rb_intern
raise 'not implemented'
end

def rb_str_new2(string)
string
end

def rb_intern_str(string)
string.intern
end

def ID2SYM(id)
id
end

def rb_str_cat(string, to_concat, length)
raise 'not implemented'
end

def RARRAY_PTR(array)
array
end

def rb_ary_new_capa(capacity)
[]
end

def rb_ary_new2
[]
end

def rb_ary_new
[]
end

def rb_hash_new
{}
end

def rb_scan_args
raise 'not implemented'
end

def rb_raise(object, name)
raise 'not implemented'
end

def rb_define_class(name, superclass)
#raise 'not implemented'

# Return nil instead of raising an exception so the C API specs get far enough along to tag them.
# This implementation is clearly not correct.
nil
Object.const_set(name, Class.new(superclass))
end

def rb_define_module(name)
Object.const_set(name, Module.new)
end

def rb_define_module_under(mod, name)
mod.const_set(name, Module.new)
end

def rb_define_method(mod, name, function, args)
mod.send(:define_method, name) do |*args|
function.call(self, *args)
end
end

def rb_define_private_method(mod, name, function, args)
rb_define_method mod, name, function, args
mod.send :private, name
end

def rb_define_module_function(mod, name, function, args)
rb_define_method mod, name, function, args
mod.send :module_function, name
end

end
end