Skip to content

Commit

Permalink
Showing 15 changed files with 0 additions and 475 deletions.
7 changes: 0 additions & 7 deletions spec/truffle/specs/truffle/cext/fixtures/foo/ext/foo/add.c

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/specs/truffle/cext/fixtures/foo/ext/foo/add.h

This file was deleted.

11 changes: 0 additions & 11 deletions spec/truffle/specs/truffle/cext/fixtures/foo/ext/foo/extconf.rb

This file was deleted.

8 changes: 0 additions & 8 deletions spec/truffle/specs/truffle/cext/fixtures/foo/ext/foo/foo.c

This file was deleted.

27 changes: 0 additions & 27 deletions spec/truffle/specs/truffle/cext/inline_spec.rb

This file was deleted.

27 changes: 0 additions & 27 deletions spec/truffle/specs/truffle/cext/load_extconf_spec.rb

This file was deleted.

31 changes: 0 additions & 31 deletions spec/truffle/specs/truffle/cext/load_files_spec.rb

This file was deleted.

31 changes: 0 additions & 31 deletions spec/truffle/specs/truffle/cext/load_string_spec.rb

This file was deleted.

17 changes: 0 additions & 17 deletions spec/truffle/specs/truffle/cext/supported_spec.rb

This file was deleted.

33 changes: 0 additions & 33 deletions truffle/src/main/java/org/jruby/truffle/cext/CExtManager.java

This file was deleted.

16 changes: 0 additions & 16 deletions truffle/src/main/java/org/jruby/truffle/cext/CExtSubsystem.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -31,8 +31,6 @@
import org.jruby.RubyGC;
import org.jruby.ext.rbconfig.RbConfigLibrary;
import org.jruby.truffle.RubyContext;
import org.jruby.truffle.cext.CExtManager;
import org.jruby.truffle.cext.CExtSubsystem;
import org.jruby.truffle.core.CoreClass;
import org.jruby.truffle.core.CoreLibrary;
import org.jruby.truffle.core.CoreMethod;
@@ -51,7 +49,6 @@
import org.jruby.truffle.core.rope.RopeOperations;
import org.jruby.truffle.core.string.StringOperations;
import org.jruby.truffle.language.NotProvided;
import org.jruby.truffle.language.RubyGuards;
import org.jruby.truffle.language.RubyRootNode;
import org.jruby.truffle.language.backtrace.BacktraceFormatter;
import org.jruby.truffle.language.control.RaiseException;
@@ -404,64 +401,6 @@ public DynamicObject detach(DynamicObject handle) {

}

@CoreMethod(names = "cext_load", onSingleton = true, needsSelf = false, required = 3)
public abstract static class CExtLoadNode extends CoreMethodArrayArgumentsNode {

public CExtLoadNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@TruffleBoundary
@Specialization(guards = { "isRubyArray(initFunctions)", "isRubyArray(cFlags)", "isRubyArray(files)" })
public boolean cExtLoad(DynamicObject initFunctions, DynamicObject cFlags, DynamicObject files) {
final CExtSubsystem subsystem = CExtManager.getSubsystem();

if (subsystem == null) {
throw new UnsupportedOperationException();
}

subsystem.load(toStrings(initFunctions), toStrings(cFlags), toStrings(files));

return true;
}

private String[] toStrings(DynamicObject array) {
assert RubyGuards.isRubyArray(array);

final String[] strings = new String[Layouts.ARRAY.getSize(array)];

int n = 0;

for (Object object : ArrayOperations.toIterable(array)) {
if (RubyGuards.isRubyString(object) || RubyGuards.isRubySymbol(object)) {
strings[n] = object.toString();
n++;
} else {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(coreLibrary().typeErrorCantConvertInto(object, "String", this));
}
}

return strings;
}

}

@CoreMethod(names = "cext_supported?", needsSelf = false, onSingleton = true)
public abstract static class CExtSupportedNode extends CoreMethodArrayArgumentsNode {

public CExtSupportedNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

@TruffleBoundary
@Specialization
public boolean cExtSupported() {
return CExtManager.getSubsystem() != null;
}

}

@CoreMethod(names = "debug_print", onSingleton = true, required = 1)
public abstract static class DebugPrintNode extends CoreMethodArrayArgumentsNode {

111 changes: 0 additions & 111 deletions truffle/src/main/ruby/core/truffle/cext/cext.rb

This file was deleted.

43 changes: 0 additions & 43 deletions truffle/src/main/ruby/core/truffle/cext/mkmf.rb

This file was deleted.

51 changes: 0 additions & 51 deletions truffle/src/main/ruby/core/truffle/cext/require.rb

This file was deleted.

0 comments on commit d8222ca

Please sign in to comment.