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: ac75e3292923
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: b8b9da1e7a78
Choose a head ref

Commits on Feb 4, 2015

  1. [Truffle] Let CoreLibrary do the error formatting.

    * So callers do not need to know these details.
    eregon committed Feb 4, 2015
    Copy the full SHA
    82b183b View commit details
  2. Copy the full SHA
    955703b View commit details
  3. Copy the full SHA
    96e4133 View commit details
  4. Copy the full SHA
    9da6ed4 View commit details
  5. Copy the full SHA
    dcc29bf View commit details
  6. Copy the full SHA
    8b64d4f View commit details
  7. Copy the full SHA
    75ec034 View commit details
  8. Copy the full SHA
    5e267b6 View commit details
  9. Copy the full SHA
    f83da0a View commit details
  10. [Truffle] Initial implementation of String#gsub! and rewrote String#g…

    …sub in terms of String#gsub.
    nirvdrum committed Feb 4, 2015
    Copy the full SHA
    dfd1a6f View commit details
  11. Copy the full SHA
    9c45d77 View commit details
  12. Copy the full SHA
    d05cd12 View commit details
  13. 2
    Copy the full SHA
    dd523bb View commit details

Commits on Feb 5, 2015

  1. Copy the full SHA
    4ce2eac View commit details
  2. [Truffle] MRI Kernel#gets always includes the trailing '\n'.

    And it's always '\n' regardles of platform.
    nirvdrum committed Feb 5, 2015
    Copy the full SHA
    5df6bce View commit details
  3. [Truffle] Delegate Kernel#trap to Signal#trap.

    * Add a few specilizations (importing Rubinius code is not trivial).
    eregon committed Feb 5, 2015
    Copy the full SHA
    463db3d View commit details
  4. [Truffle] Kernel#to_s and Kernel#inspect are different.

    We should use Rubinius's definition instead of our own, but there are some parts there we don't support yet and I decided to defer working on them.
    nirvdrum committed Feb 5, 2015
    Copy the full SHA
    69fcbdf View commit details
  5. Copy the full SHA
    fb25767 View commit details
  6. Copy the full SHA
    e0a9a31 View commit details
  7. [Truffle] Restored alias from Kernel#inspect to Kernel#to_s.

    This is done solely for bootstrapping purposes.  We override the method with a correct implementation in Ruby.
    nirvdrum committed Feb 5, 2015
    Copy the full SHA
    5347d68 View commit details
  8. Copy the full SHA
    788692a View commit details
  9. Copy the full SHA
    492d599 View commit details
  10. Tag out two flaky tests

    enebo committed Feb 5, 2015
    Copy the full SHA
    bc4baca View commit details
  11. Copy the full SHA
    6de340f View commit details
  12. Copy the full SHA
    b8b9da1 View commit details
