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

Commits on Nov 13, 2014

  1. Copy the full SHA
    1ced631 View commit details
  2. [Truffle] Implement Regexp.new(regexp).

    * Copy and recompile to be sure to have no dependency for now.
    eregon committed Nov 13, 2014
    Copy the full SHA
    709b7b1 View commit details
  3. Copy the full SHA
    f648c7d View commit details
  4. Copy the full SHA
    688a3ad View commit details
39 changes: 37 additions & 2 deletions core/src/main/java/org/jruby/truffle/nodes/core/RegexpNodes.java
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
import com.oracle.truffle.api.source.*;
import com.oracle.truffle.api.dsl.*;
import com.oracle.truffle.api.frame.VirtualFrame;
import org.jruby.runtime.Visibility;
import org.jruby.truffle.nodes.dispatch.DispatchHeadNode;
import org.jruby.truffle.runtime.*;
import org.jruby.truffle.runtime.core.*;
@@ -123,11 +124,45 @@ public InitializeNode(InitializeNode prev) {
}

@Specialization
public RubyNilClass initialize(RubyRegexp regexp, RubyString string) {
public RubyRegexp initialize(RubyRegexp regexp, RubyString string) {
notDesignedForCompilation();

regexp.initialize(this, string.toString());
return getContext().getCoreLibrary().getNilObject();
return regexp;
}

@Specialization
public RubyRegexp initialize(RubyRegexp regexp, RubyRegexp from) {
notDesignedForCompilation();

regexp.initialize(this, from.getSource()); // TODO: is copying needed?
return regexp;
}

}

@CoreMethod(names = "initialize_copy", visibility = Visibility.PRIVATE, required = 1)
public abstract static class InitializeCopyNode extends CoreMethodNode {

public InitializeCopyNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
}

public InitializeCopyNode(InitializeCopyNode prev) {
super(prev);
}

@Specialization
public Object initializeCopy(RubyRegexp self, RubyRegexp from) {
notDesignedForCompilation();

if (self == from) {
return self;
}

self.initialize(this, from.getSource()); // TODO: is copying needed?

return self;
}

}
Original file line number Diff line number Diff line change
@@ -140,10 +140,11 @@ public RubyNode visitRestArgNode(org.jruby.ast.RestArgNode node) {

final RubyNode readNode;

int from = argsNode.getPreCount() + argsNode.getOptionalArgsCount();
if (useArray()) {
readNode = ArrayGetTailNodeFactory.create(context, sourceSection, argsNode.getPreCount(), loadArray(sourceSection));
readNode = ArrayGetTailNodeFactory.create(context, sourceSection, from, loadArray(sourceSection));
} else {
readNode = new ReadRestArgumentNode(context, sourceSection, argsNode.getPreCount());
readNode = new ReadRestArgumentNode(context, sourceSection, from);
}

final FrameSlot slot = methodBodyTranslator.getEnvironment().getFrameDescriptor().findFrameSlot(node.getName());
9 changes: 0 additions & 9 deletions spec/truffle/tags/language/def_tags.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
fails:An instance method with a default argument assigns an empty Array to an unused splat argument
fails:A singleton method definition raises RuntimeError if frozen
fails:A method defined with extreme default arguments may use an fcall as a default
fails:A method defined with extreme default arguments may use preceding arguments as defaults
fails:A singleton method defined with extreme default arguments may use an fcall as a default
fails:A singleton method defined with extreme default arguments may use preceding arguments as defaults
fails:A method definition inside a metaclass scope can create a class method
fails:A method definition inside a metaclass scope can create a singleton method
fails:A method definition inside a metaclass scope raises RuntimeError if frozen
fails:A nested method definition creates an instance method when evaluated in an instance method
fails:A nested method definition creates a class method when evaluated in a class method
fails:A nested method definition creates a singleton method when evaluated in the metaclass of an instance
fails:A method definition inside an instance_eval creates a singleton method
fails:A method definition inside an instance_eval creates a singleton method when evaluated inside a metaclass
fails:A method definition inside an instance_eval creates a class method when the receiver is a class
fails:A method definition in an eval creates an instance method
fails:A method definition in an eval creates a class method
fails:A method definition in an eval creates a singleton method
fails(inherited):The def keyword within a closure looks outside the closure for the visibility
fails:An instance method with a default argument does not evaluate the default when passed a value and a * argument
fails:An instance method with a default argument prefers to assign to a default argument when there are no required arguments
fails:Defining a method returns a symbol of the method name
1 change: 0 additions & 1 deletion spec/truffle/tags/language/lambda_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
fails:->(){} sets parameters appropriately when a combination of parameter types is given between the parenthesis
fails:->(){} uses lambda's 'rigid' argument handling