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

Commits on Apr 25, 2016

  1. [Truffle] use single assert

    pitr-ch committed Apr 25, 2016
    1
    Copy the full SHA
    1fde05b View commit details
  2. 1
    Copy the full SHA
    d7cb4b6 View commit details
Showing with 11 additions and 7 deletions.
  1. +6 −2 lib/ruby/truffle/jruby+truffle/lib/runner.rb
  2. +5 −5 truffle/src/main/java/org/jruby/truffle/language/SnippetNode.java
8 changes: 6 additions & 2 deletions lib/ruby/truffle/jruby+truffle/lib/runner.rb
Original file line number Diff line number Diff line change
@@ -138,7 +138,9 @@ module OptionBlocks
load_path: ['-I', '--load-path LOAD_PATH', 'Paths to add to load path, same as Ruby\'s -I', ADD_TO_ARRAY, []],
executable: ['-S', '--executable NAME', 'finds and runs an executable of a gem', STORE_NEW_VALUE, nil],
jexception: ['--jexception', 'print Java exceptions', STORE_NEW_VALUE, false],
environment: ['--environment NAME,VALUE', Array, 'Set environment variables', MERGE_TO_HASH, {}]
environment: ['--environment NAME,VALUE', Array, 'Set environment variables', MERGE_TO_HASH, {}],
xmx: ['--xmx SIZE', 'Max memory size', STORE_NEW_VALUE, '2G'],
no_asserts: ['--no-asserts', 'Disable asserts -ea -esa', STORE_NEW_NEGATED_VALUE, false]
},
ci: {
batch: ['--batch FILE', 'Run batch of ci tests supplied in a file. One ci command options per line. If FILE is in or stdin it reads from $stdin.',
@@ -457,7 +459,9 @@ def subcommand_run(rest)
puts "Core load path: #{core_load_path} does not exist, fallbacking to --no-use-fs-core" if missing_core_load_path

truffle_options = [
('-X+T'),
'-X+T',
"-J-Xmx#{@options[:run][:xmx]}",
*(%w[-J-ea -J-esa] unless @options[:run][:no_asserts]),
("-Xtruffle.core.load_path=#{core_load_path}" if @options[:global][:use_fs_core] && !missing_core_load_path),
('-Xtruffle.exceptions.print_java=true' if @options[:run][:jexception])
]
Original file line number Diff line number Diff line change
@@ -82,7 +82,7 @@ public Object execute(VirtualFrame frame, String expression, Object... arguments
"number of arguments doesn't match number of parameters");
}

ensureConstantExpressionParameters(expression, arguments);
assert ensureConstantExpressionParameters(expression, arguments);

final Object[] callArguments = RubyArguments.pack(
parentFrame(frame, arguments),
@@ -97,12 +97,12 @@ public Object execute(VirtualFrame frame, String expression, Object... arguments
return directCallNode.call(frame, callArguments);
}

@ExplodeLoop
private void ensureConstantExpressionParameters(String expression, Object[] arguments) {
assert this.expression == expression;
private boolean ensureConstantExpressionParameters(String expression, Object[] arguments) {
boolean test = this.expression == expression;
for (int n = 0; n < parameters.length; n++) {
assert parameters[n] == arguments[2 * n];
test = test && parameters[n] == arguments[2 * n];
}
return test;
}

@ExplodeLoop