Showing with 561 additions and 217 deletions.
  1. +2 −0 lib/pom.rb
  2. +6 −0 lib/pom.xml
  3. +0 −3 spec/truffle/tags/core/array/element_set_tags.txt
  4. +0 −2 spec/truffle/tags/core/array/rindex_tags.txt
  5. +0 −2 spec/truffle/tags/core/kernel/trap_tags.txt
  6. +0 −3 spec/truffle/tags/core/string/chars_tags.txt
  7. +0 −3 spec/truffle/tags/core/string/each_char_tags.txt
  8. +1 −14 spec/truffle/tags/core/string/split_tags.txt
  9. +1 −0 test/mri/excludes/TestHash.rb
  10. +1 −0 test/mri/excludes/TestM17NComb.rb
  11. +86 −0 truffle/src/main/java/org/jruby/truffle/nodes/cast/NumericToFloatNode.java
  12. +2 −1 truffle/src/main/java/org/jruby/truffle/nodes/cast/SingleValueCastNode.java
  13. +1 −5 truffle/src/main/java/org/jruby/truffle/nodes/cast/SplatCastNode.java
  14. +134 −45 truffle/src/main/java/org/jruby/truffle/nodes/core/ArrayNodes.java
  15. +10 −9 truffle/src/main/java/org/jruby/truffle/nodes/core/FiberNodes.java
  16. +24 −24 truffle/src/main/java/org/jruby/truffle/nodes/core/KernelNodes.java
  17. +12 −36 truffle/src/main/java/org/jruby/truffle/nodes/core/MathNodes.java
  18. +30 −0 truffle/src/main/java/org/jruby/truffle/nodes/core/ProcNodes.java
  19. +34 −2 truffle/src/main/java/org/jruby/truffle/nodes/core/SignalNodes.java
  20. +72 −21 truffle/src/main/java/org/jruby/truffle/nodes/core/StringNodes.java
  21. +2 −20 truffle/src/main/java/org/jruby/truffle/nodes/dispatch/CallDispatchHeadNode.java
  22. +5 −13 truffle/src/main/java/org/jruby/truffle/runtime/core/CoreLibrary.java
  23. +43 −12 truffle/src/main/java/org/jruby/truffle/runtime/core/RubyRegexp.java
  24. +1 −1 truffle/src/main/java/org/jruby/truffle/runtime/core/RubyThread.java
  25. +1 −0 truffle/src/main/ruby/jruby/truffle/core.rb
  26. +4 −1 truffle/src/main/ruby/jruby/truffle/core/rubinius/kernel/common/kernel.rb
  27. +44 −0 truffle/src/main/ruby/jruby/truffle/core/rubinius/kernel/common/proc.rb
  28. +10 −0 truffle/src/main/ruby/jruby/truffle/core/rubinius/kernel/common/string.rb
  29. +35 −0 truffle/src/main/ruby/jruby/truffle/core/shims.rb
2 changes: 2 additions & 0 deletions lib/pom.rb
Original file line number Diff line number Diff line change
@@ -87,6 +87,8 @@ def to_pathname
# this is not an artifact for maven central
plugin :deploy, :skip => true

plugin :invoker, :skipInstallation => true

gem 'ruby-maven', '3.1.1.0.8', :scope => :provided

execute :install_gems, :'package' do |ctx|
6 changes: 6 additions & 0 deletions lib/pom.xml
Original file line number Diff line number Diff line change
@@ -123,6 +123,12 @@
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<artifactId>maven-invoker-plugin</artifactId>
<configuration>
<skipInstallation>true</skipInstallation>
</configuration>
</plugin>
<plugin>
<groupId>io.tesla.polyglot</groupId>
<artifactId>tesla-polyglot-maven-plugin</artifactId>
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/array/element_set_tags.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
fails:Array#[]= sets the value of the element at index
fails:Array#[]= sets the section defined by [start,length] to other
fails:Array#[]= replaces the section defined by [start,length] with the given values
fails:Array#[]= just sets the section defined by [start,length] to other even if other is nil
@@ -22,8 +21,6 @@ fails:Array#[]= raises an IndexError when passed indexes out of bounds
fails:Array#[]= calls to_ary on its rhs argument for multi-element sets
fails:Array#[]= does not call to_ary on rhs array subclasses for multi-element sets
fails:Array#[]= raises a RuntimeError on a frozen array
fails:Array#[]= with [index] returns value assigned if idx far beyond right array boundary
fails:Array#[]= with [index] sets the value of the element at index
fails:Array#[]= with [index, count] returns non-array value if non-array value assigned
fails:Array#[]= with [index, count] returns array if array assigned
fails:Array#[]= with [index, count] just sets the section defined by [start,length] to nil even if the rhs is nil
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/array/rindex_tags.txt
Original file line number Diff line number Diff line change
@@ -3,8 +3,6 @@ fails:Array#rindex returns size-1 if last element == to object
fails:Array#rindex returns 0 if only first element == to object
fails:Array#rindex returns nil if no element == to object
fails:Array#rindex returns correct index even after delete_at
fails:Array#rindex properly handles empty recursive arrays
fails:Array#rindex properly handles recursive arrays
fails:Array#rindex accepts a block instead of an argument
fails:Array#rindex ignores the block if there is an argument
fails:Array#rindex rechecks the array size during iteration
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/kernel/trap_tags.txt

