Skip to content

Commit

Permalink
Showing 8 changed files with 19 additions and 20 deletions.
6 changes: 4 additions & 2 deletions test/truffle/compiler/pe/interop/interop_pe.rb
Original file line number Diff line number Diff line change
@@ -15,5 +15,7 @@ def initialize(value)
end
end

example "Truffle::Interop.read(InteropPE::A.new(42), :@foo)", 42
example "Truffle::Interop.read(InteropPE::A.new(42), '@foo')", 42

# The Truffle API's these use are different from GraalVM 0.12 and Truffle 0.13
tagged example "Truffle::Interop.read(InteropPE::A.new(42), :@foo)", 42
tagged example "Truffle::Interop.read(InteropPE::A.new(42), '@foo')", 42
3 changes: 2 additions & 1 deletion test/truffle/compiler/pe/interop/js.rb
Original file line number Diff line number Diff line change
@@ -6,4 +6,5 @@
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

main_thread example "Truffle::Interop.eval('application/javascript', '14 + 2')", 16
# The Truffle API's this uses are different from GraalVM 0.12 and Truffle 0.13
tagged main_thread example "Truffle::Interop.eval('application/javascript', '14 + 2')", 16
3 changes: 2 additions & 1 deletion test/truffle/compiler/pe/interop/r.rb
Original file line number Diff line number Diff line change
@@ -6,4 +6,5 @@
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

main_thread example "Truffle::Interop.eval('application/x-r', '14 + 2')", 16.0
# Either R's eval or R expressions in general do not PE yet
tagged main_thread example "Truffle::Interop.eval('application/x-r', '14 + 2')", 16.0
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ public Object execute(org.jruby.ast.RootNode rootNode) {
"See https://github.com/jruby/jruby/wiki/Truffle-FAQ#how-do-i-get-jrubytruffle");
}

context.setInitialJRubyRootNode(rootNode);
context.getJRubyInterop().setOriginalInputFile(rootNode.getPosition().getFile());

try {
return engine.eval(Source.fromText("Truffle::Boot.run_jruby_root", "run_jruby_root")
9 changes: 0 additions & 9 deletions truffle/src/main/java/org/jruby/truffle/RubyContext.java
Original file line number Diff line number Diff line change
@@ -94,7 +94,6 @@ public class RubyContext extends ExecutionContext {

private final Object classVariableDefinitionLock = new Object();

private org.jruby.ast.RootNode initialJRubyRootNode;
private final AttachmentsManager attachmentsManager;

public RubyContext(Ruby jrubyRuntime, TruffleLanguage.Env env) {
@@ -223,14 +222,6 @@ public void shutdown() {
}
}

public void setInitialJRubyRootNode(org.jruby.ast.RootNode initialJRubyRootNode) {
this.initialJRubyRootNode = initialJRubyRootNode;
}

public org.jruby.ast.RootNode getInitialJRubyRootNode() {
return initialJRubyRootNode;
}

public Options getOptions() {
return options;
}
Original file line number Diff line number Diff line change
@@ -23,6 +23,8 @@ public class JRubyInterop {

private RubyContext context;

private String originalInputFile;

public JRubyInterop(RubyContext context) {
this.context = context;
}
@@ -83,4 +85,11 @@ public void setVerboseNil() {
context.getJRubyRuntime().setVerbose(context.getJRubyRuntime().getNil());
}

public void setOriginalInputFile(String originalInputFile) {
this.originalInputFile = originalInputFile;
}

public String getOriginalInputFile() {
return originalInputFile;
}
}
Original file line number Diff line number Diff line change
@@ -106,7 +106,7 @@ public Object runJRubyRootNode(VirtualFrame frame, @Cached("create()")IndirectCa
StringOperations.createString(getContext(),
ByteList.create(getContext().getJRubyInterop().getArg0())));

String inputFile = getContext().getInitialJRubyRootNode().getPosition().getFile();
String inputFile = getContext().getJRubyInterop().getOriginalInputFile();

final Source source;

5 changes: 0 additions & 5 deletions truffle/src/test/java/org/jruby/truffle/tck/RubyTckTest.java
Original file line number Diff line number Diff line change
@@ -123,11 +123,6 @@ protected String valuesObject() {
return "values_object";
}

@Override
protected String addToArray() {
return "add_array";
}

@Override
public void testCoExistanceOfMultipleLanguageInstances() throws Exception {
/*

0 comments on commit 12fa3c9

Please sign in to comment.