Skip to content

Commit

Permalink
Showing 13 changed files with 28 additions and 29 deletions.
21 changes: 21 additions & 0 deletions core/src/main/java/org/jruby/truffle/nodes/core/ArrayNodes.java
Original file line number Diff line number Diff line change
@@ -230,6 +230,27 @@ public RubyArray subObjectIntegerFixnum(RubyArray a, RubyArray b) {
return new RubyArray(getContext().getCoreLibrary().getArrayClass(), sub, i);
}

@Specialization
public RubyArray sub(RubyArray a, RubyArray b) {
notDesignedForCompilation();

final Object[] as = a.slowToArray();
final Object[] bs = b.slowToArray();

final Object[] sub = new Object[a.getSize()];

int i = 0;

for (int n = 0; n < a.getSize(); n++) {
if (!ArrayUtils.contains(bs, b.getSize(), as[n])) {
sub[i] = as[n];
i++;
}
}

return new RubyArray(getContext().getCoreLibrary().getArrayClass(), sub, i);
}

}

@CoreMethod(names = "*", minArgs = 1, maxArgs = 1, lowerFixnumParameters = 0)
1 change: 0 additions & 1 deletion spec/truffle/tags/language/alias_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
fails:The alias keyword operates on the object's metaclass when used in instance_eval
fails:The alias keyword adds the new method to the list of public methods
1 change: 0 additions & 1 deletion spec/truffle/tags/language/class_tags.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
fails:A class definition allows the declaration of class variables in a class method
fails:An outer class definition contains the inner classes
fails(inherited):A class definition extending an object (sclass) allows accessing the block of the original scope
fails:A class definition extending an object (sclass) can use return to cause the enclosing method to return
fails:Reopening a class adds new methods to subclasses
2 changes: 1 addition & 1 deletion spec/truffle/tags/language/constants_tags.txt
Original file line number Diff line number Diff line change
@@ -29,4 +29,4 @@ fails:Module#public_constant marked constants in a class is defined? with A::B f
fails:Literal (A::X) constant resolution with statically assigned constants searches a module included in the superclass
fails:Constant resolution within methods with statically assigned constants searches a module included in the superclass
fails:Literal (A::X) constant resolution with statically assigned constants searches a module included in the immediate class before the superclass
fails:Constant resolution within methods with statically assigned constants searches a module included in the immediate class before the superclass
fails:Constant resolution within methods with statically assigned constants searches a module included in the immediate class before the superclass
3 changes: 1 addition & 2 deletions spec/truffle/tags/language/metaclass_tags.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
fails:A constant on a metaclass can be accessed via const_get
fails:A constant on a metaclass cannot be accessed via object::CONST
fails:A constant on a metaclass raises a NameError for anonymous_module::CONST
fails(inherited):calling methods on the metaclass calls a method defined on the metaclass of the metaclass
fails:A constant on a metaclass is not preserved when the object is duped
fails:A constant on a metaclass is not defined in the metaclass opener's scope
fails:self in a metaclass body (class << obj) raises a TypeError for numbers
fails:self in a metaclass body (class << obj) raises a TypeError for symbols
fails:A constant on a metaclass is not preserved when the object is duped
2 changes: 0 additions & 2 deletions spec/truffle/tags/language/predefined/data_tags.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
fails(inherited):The DATA constant succeeds in locking the file DATA came from
fails:The DATA constant does not exist when the main script contains no __END__
fails:The DATA constant does not exist when an included file has a __END__
1 change: 0 additions & 1 deletion spec/truffle/tags/language/predefined_tags.txt
Original file line number Diff line number Diff line change
@@ -35,7 +35,6 @@ fails:Global variable $" is read-only
fails:Global variable $< is read-only
fails:Global variable $FILENAME is read-only
fails:Global variable $? is read-only
fails:Global variable $? is thread-local
fails:Global variable $-a is read-only
fails:Global variable $-l is read-only
fails:Global variable $-p is read-only
1 change: 0 additions & 1 deletion spec/truffle/tags/language/proc_tags.txt

This file was deleted.