This file was deleted.

3 changes: 0 additions & 3 deletions spec/truffle/tags/core/string/chars_tags.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
fails:String#chars passes each char in self to the given block
fails:String#chars returns self
fails:String#chars is unicode aware
fails:String#chars returns characters in the same encoding as self
fails:String#chars works with multibyte characters
fails:String#chars works if the String's contents is invalid for its encoding
fails:String#chars returns a different character if the String is transcoded
fails:String#chars uses the String's encoding to determine what characters it contains
fails:String#chars returns an array when no block given
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/string/each_char_tags.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
fails:String#each_char passes each char in self to the given block
fails:String#each_char returns self
fails:String#each_char is unicode aware
fails:String#each_char returns characters in the same encoding as self
fails:String#each_char works with multibyte characters
fails:String#each_char works if the String's contents is invalid for its encoding
fails:String#each_char returns a different character if the String is transcoded
fails:String#each_char uses the String's encoding to determine what characters it contains
fails:String#each_char returns an enumerator when no block given
15 changes: 1 addition & 14 deletions spec/truffle/tags/core/string/split_tags.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
fails:String#split with String throws an ArgumentError if the pattern is not a valid string
fails:String#split with String splits on multibyte characters
fails:String#split with String returns an array of substrings based on splitting on the given string
fails:String#split with String suppresses trailing empty fields when limit isn't given or 0
fails:String#split with String returns an array with one entry if limit is 1: the original string
fails:String#split with String returns at most limit fields when limit > 1
@@ -10,31 +9,19 @@ fails:String#split with String ignores leading and continuous whitespace when st
fails:String#split with String splits between characters when its argument is an empty string
fails:String#split with String tries converting its pattern argument to a string via to_str
fails:String#split with String tries converting limit to an integer via to_int
fails:String#split with String doesn't set $~
fails:String#split with String returns subclass instances based on self
fails:String#split with String does not call constructor on created subclass instances
fails:String#split with String taints the resulting strings if self is tainted
fails:String#split with Regexp divides self on regexp matches
fails:String#split with Regexp treats negative limits as no limit
fails:String#split with Regexp suppresses trailing empty fields when limit isn't given or 0
fails:String#split with Regexp returns an array with one entry if limit is 1: the original string
fails:String#split with Regexp returns at most limit fields when limit > 1
fails:String#split with Regexp doesn't suppress or limit fields when limit is negative
fails:String#split with Regexp defaults to $; when regexp isn't given or nil
fails:String#split with Regexp splits between characters when regexp matches a zero-length string
fails:String#split with Regexp respects $KCODE when splitting between characters
fails:String#split with Regexp respects the encoding of the regexp when splitting between characters
fails:String#split with Regexp includes all captures in the result array
fails:String#split with Regexp does not include non-matching captures in the result array
fails:String#split with Regexp tries converting limit to an integer via to_int
fails:String#split with Regexp returns a type error if limit can't be converted to an integer
fails:String#split with Regexp doesn't set $~
fails:String#split with Regexp returns the original string if no matches are found
fails:String#split with Regexp returns subclass instances based on self
fails:String#split with Regexp does not call constructor on created subclass instances
fails:String#split with Regexp taints the resulting strings if self is tainted
fails:String#split with Regexp taints an empty string if self is tainted
fails:String#split with Regexp doesn't taints the resulting strings if the Regexp is tainted
fails:String#split with Regexp retains the encoding of the source string
fails:String#split with Regexp splits a string on each character for a multibyte encoding and empty split
fails:String#split with Regexp returns an ArgumentError if an invalid UTF-8 string is supplied
fails:String#split with Regexp doesn't taints the resulting strings if the Regexp is tainted
1 change: 1 addition & 0 deletions test/mri/excludes/TestHash.rb
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
exclude :test_hash_bignum_hash, "needs investigation"
exclude :test_hash2, "[ruby-core:58993] [Bug #9231]"
exclude :test_inverse_hash, "needs investigation"
exclude :test_NEWHASH_fstring_key, "needs investigation"
exclude :test_recursive_hash_value_struct, "needs investigation"
exclude :test_reject, "needs investigation"
exclude :test_shift_none, "needs investigation"
1 change: 1 addition & 0 deletions test/mri/excludes/TestM17NComb.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
exclude :test_str_casecmp, "needs investigation"
exclude :test_str_crypt, "needs investigation"
exclude :test_str_succ, "appears to run forever"
exclude :test_tr_sjis, "needs investigation"
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
/*
* 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.cast;

import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.nodes.core.KernelNodes;
import org.jruby.truffle.nodes.core.KernelNodesFactory;
import org.jruby.truffle.nodes.dispatch.CallDispatchHeadNode;
import org.jruby.truffle.nodes.dispatch.DispatchHeadNodeFactory;
import org.jruby.truffle.nodes.dispatch.MissingBehavior;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.control.RaiseException;
import org.jruby.truffle.runtime.core.RubyBasicObject;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.dsl.Fallback;
import com.oracle.truffle.api.dsl.NodeChild;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.source.SourceSection;

/**
* Casts a value into a Ruby Float (double).
*/
@NodeChild(value = "child", type = RubyNode.class)
public abstract class NumericToFloatNode extends RubyNode {

@Child private KernelNodes.IsANode isANode;
@Child CallDispatchHeadNode toFloatCallNode;

private final String method;

public NumericToFloatNode(RubyContext context, SourceSection sourceSection, String method) {
super(context, sourceSection);
isANode = KernelNodesFactory.IsANodeFactory.create(context, sourceSection, new RubyNode[] { null, null });
this.method = method;
}

public NumericToFloatNode(NumericToFloatNode prev) {
super(prev.getContext(), prev.getSourceSection());
isANode = prev.isANode;
method = prev.method;
}

public abstract double executeFloat(VirtualFrame frame, RubyBasicObject value);

private Object callToFloat(VirtualFrame frame, RubyBasicObject value) {
if (toFloatCallNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
toFloatCallNode = insert(DispatchHeadNodeFactory.createMethodCall(getContext(), MissingBehavior.RETURN_MISSING));
}
return toFloatCallNode.call(frame, value, method, null);
}

@Specialization(guards = "isNumeric")
protected double castNumeric(VirtualFrame frame, RubyBasicObject value) {
final Object result = callToFloat(frame, value);

if (result instanceof Double) {
return (double) result;
} else {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().typeErrorCantConvertTo(
value, getContext().getCoreLibrary().getFloatClass(), method, result, this));
}
}

