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

Commits on Feb 25, 2015

  1. Copy the full SHA
    9223b1d View commit details
  2. Copy the full SHA
    b175b48 View commit details
  3. Copy the full SHA
    d775b55 View commit details
  4. Copy the full SHA
    1dbc53d View commit details
  5. 2
    Copy the full SHA
    d5bc11e View commit details
8 changes: 0 additions & 8 deletions spec/truffle/spec-wrapper
Original file line number Diff line number Diff line change
@@ -3,12 +3,4 @@
# Workaround for RubySpec #292

bin/jruby -X+T \
-Xparser.warn.useless_use_of=false \
-Xparser.warn.not_reached=false \
-Xparser.warn.grouped_expressions=false \
-Xparser.warn.shadowing_local=false \
-Xparser.warn.regex_condition=false \
-Xparser.warn.argument_prefix=false \
-Xparser.warn.ambiguous_argument=false \
-Xparser.warn.flags_ignored=false \
-J-ea -J-Xmx2G "$@"
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright (c) 2015 Oracle and/or its affiliates. All rights reserved. This
* code is released under a tri EPL/GPL/LGPL license. You can use it,
* redistribute it and/or modify it under the terms of the:
*
* Eclipse Public License version 1.0
* GNU General Public License version 2
* GNU Lesser General Public License version 2.1
*/
package org.jruby.truffle.nodes.globals;

import org.jruby.runtime.builtin.IRubyObject;
import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.runtime.RubyContext;

import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.source.SourceSection;