2 changes: 0 additions & 2 deletions spec/truffle/tags/language/regexp/back-references_tags.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
fails:Regexps with back-references saves match data in the $~ pseudo-global variable
fails:Regexps with back-references saves captures in numbered $[1-9] variables
fails:Regexps with back-references will not clobber capture variables across threads
9 changes: 4 additions & 5 deletions spec/truffle/tags/language/regexp/encoding_tags.txt
Original file line number Diff line number Diff line change
@@ -3,8 +3,6 @@ fails:Regexps with encoding modifiers supports /e (EUC encoding) with interpolat
fails:Regexps with encoding modifiers supports /e (EUC encoding) with interpolation /o
fails:Regexps with encoding modifiers uses EUC-JP as /e encoding
fails:Regexps with encoding modifiers preserves EUC-JP as /e encoding through interpolation
fails:Regexps with encoding modifiers supports /n (No encoding) with interpolation
fails:Regexps with encoding modifiers supports /n (No encoding) with interpolation /o
fails:Regexps with encoding modifiers uses US-ASCII as /n encoding if all chars are 7-bit
fails:Regexps with encoding modifiers uses ASCII-8BIT as /n encoding if not all chars are 7-bit
fails:Regexps with encoding modifiers preserves US-ASCII as /n encoding through interpolation if all chars are 7-bit
@@ -14,8 +12,9 @@ fails:Regexps with encoding modifiers supports /s (Windows_31J encoding) with in
fails:Regexps with encoding modifiers supports /s (Windows_31J encoding) with interpolation and /o
fails:Regexps with encoding modifiers uses Windows-31J as /s encoding
fails:Regexps with encoding modifiers preserves Windows-31J as /s encoding through interpolation
fails:Regexps with encoding modifiers supports /u (UTF8 encoding)
fails:Regexps with encoding modifiers supports /u (UTF8 encoding) with interpolation
fails:Regexps with encoding modifiers supports /u (UTF8 encoding) with interpolation and /o
fails:Regexps with encoding modifiers uses UTF-8 as /u encoding
fails:Regexps with encoding modifiers preserves UTF-8 as /u encoding through interpolation
fails:Regexps with encoding modifiers supports /n (No encoding) with interpolation
fails:Regexps with encoding modifiers supports /n (No encoding) with interpolation /o
fails:Regexps with encoding modifiers supports /u (UTF8 encoding) with interpolation
fails:Regexps with encoding modifiers supports /u (UTF8 encoding) with interpolation and /o
1 change: 0 additions & 1 deletion spec/truffle/tags/language/regexp/interpolation_tags.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
fails:Regexps with interpolation allows interpolation of literal regexps
fails:Regexps with interpolation allows interpolation of any class that responds to to_s
fails:Regexps with interpolation allows interpolation which mixes modifiers
fails:Regexps with interpolation gives precedence to escape sequences over substitution
fails:Regexps with interpolation throws RegexpError for malformed interpolation
5 changes: 0 additions & 5 deletions spec/truffle/tags/language/regexp/modifiers_tags.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
fails:Regexps with modifers supports /m (multiline)
fails:Regexps with modifers supports /x (extended syntax)
fails:Regexps with modifers supports /o (once)
fails:Regexps with modifers invokes substitutions for /o only once
fails:Regexps with modifers supports (?imx-imx) (inline modifiers)
fails:Regexps with modifers supports (?imx-imx:expr) (scoped inline modifiers)
fails:Regexps with modifers supports . with /m
fails(inherited):Regexps with modifers supports ASII/Unicode modifiers
fails:Regexps with modifers raises SyntaxError for ASII/Unicode modifiers
8 changes: 1 addition & 7 deletions spec/truffle/tags/language/singleton_class_tags.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,16 @@
fails:A singleton class is a singleton Class instance
fails:A singleton class inherits from Class for classes
fails:A singleton class is a subclass of Class's singleton class
fails(inherited):A singleton class is a subclass of the same level of Class's singleton class
fails(inherited):A singleton class doesn't have singleton class
fails:A constant on a singleton class can be accessed via const_get
fails:A constant on a singleton class cannot be accessed via object::CONST
fails:A constant on a singleton class raises a NameError for anonymous_module::CONST
fails:Defining instance methods on a singleton class define public methods
fails:Instance methods of a singleton class include ones of the object's class
fails:Instance methods of a singleton class for a class include instance methods of Class
fails:Instance methods of a singleton class for a singleton class includes instance methods of the singleton class of Class
fails:Class methods of a singleton class include ones of the object's class
fails:Class methods of a singleton class for a singleton class include instance methods of the singleton class of Class
fails(inherited):Class methods of a singleton class for a singleton class include class methods of the singleton class of Class
fails:Instantiating a singleton class raises a TypeError when new is called
fails:Instantiating a singleton class raises a TypeError when allocate is called
fails:A constant on a singleton class is not preserved when the object is duped
fails:A constant on a singleton class is not defined in the singleton class opener's scope
fails:A singleton class raises a TypeError for Fixnum's
fails:A singleton class raises a TypeError for symbols
fails:
fails:

0 comments on commit c4ddf94

Please sign in to comment.