@Fallback
protected double fallback(Object value) {
CompilerDirectives.transferToInterpreter();
throw new RaiseException(getContext().getCoreLibrary().typeErrorCantConvertInto(
value, getContext().getCoreLibrary().getFloatClass(), this));
}

protected boolean isNumeric(VirtualFrame frame, Object value) {
return isANode.executeIsA(frame, value, getContext().getCoreLibrary().getNumericClass());
}

}
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@
*/
package org.jruby.truffle.nodes.cast;

import com.oracle.truffle.api.frame.VirtualFrame;
import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.core.RubyArray;
@@ -29,7 +30,7 @@ public SingleValueCastNode(SingleValueCastNode prev) {
super(prev);
}

public abstract Object executeSingleValue(Object[] args);
public abstract Object executeSingleValue(VirtualFrame frame, Object[] args);

@Specialization(guards = "noArguments")
protected RubyNilClass castNil(Object[] args) {
Original file line number Diff line number Diff line change
@@ -112,11 +112,7 @@ public RubyArray splat(VirtualFrame frame, Object object) {
return RubyArray.fromObject(getContext().getCoreLibrary().getArrayClass(), object);
} else {
throw new RaiseException(getContext().getCoreLibrary().typeErrorCantConvertTo(
getContext().getCoreLibrary().getLogicalClass(object).getName(),
"Array",
method,
getContext().getCoreLibrary().getLogicalClass(array).getName(),
this)
object, getContext().getCoreLibrary().getArrayClass(), method, array, this)
);
}
}
Loading