Skip to content

Commit

Permalink
Showing 1 changed file with 16 additions and 21 deletions.
37 changes: 16 additions & 21 deletions core/src/main/java/org/jruby/Ruby.java
Original file line number Diff line number Diff line change
@@ -727,22 +727,10 @@ private RootNode addGetsLoop(RootNode oldRoot, boolean printing, boolean process
*
* @param scriptNode The root node of the script to be executed
* bytecode before execution
* @param wrap whether to wrap the execution in an anonymous module
* @return The result of executing the script
*/
@Deprecated
public IRubyObject runNormally(Node scriptNode, boolean unused) {
return runNormally(scriptNode);
}

/**
* Run the specified script without any of the loop-processing wrapper
* code.
*
* @param scriptNode The root node of the script to be executed
* bytecode before execution
* @return The result of executing the script
*/
public IRubyObject runNormally(Node scriptNode) {
public IRubyObject runNormally(Node scriptNode, boolean wrap) {
ScriptAndCode scriptAndCode = null;
boolean compile = getInstanceConfig().getCompileMode().shouldPrecompileCLI();
if (compile || config.isShowBytecode()) {
@@ -757,7 +745,7 @@ public IRubyObject runNormally(Node scriptNode) {
return getNil();
}

return runScript(scriptAndCode.script());
return runScript(scriptAndCode.script(), wrap);
} else {
// FIXME: temporarily allowing JIT to fail for $0 and fall back on interpreter
// failForcedCompile(scriptNode);
@@ -766,6 +754,18 @@ public IRubyObject runNormally(Node scriptNode) {
}
}

/**
* Run the specified script without any of the loop-processing wrapper
* code.
*
* @param scriptNode The root node of the script to be executed
* bytecode before execution
* @return The result of executing the script
*/
public IRubyObject runNormally(Node scriptNode) {
return runNormally(scriptNode, false);
}

private ScriptAndCode precompileCLI(RootNode scriptNode) {
ScriptAndCode scriptAndCode = null;

@@ -3025,12 +3025,7 @@ public void compileAndLoadFile(String filename, InputStream in, boolean wrap) {
try {
context.setFileAndLine(scriptNode.getFile(), scriptNode.getLine());

if (config.isAssumePrinting() || config.isAssumeLoop()) {
runWithGetsLoop(scriptNode, config.isAssumePrinting(), config.isProcessLineEnds(),
config.isSplit());
} else {
runNormally(scriptNode);
}
runNormally(scriptNode, wrap);
} finally {
context.setFileAndLine(oldFile, oldLine);
}

0 comments on commit 55cef79

Please sign in to comment.