Skip to content

Commit

Permalink
Showing 2 changed files with 4 additions and 21 deletions.
18 changes: 3 additions & 15 deletions truffle/src/main/java/org/jruby/truffle/JRubyTruffleImpl.java
Original file line number Diff line number Diff line change
@@ -11,13 +11,10 @@

import com.oracle.truffle.api.source.Source;
import com.oracle.truffle.api.vm.PolyglotEngine;
import java.io.IOException;

import org.jruby.JRubyTruffleInterface;
import org.jruby.Ruby;
import org.jruby.truffle.interop.JRubyContextWrapper;
import org.jruby.truffle.language.control.ExitException;
import org.jruby.truffle.language.control.JavaException;
import org.jruby.truffle.platform.graal.Graal;
import org.jruby.util.cli.Options;

@@ -32,11 +29,7 @@ public JRubyTruffleImpl(Ruby runtime) {
engine = PolyglotEngine.newBuilder()
.globalSymbol(JRubyTruffleInterface.RUNTIME_SYMBOL, new JRubyContextWrapper(runtime))
.build();
try {
context = (RubyContext) engine.eval(loadSource("Truffle::Boot.context", "context")).get();
} catch (IOException e) {
throw new JavaException(e);
}
context = (RubyContext) engine.eval(loadSource("Truffle::Boot.context", "context")).get();
}

@Override
@@ -51,13 +44,8 @@ public Object execute(org.jruby.ast.RootNode rootNode) {

try {
return engine.eval(loadSource("Truffle::Boot.run_jruby_root", "run_jruby_root")).get();
} catch (IOException e) {
if (e.getCause() instanceof ExitException) {
final ExitException exit = (ExitException) e.getCause();
throw new org.jruby.exceptions.MainExitException(exit.getCode());
}

throw new JavaException(e);
} catch (ExitException e) {
throw new org.jruby.exceptions.MainExitException(e.getCode());
}
}

Original file line number Diff line number Diff line change
@@ -648,12 +648,7 @@ protected CallTarget parse(DynamicObject mimeType, DynamicObject source) {
final String mimeTypeString = mimeType.toString();
final Source sourceObject = Source.newBuilder(source.toString()).name("(eval)").mimeType(mimeTypeString).build();

try {
return getContext().getEnv().parse(sourceObject);
} catch (IOException e) {
CompilerDirectives.transferToInterpreterAndInvalidate();
throw new JavaException(e);
}
return getContext().getEnv().parse(sourceObject);
}

protected int getCacheLimit() {

0 comments on commit dd4076b

Please sign in to comment.