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: 5aa73a36c06f
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b73c0faba7ab
Choose a head ref
  • 7 commits
  • 5 files changed
  • 2 contributors

Commits on Jun 14, 2016

  1. Copy the full SHA
    55cef79 View commit details
  2. HEADIUS

    headius committed Jun 14, 2016

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    141c3ab View commit details

Commits on Jun 15, 2016

  1. Copy the full SHA
    ddf6701 View commit details
  2. Copy the full SHA
    03e4f7a View commit details
  3. Copy the full SHA
    9846105 View commit details
  4. Cleanup imports.

    headius committed Jun 15, 2016
    Copy the full SHA
    30a1b71 View commit details
  5. Copy the full SHA
    b73c0fa View commit details
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);
}
2 changes: 0 additions & 2 deletions core/src/main/java/org/jruby/ir/IRBuilder.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package org.jruby.ir;

import javafx.beans.binding.When;
import org.jcodings.specific.ASCIIEncoding;
import org.jcodings.specific.USASCIIEncoding;
import org.jruby.Ruby;
import org.jruby.RubyInstanceConfig;
import org.jruby.ast.*;
import org.jruby.ast.types.ILiteralNode;
import org.jruby.ast.types.INameNode;
import org.jruby.compiler.NotCompilableException;
import org.jruby.lexer.yacc.ISourcePosition;
3 changes: 2 additions & 1 deletion core/src/main/java/org/jruby/ir/targets/JVMVisitor.java
Original file line number Diff line number Diff line change
@@ -1020,7 +1020,8 @@ public void CallInstr(CallInstr callInstr) {
if (callInstr instanceof OneFixnumArgNoBlockCallInstr && MethodIndex.getFastFixnumOpsMethod(callInstr.getName()) != null) {
oneFixnumArgNoBlockCallInstr((OneFixnumArgNoBlockCallInstr) callInstr);
return;
} else if (callInstr instanceof OneFloatArgNoBlockCallInstr) {
} else if (callInstr instanceof OneFloatArgNoBlockCallInstr &&
MethodIndex.getFastFloatOpsMethod(callInstr.getName()) != null) {
oneFloatArgNoBlockCallInstr((OneFloatArgNoBlockCallInstr) callInstr);
return;
}
1 change: 0 additions & 1 deletion core/src/main/ruby/jruby/kernel/kernel.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
module Kernel
module_function
p :here
def require_relative(relative_arg)
relative_arg = relative_arg.to_path if relative_arg.respond_to? :to_path
relative_arg = JRuby::Type.convert_to_str(relative_arg)
18 changes: 16 additions & 2 deletions tool/jt.rb
Original file line number Diff line number Diff line change
@@ -144,6 +144,14 @@ def self.find_repo(name)
end
raise "Can't find the #{name} repo - clone it into the repository directory or its parent"
end

def self.find_benchmark(benchmark)
if File.exist?(File.join(JRUBY_DIR, benchmark))
benchmark
else
File.join(find_repo('all-ruby-benchmarks'), benchmark)
end
end

def self.find_gem(name)
["#{JRUBY_DIR}/lib/ruby/gems/shared/gems"].each do |dir|
@@ -267,7 +275,7 @@ def raw_sh(*args)
continue_on_failure = true
end
if !args.last.is_a?(Hash) || !args.last.delete(:no_print_cmd)
puts "$ #{printable_cmd(args)}"
STDERR.puts "$ #{printable_cmd(args)}"
end
timeout = nil
if args.last.is_a?(Hash)
@@ -942,10 +950,16 @@ def tarball(*options)
end

def benchmark(*args)
benchmark = args.pop
raise 'no benchmark given' unless benchmark
benchmark = Utilities.find_benchmark(benchmark)
raise 'benchmark not found' unless File.exist?(benchmark)
run '--graal',
'-I', "#{Utilities.find_gem('deep-bench')}/lib",
'-I', "#{Utilities.find_gem('benchmark-ips')}/lib",
"#{Utilities.find_gem('benchmark-interface')}/bin/benchmark", *args
"#{Utilities.find_gem('benchmark-interface')}/bin/benchmark",
benchmark,
*args
end

def check_ambiguous_arguments