public class UpdateVerbosityNode extends RubyNode {

@Child private RubyNode child;

public UpdateVerbosityNode(RubyContext context, SourceSection sourceSection, RubyNode child) {
super(context, sourceSection);
this.child = child;
}

public Object execute(VirtualFrame frame) {
notDesignedForCompilation();

final Object childValue = child.execute(frame);

final IRubyObject jrubyValue = getContext().toJRuby(childValue);

getContext().getRuntime().setVerbose(jrubyValue);

return childValue;
}

}
Original file line number Diff line number Diff line change
@@ -206,7 +206,7 @@ public RubySymbol newSymbol(ByteList name) {
@TruffleBoundary
public Object instanceEval(ByteList code, Object self, String filename, RubyNode currentNode) {
final Source source = Source.fromText(code, filename);
return execute(this, source, code.getEncoding(), TranslatorDriver.ParserContext.TOP_LEVEL, self, null, currentNode, new NodeWrapper() {
return execute(this, source, code.getEncoding(), TranslatorDriver.ParserContext.EVAL, self, null, currentNode, new NodeWrapper() {
@Override
public RubyNode wrap(RubyNode node) {
return new SetMethodDeclarationContext(node.getContext(), node.getSourceSection(), Visibility.PUBLIC, "instance_eval", node);
@@ -221,7 +221,7 @@ public Object instanceEval(ByteList code, Object self, RubyNode currentNode) {
@TruffleBoundary
public Object eval(ByteList code, RubyBinding binding, boolean ownScopeForAssignments, String filename, RubyNode currentNode) {
final Source source = Source.fromText(code, filename);
return execute(this, source, code.getEncoding(), TranslatorDriver.ParserContext.TOP_LEVEL, binding.getSelf(), binding.getFrame(), ownScopeForAssignments, currentNode, NodeWrapper.IDENTITY);
return execute(this, source, code.getEncoding(), TranslatorDriver.ParserContext.EVAL, binding.getSelf(), binding.getFrame(), ownScopeForAssignments, currentNode, NodeWrapper.IDENTITY);
}

public Object eval(ByteList code, RubyBinding binding, boolean ownScopeForAssignments, RubyNode currentNode) {
Original file line number Diff line number Diff line change
@@ -77,7 +77,6 @@ public class BodyTranslator extends Translator {

protected final BodyTranslator parent;
protected final TranslatorEnvironment environment;
private final boolean topLevel;

public boolean translatingForStatement = false;
public boolean useClassVariablesAsIfInClass = false;
@@ -105,7 +104,6 @@ public BodyTranslator(RubyNode currentNode, RubyContext context, BodyTranslator
super(currentNode, context, source);
this.parent = parent;
this.environment = environment;
this.topLevel = topLevel;
initGlobalVariableAliases();
initReadOnlyGlobalVariables();
}
@@ -1037,7 +1035,7 @@ public RubyNode visitDefnNode(org.jruby.ast.DefnNode node) {
final SourceSection sourceSection = translate(node.getPosition());
final RubyNode classNode;

if (topLevel) {
if (parent == null) {
/*
* In the top-level, methods are defined in the class of the main object. This is
* counter-intuitive - I would have expected them to be defined in the singleton class.
@@ -1343,6 +1341,10 @@ public RubyNode visitGlobalAsgnNode(org.jruby.ast.GlobalAsgnNode node) {
rhs = new CheckOutputSeparatorVariableTypeNode(context, sourceSection, rhs);
} else if (name.equals("$_")) {
rhs = WrapInThreadLocalNodeFactory.create(context, sourceSection, rhs);
} else if (name.equals("$stdout")) {
rhs = new CheckStdoutVariableTypeNode(context, sourceSection, rhs);
} else if (name.equals("$VERBOSE")) {
rhs = new UpdateVerbosityNode(context, sourceSection, rhs);
}

if (readOnlyGlobalVariables.contains(name)) {
@@ -1378,9 +1380,6 @@ public RubyNode visitGlobalAsgnNode(org.jruby.ast.GlobalAsgnNode node) {

return ((ReadNode) localVarNode).makeWriteNode(rhs);
} else {
if (name.equals("$stdout")) {
rhs = new CheckStdoutVariableTypeNode(context, sourceSection, rhs);
}
final ObjectLiteralNode globalVariablesObjectNode = new ObjectLiteralNode(context, sourceSection, context.getCoreLibrary().getGlobalVariablesObject());
return new WriteInstanceVariableNode(context, sourceSection, name, globalVariablesObjectNode, rhs, true);

Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@
public class TranslatorDriver {

public static enum ParserContext {
TOP_LEVEL, SHELL, MODULE
TOP_LEVEL, SHELL, MODULE, EVAL
}

private long nextReturnID = 0;
6 changes: 3 additions & 3 deletions truffle/src/main/ruby/core/rubinius/common/enumerator.rb
Original file line number Diff line number Diff line change
@@ -213,7 +213,7 @@ def initialize(&block)
private :initialize

def yield(*args)
@proc.call *args
@proc.call(*args)
end

def <<(*args)
@@ -235,7 +235,7 @@ def initialize(&block)
private :initialize

def each(*args)
enclosed_yield = Proc.new { |*enclosed_args| yield *enclosed_args }
enclosed_yield = Proc.new { |*enclosed_args| yield(*enclosed_args) }

@proc.call Yielder.new(&enclosed_yield), *args
end
@@ -494,7 +494,7 @@ def reset
@fiber = Rubinius::Fiber.new(0) do
obj = @object
@result = obj.each do |*val|
Rubinius::Fiber.yield *val
Rubinius::Fiber.yield(*val)
end
@done = true
end
2 changes: 1 addition & 1 deletion truffle/src/main/ruby/core/rubinius/common/float.rb
Original file line number Diff line number Diff line change
@@ -82,7 +82,7 @@ def denominator
alias_method :modulo, :%

def finite?
not (nan? or infinite?)
not(nan? or infinite?)
end

def rationalize(eps=undefined)
10 changes: 5 additions & 5 deletions truffle/src/main/ruby/core/rubinius/common/regexp.rb
Original file line number Diff line number Diff line change
@@ -66,14 +66,14 @@ def self.union(*patterns)
when 0
return %r/(?!)/
when 1
pat = patterns.first
case pat
pattern = patterns.first
case pattern
when Array
return union(*pat)
return union(*pattern)
when Regexp
return pat
return pattern
else
return Regexp.new(Regexp.quote(StringValue(pat)))
return Regexp.new(Regexp.quote(StringValue(pattern)))
end
else
compatible?(*patterns)