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

Commits on Apr 25, 2015

  1. Copy the full SHA
    b0ee239 View commit details
  2. 3
    Copy the full SHA
    5fe5742 View commit details
  3. Copy the full SHA
    0e1fd4d View commit details
  4. 2
    Copy the full SHA
    28f9e82 View commit details
2 changes: 1 addition & 1 deletion tool/jt.rb
Original file line number Diff line number Diff line change
@@ -300,7 +300,7 @@ def bench(command, *args)
bench_args = ["-I#{bench_dir}/lib", "#{bench_dir}/bin/bench"]
case command
when 'debug'
env_vars = env_vars.merge({'JRUBY_OPTS' => '-J-G:+TraceTruffleCompilation -J-G:+DumpOnError -J-G:+TruffleCompilationExceptionsAreThrown'})
env_vars = env_vars.merge({'JRUBY_OPTS' => '-J-G:+TraceTruffleCompilation -J-G:+DumpOnError -J-G:+TruffleCompilationExceptionsAreFatal'})
bench_args += ['score', 'jruby-9000-dev-truffle-graal', '--show-commands', '--show-samples']
raise 'specify a single benchmark for run - eg classic-fannkuch-redux' if args.size != 1
when 'reference'
24 changes: 15 additions & 9 deletions truffle/src/main/java/org/jruby/truffle/nodes/RubyNode.java
Original file line number Diff line number Diff line change
@@ -10,6 +10,7 @@
package org.jruby.truffle.nodes;

import com.oracle.truffle.api.CompilerAsserts;
import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.Truffle;
import com.oracle.truffle.api.dsl.TypeSystemReference;
import com.oracle.truffle.api.frame.MaterializedFrame;
@@ -459,10 +460,20 @@ protected Object ruby(VirtualFrame frame, String expression, Object... arguments
}

protected Object rubyWithSelf(VirtualFrame frame, Object self, String expression, Object... arguments) {
notDesignedForCompilation();

final MaterializedFrame evalFrame = setupFrame(RubyArguments.getSelf(frame.getArguments()), arguments);

final RubyBinding binding = new RubyBinding(
getContext().getCoreLibrary().getBindingClass(),
self,
evalFrame);

return getContext().eval(expression, binding, true, "inline-ruby", this);
}

@CompilerDirectives.TruffleBoundary
private MaterializedFrame setupFrame(Object self, Object... arguments) {
final MaterializedFrame evalFrame = Truffle.getRuntime().createMaterializedFrame(
RubyArguments.pack(null, null, RubyArguments.getSelf(frame.getArguments()), null, new Object[]{}));
RubyArguments.pack(null, null,self, null, new Object[]{}));

if (arguments.length % 2 == 1) {
throw new UnsupportedOperationException("odd number of name-value pairs for arguments");
@@ -472,12 +483,7 @@ protected Object rubyWithSelf(VirtualFrame frame, Object self, String expression
evalFrame.setObject(evalFrame.getFrameDescriptor().findOrAddFrameSlot(arguments[n]), arguments[n + 1]);
}

final RubyBinding binding = new RubyBinding(
getContext().getCoreLibrary().getBindingClass(),
self,
evalFrame);

return getContext().eval(ByteList.create(expression), binding, true, "inline-ruby", this);
return evalFrame;
}

protected RubyNilClass nil() {
Original file line number Diff line number Diff line change
@@ -162,8 +162,6 @@ public GetIndexNode(GetIndexNode prev) {

@Specialization(guards = "isNull")
public Object getNull(VirtualFrame frame, RubyHash hash, Object key) {
notDesignedForCompilation();

hashNode.call(frame, key, "hash", null);

if (undefinedValue != null) {
Original file line number Diff line number Diff line change
@@ -62,8 +62,6 @@ public CurrentNode(CurrentNode prev) {

@Specialization
public RubyThread current() {
notDesignedForCompilation();

return getContext().getThreadManager().getCurrentThread();
}

Original file line number Diff line number Diff line change
@@ -235,16 +235,23 @@ public Object instanceEval(ByteList code, Object self, Node currentNode) {
return instanceEval(code, self, "(eval)", currentNode);
}

@TruffleBoundary
public Object eval(String code, RubyBinding binding, boolean ownScopeForAssignments, String filename, Node currentNode) {
return eval(ByteList.create(code), binding, ownScopeForAssignments, filename, currentNode);
}

@TruffleBoundary
public Object eval(ByteList code, RubyBinding binding, boolean ownScopeForAssignments, String filename, Node currentNode) {
final Source source = Source.fromText(code, filename);
return execute(source, code.getEncoding(), TranslatorDriver.ParserContext.EVAL, binding.getSelf(), binding.getFrame(), ownScopeForAssignments, currentNode, NodeWrapper.IDENTITY);
}

@TruffleBoundary
public Object eval(ByteList code, RubyBinding binding, boolean ownScopeForAssignments, Node currentNode) {
return eval(code, binding, ownScopeForAssignments, "(eval)", currentNode);
}

@TruffleBoundary
public Object execute(Source source, Encoding defaultEncoding, TranslatorDriver.ParserContext parserContext, Object self, MaterializedFrame parentFrame, Node currentNode, NodeWrapper wrapper) {
return execute(source, defaultEncoding, parserContext, self, parentFrame, true, currentNode, wrapper);
}