Skip to content

Commit

Permalink
Showing 65 changed files with 758 additions and 149 deletions.
2 changes: 1 addition & 1 deletion bin/ast
Original file line number Diff line number Diff line change
@@ -193,7 +193,7 @@ def ir_setup(root)

builder = org.jruby.ir.IRBuilder

scope = builder.new(manager).build_root(root)
scope = builder.build_root(manager, root)
passes = manager.get_compiler_passes(scope)
[scope, passes]
end
Empty file modified bin/jruby.bat
100644 → 100755
Empty file.
Empty file modified bin/jruby.dll
100644 → 100755
Empty file.
Empty file modified bin/jruby.exe
100644 → 100755
Empty file.
Empty file modified bin/jrubyd.bat
100644 → 100755
Empty file.
Empty file modified bin/jrubyw.exe
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
@@ -532,7 +532,7 @@
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>pack lib/jruby.jar</id>
<id>create lib/jruby.jar</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
7 changes: 4 additions & 3 deletions core/src/main/java/org/jruby/RubyRegexp.java
Original file line number Diff line number Diff line change
@@ -71,6 +71,7 @@
import org.jruby.util.Sprintf;
import org.jruby.util.StringSupport;
import org.jruby.util.TypeConverter;
import org.jruby.util.cli.Options;
import org.jruby.util.io.EncodingUtils;
import org.jruby.util.collections.WeakValuedMap;

@@ -1248,7 +1249,7 @@ public IRubyObject initialize_m19(IRubyObject arg) {

@JRubyMethod(name = "initialize", visibility = Visibility.PRIVATE)
public IRubyObject initialize_m19(IRubyObject arg0, IRubyObject arg1) {
if (arg0 instanceof RubyRegexp) {
if (arg0 instanceof RubyRegexp && Options.PARSER_WARN_FLAGS_IGNORED.load()) {
getRuntime().getWarnings().warn(ID.REGEXP_IGNORED_FLAGS, "flags ignored");
return initializeByRegexp19((RubyRegexp)arg0);
}
@@ -1259,8 +1260,8 @@ public IRubyObject initialize_m19(IRubyObject arg0, IRubyObject arg1) {

@JRubyMethod(name = "initialize", visibility = Visibility.PRIVATE)
public IRubyObject initialize_m19(IRubyObject arg0, IRubyObject arg1, IRubyObject arg2) {
if (arg0 instanceof RubyRegexp) {
getRuntime().getWarnings().warn(ID.REGEXP_IGNORED_FLAGS, "flags ignored");
if (arg0 instanceof RubyRegexp && Options.PARSER_WARN_FLAGS_IGNORED.load()) {
getRuntime().getWarnings().warn(ID.REGEXP_IGNORED_FLAGS, "flags ignored");
return initializeByRegexp19((RubyRegexp)arg0);
}

1 change: 1 addition & 0 deletions core/src/main/java/org/jruby/ir/IRScope.java
Original file line number Diff line number Diff line change
@@ -239,6 +239,7 @@ public boolean equals(Object other) {
}

protected void addChildScope(IRScope scope) {
if (lexicalChildren == null) lexicalChildren = new ArrayList<>();
lexicalChildren.add(scope);
}

4 changes: 3 additions & 1 deletion core/src/main/java/org/jruby/lexer/yacc/RubyLexer.java
Original file line number Diff line number Diff line change
@@ -819,7 +819,9 @@ private int hereDocumentIdentifier() throws IOException {
}

private void arg_ambiguous() {
if (warnings.isVerbose()) warnings.warning(ID.AMBIGUOUS_ARGUMENT, getPosition(), "Ambiguous first argument; make sure.");
if (warnings.isVerbose() && Options.PARSER_WARN_AMBIGUOUS_ARGUMENTS.load()) {
warnings.warning(ID.AMBIGUOUS_ARGUMENT, getPosition(), "Ambiguous first argument; make sure.");
}
}


2 changes: 2 additions & 0 deletions core/src/main/java/org/jruby/util/cli/Options.java
Original file line number Diff line number Diff line change
@@ -65,6 +65,8 @@ public class Options {
public static final Option<Boolean> PARSER_WARN_LOCAL_SHADOWING = bool(PARSER, "parser.warn.shadowing_local", true, "Warn about shadowing local variables.");
public static final Option<Boolean> PARSER_WARN_REGEX_CONDITION = bool(PARSER, "parser.warn.regex_condition", true, "Warn about regex literals in conditions.");
public static final Option<Boolean> PARSER_WARN_ARGUMENT_PREFIX = bool(PARSER, "parser.warn.argument_prefix", true, "Warn about splat operators being interpreted as argument prefixes.");
public static final Option<Boolean> PARSER_WARN_AMBIGUOUS_ARGUMENTS = bool(PARSER, "parser.warn.ambiguous_argument", true, "Warn about ambiguous arguments.");
public static final Option<Boolean> PARSER_WARN_FLAGS_IGNORED = bool(PARSER, "parser.warn.flags_ignored", true, "Warn about ignored regex flags being ignored.");

public static final Option<CompileMode> COMPILE_MODE = enumeration(COMPILER, "compile.mode", CompileMode.class, CompileMode.JIT, "Set compilation mode. JIT = at runtime; FORCE = before execution.");
public static final Option<Boolean> COMPILE_DUMP = bool(COMPILER, "compile.dump", false, "Dump to console all bytecode generated at runtime.");
1 change: 1 addition & 0 deletions core/src/main/ruby/jruby/truffle/core.rb
Original file line number Diff line number Diff line change
@@ -32,6 +32,7 @@
require_relative 'core/rubinius/kernel/bootstrap/type'

# Load common (ordered according to Rubinius' load_order.txt)
require_relative 'core/rubinius/kernel/common/enumerator'
require_relative 'core/rubinius/kernel/common/enumerable'
require_relative 'core/rubinius/kernel/common/undefined'
require_relative 'core/rubinius/kernel/common/type'
Original file line number Diff line number Diff line change
@@ -12,6 +12,12 @@ def self.mathn_loaded?
false
end

module Fiber

ENABLED = true

end

end

class PrimitiveFailure < StandardError

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions lib/pom.xml
Original file line number Diff line number Diff line change
@@ -22,11 +22,6 @@
<artifactId>jruby-core</artifactId>
<version>9.0.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby-truffle</artifactId>
<version>9.0.0.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>rubygems</groupId>
<artifactId>jruby-openssl</artifactId>
2 changes: 1 addition & 1 deletion maven/jruby-dist/pom.xml
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
<name>JRuby Dist</name>
<properties>
<tesla.dump.readonly>true</tesla.dump.readonly>
<jruby.plugins.version>1.0.7</jruby.plugins.version>
<jruby.plugins.version>1.0.3</jruby.plugins.version>
<main.basedir>${project.parent.parent.basedir}</main.basedir>
<tesla.dump.pom>pom.xml</tesla.dump.pom>
<tesla.version>0.1.1</tesla.version>
7 changes: 1 addition & 6 deletions maven/jruby-jars/pom.xml
Original file line number Diff line number Diff line change
@@ -18,18 +18,12 @@ freezing to) a specific jruby-complete jar version.</description>
<licenses>
<license>
<name>EPL-1.0</name>
<url>http://opensource.org/licenses/EPL-1.0</url>
<comments>Eclipse Public License 1.0</comments>
</license>
<license>
<name>GPL-2.0</name>
<url>http://opensource.org/licenses/GPL-2.0</url>
<comments>GNU General Public License version 2.0</comments>
</license>
<license>
<name>LGPL-2.1</name>
<url>http://opensource.org/licenses/LGPL-2.1</url>
<comments>GNU Library or "Lesser" General Public License version 2.1</comments>
</license>
</licenses>
<developers>
@@ -47,6 +41,7 @@ freezing to) a specific jruby-complete jar version.</description>
<gem.home>${jruby.home}/lib/ruby/gems/shared</gem.home>
<jruby.plugins.version>1.0.7</jruby.plugins.version>
<tesla.dump.pom>pom.xml</tesla.dump.pom>
<project.build.sourceEncoding>utf-8</project.build.sourceEncoding>
<jruby_home>${basedir}/../../</jruby_home>
<tesla.version>0.1.1</tesla.version>
</properties>
Empty file modified spec/mspec/bin/mkspec.bat
100644 → 100755
Empty file.
Empty file modified spec/mspec/bin/mspec-ci.bat
100644 → 100755
Empty file.
Empty file modified spec/mspec/bin/mspec-run.bat
100644 → 100755
Empty file.
Empty file modified spec/mspec/bin/mspec-tag.bat
100644 → 100755
Empty file.
Empty file modified spec/mspec/bin/mspec.bat
100644 → 100755
Empty file.
2 changes: 2 additions & 0 deletions spec/truffle/spec-wrapper
Original file line number Diff line number Diff line change
@@ -9,4 +9,6 @@ bin/jruby -X+T \
-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 "$@"
4 changes: 3 additions & 1 deletion spec/truffle/spec-wrapper.bat
100644 → 100755
Original file line number Diff line number Diff line change
@@ -5,4 +5,6 @@
-Xparser.warn.shadowing_local=false ^
-Xparser.warn.regex_condition=false ^
-Xparser.warn.argument_prefix=false ^
-J-ea -J-Xmx2G %*
-Xparser.warn.ambiguous_argument=false ^
-Xparser.warn.flags_ignored=false ^
-J-ea -J-Xmx2G %*
12 changes: 0 additions & 12 deletions spec/truffle/tags/core/enumerator/each_tags.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1 @@
fails:Enumerator#each yields each element of self to the given block
fails:Enumerator#each calls #each on the object given in the constructor by default
fails:Enumerator#each calls #each on the underlying object until it's exhausted
fails:Enumerator#each calls the method given in the constructor instead of #each
fails:Enumerator#each calls the method given in the constructor until it's exhausted
fails:Enumerator#each raises a NoMethodError if the object doesn't respond to #each
fails:Enumerator#each returns self if not given arguments and not given a block
fails:Enumerator#each returns the same value from receiver.each if block is given
fails:Enumerator#each passes given arguments at initialized to receiver.each
fails:Enumerator#each requires multiple arguments
fails:Enumerator#each appends given arguments to receiver.each
fails:Enumerator#each returns the same value from receiver.each if block and arguments are given
fails:Enumerator#each returns new Enumerator if given arguments but not given a block
5 changes: 0 additions & 5 deletions spec/truffle/tags/core/enumerator/each_with_index_tags.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
fails:Enumerator#each_with_index passes each element and its index to block
fails:Enumerator#each_with_index returns the object being enumerated when given a block
fails:Enumerator#each_with_index binds splat arguments properly
fails:Enumerator#each_with_index returns an enumerator if no block is supplied
fails:Enumerator#each_with_index raises an ArgumentError if passed extra arguments
fails:Enumerator#each_with_index passes on the given block's return value
fails:Enumerator#each_with_index returns the iterator's return value
fails:Enumerator#each_with_index returns the correct value if chained with itself
4 changes: 0 additions & 4 deletions spec/truffle/tags/core/enumerator/each_with_object_tags.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
fails:Enumerator#each_with_object receives an argument
fails:Enumerator#each_with_object with block returns the given object
fails:Enumerator#each_with_object with block the block parameter passes each element to first parameter
fails:Enumerator#each_with_object with block the block parameter passes the given object to last parameter
fails:Enumerator#each_with_object without block returns new Enumerator
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/enumerator/enum_for_tags.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
fails:#enum_for is defined in Kernel
fails:#enum_for returns a new enumerator
fails:#enum_for defaults the first argument to :each
fails:#enum_for exposes multi-arg yields as an array
fails:#enum_for uses the passed block's value to calculate the size of the enumerator
fails:#enum_for defers the evaluation of the passed block until #size is called
1 change: 0 additions & 1 deletion spec/truffle/tags/core/enumerator/enumerator_tags.txt

This file was deleted.

1 change: 0 additions & 1 deletion spec/truffle/tags/core/enumerator/feed_tags.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
fails:Enumerator#feed sets the future return value of yield if called before advancing the iterator
fails:Enumerator#feed causes yield to return the value if called during iteration
fails:Enumerator#feed can be called for each iteration
fails:Enumerator#feed returns nil
fails:Enumerator#feed raises a TypeError if called more than once without advancing the enumerator
fails:Enumerator#feed sets the return value of Yielder#yield
5 changes: 0 additions & 5 deletions spec/truffle/tags/core/enumerator/generator/each_tags.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1 @@
fails:Enumerator::Generator#each is an enumerable
fails:Enumerator::Generator#each supports enumeration with a block
fails:Enumerator::Generator#each raises a LocalJumpError if no block given
fails:Enumerator::Generator#each returns the block returned value
fails:Enumerator::Generator#each requires multiple arguments
fails:Enumerator::Generator#each appends given arguments to receiver.each
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
fails:Enumerator::Generator#initialize is a private method
fails:Enumerator::Generator#initialize returns self when given a block
fails:Enumerator::Generator#initialize on frozen instance raises a RuntimeError
9 changes: 0 additions & 9 deletions spec/truffle/tags/core/enumerator/initialize_tags.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1 @@
fails:Enumerator#initialize is a private method
fails:Enumerator#initialize returns self when given an object
fails:Enumerator#initialize returns self when given a block
fails:Enumerator#initialize accepts a block
fails:Enumerator#initialize sets size to nil if size is not given
fails:Enumerator#initialize sets size to nil if the given size is nil
fails:Enumerator#initialize sets size to the given size if the given size is Float::INFINITY
fails:Enumerator#initialize sets size to the given size if the given size is a Fixnum
fails:Enumerator#initialize sets size to the given size if the given size is a Proc
fails:Enumerator#initialize on frozen instance raises a RuntimeError
12 changes: 0 additions & 12 deletions spec/truffle/tags/core/enumerator/inject_tags.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,2 @@
fails:Enumerator#inject yields each element of self to the given block
fails:Enumerator#inject calls #each on the object given in the constructor by default
fails:Enumerator#inject calls #each on the underlying object until it's exhausted
fails:Enumerator#inject calls the method given in the constructor instead of #each
fails:Enumerator#inject calls the method given in the constructor until it's exhausted
fails:Enumerator#inject raises a NoMethodError if the object doesn't respond to #each
fails:Enumerator#inject returns self if not given arguments and not given a block
fails:Enumerator#inject returns the same value from receiver.each if block is given
fails:Enumerator#inject passes given arguments at initialized to receiver.each
fails:Enumerator#inject requires multiple arguments
fails:Enumerator#inject appends given arguments to receiver.each
fails:Enumerator#inject returns the same value from receiver.each if block and arguments are given
fails:Enumerator#inject returns new Enumerator if given arguments but not given a block
fails:Enumerator#inject works when chained against each_with_index
1 change: 0 additions & 1 deletion spec/truffle/tags/core/enumerator/inspect_tags.txt

This file was deleted.

2 changes: 0 additions & 2 deletions spec/truffle/tags/core/enumerator/lazy/initialize_tags.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
fails:Enumerator::Lazy#initialize is a private method
fails:Enumerator::Lazy#initialize returns self
fails:Enumerator::Lazy#initialize sets nil to size if not given a size
fails:Enumerator::Lazy#initialize sets nil to size if given size is nil
fails:Enumerator::Lazy#initialize sets given size to own size if the given size is Float::INFINITY
fails:Enumerator::Lazy#initialize sets given size to own size if the given size is a Fixnum
fails:Enumerator::Lazy#initialize sets given size to own size if the given size is a Proc
fails:Enumerator::Lazy#initialize raises an ArgumentError when block is not given
fails:Enumerator::Lazy#initialize when the returned lazy enumerator is evaluated by Enumerable#first stops after specified times
fails:Enumerator::Lazy#initialize on frozen instance raises a RuntimeError
1 change: 0 additions & 1 deletion spec/truffle/tags/core/enumerator/lazy/lazy_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
fails:Enumerator::Lazy is a subclass of Enumerator
fails:Enumerator::Lazy#lazy returns self
6 changes: 0 additions & 6 deletions spec/truffle/tags/core/enumerator/new_tags.txt

This file was deleted.

3 changes: 0 additions & 3 deletions spec/truffle/tags/core/enumerator/rewind_tags.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
fails:Enumerator#rewind resets the enumerator to its initial state
fails:Enumerator#rewind returns self
fails:Enumerator#rewind has no effect on a new enumerator
fails:Enumerator#rewind has no effect if called multiple, consecutive times
fails:Enumerator#rewind works with peek to reset the position
fails:Enumerator#rewind calls the enclosed object's rewind method if one exists
fails:Enumerator#rewind does nothing if the object doesn't have a #rewind method
fails:Enumerator#rewind clears a pending #feed value
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/enumerator/size_tags.txt

This file was deleted.

3 changes: 0 additions & 3 deletions spec/truffle/tags/core/enumerator/to_enum_tags.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
fails:#to_enum is defined in Kernel
fails:#to_enum returns a new enumerator
fails:#to_enum defaults the first argument to :each
fails:#to_enum exposes multi-arg yields as an array
fails:#to_enum uses the passed block's value to calculate the size of the enumerator
fails:#to_enum defers the evaluation of the passed block until #size is called
13 changes: 0 additions & 13 deletions spec/truffle/tags/core/enumerator/with_index_tags.txt

This file was deleted.

4 changes: 0 additions & 4 deletions spec/truffle/tags/core/enumerator/with_object_tags.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
fails:Enumerator#with_object receives an argument
fails:Enumerator#with_object with block returns the given object
fails:Enumerator#with_object with block the block parameter passes each element to first parameter
fails:Enumerator#with_object with block the block parameter passes the given object to last parameter
fails:Enumerator#with_object without block returns new Enumerator
3 changes: 0 additions & 3 deletions spec/truffle/tags/core/enumerator/yielder/append_tags.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
fails:Enumerator::Yielder#<< yields the value to the block
fails:Enumerator::Yielder#<< returns self
fails:Enumerator::Yielder#<< requires multiple arguments
fails:Enumerator::Yielder#<< yields with passed arguments
2 changes: 0 additions & 2 deletions spec/truffle/tags/core/enumerator/yielder/initialize_tags.txt

This file was deleted.

2 changes: 0 additions & 2 deletions spec/truffle/tags/core/enumerator/yielder/yield_tags.txt

This file was deleted.

1 change: 1 addition & 0 deletions spec/truffle/tags/core/struct/to_s_tags.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fails(windows bug):Struct#to_s is a synonym for inspect
1 change: 1 addition & 0 deletions spec/truffle/tags/core/time/wday_tags.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fails:Time#wday returns an integer representing the day of the week, 0..6, with Sunday being 0
3 changes: 3 additions & 0 deletions spec/truffle/tags/language/break_tags.txt
Original file line number Diff line number Diff line change
@@ -7,3 +7,6 @@ fails:Executing break from within a block returns from the original invoking met
slow:The break statement in a lambda created at the toplevel returns a value when invoking from a method
slow:The break statement in a lambda created at the toplevel returns a value when invoking from a block
slow:The break statement in a lambda created at the toplevel returns a value when invoking from the toplevel
fails(windows bug):The break statement in a lambda created at the toplevel returns a value when invoking from the toplevel
fails(windows bug):The break statement in a lambda created at the toplevel returns a value when invoking from a method
fails(windows bug):The break statement in a lambda created at the toplevel returns a value when invoking from a block
2 changes: 2 additions & 0 deletions spec/truffle/tags/language/file_tags.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
fails(windows bug):The __FILE__ pseudo-variable equals the absolute path of a file loaded by an absolute path
fails(windows bug):The __FILE__ pseudo-variable equals the absolute path of a file loaded by a relative path
5 changes: 5 additions & 0 deletions spec/truffle/tags/language/predefined/data_tags.txt
Original file line number Diff line number Diff line change
@@ -4,3 +4,8 @@ slow:The DATA constant does not exist when the main script contains no __END__
slow:The DATA constant does not exist when an included file has a __END__
slow:The DATA constant does not change when an included files also has a __END__
slow:The DATA constant is included in an otherwise empty file
fails(windows bug):The DATA constant exists when the main script contains __END__
fails(windows bug):The DATA constant does not exist when the main script contains no __END__
fails(windows bug):The DATA constant does not exist when an included file has a __END__
fails(windows bug):The DATA constant does not change when an included files also has a __END__
fails(windows bug):The DATA constant is included in an otherwise empty file
5 changes: 5 additions & 0 deletions spec/truffle/tags/language/predefined_tags.txt
Original file line number Diff line number Diff line change
@@ -4,3 +4,8 @@ slow:The predefined global constant STDERR has the encodings set by #set_encodin
slow:The predefined global constant STDIN retains the encoding set by #set_encoding when Encoding.default_external is changed
slow:The predefined global constant STDIN has the encodings set by #set_encoding
slow:The predefined global constant STDOUT has the encodings set by #set_encoding
fails(windows bug):Execution variable $: does not include '.' when the taint check level > 1
fails(windows bug):The predefined global constant STDIN has the encodings set by #set_encoding
fails(windows bug):The predefined global constant STDIN retains the encoding set by #set_encoding when Encoding.default_external is changed
fails(windows bug):The predefined global constant STDOUT has the encodings set by #set_encoding
fails(windows bug):The predefined global constant STDERR has the encodings set by #set_encoding
26 changes: 25 additions & 1 deletion spec/truffle/truffle.mspec
Original file line number Diff line number Diff line change
@@ -42,6 +42,7 @@ class MSpecScript
"^spec/ruby/core/marshal/float_spec.rb",
"^spec/ruby/core/marshal/load_spec.rb",
"^spec/ruby/core/marshal/restore_spec.rb",
"^spec/ruby/core/method/source_location_spec.rb", # Windows
"^spec/ruby/core/numeric/denominator_spec.rb",
"^spec/ruby/core/numeric/numerator_spec.rb",
"^spec/ruby/core/numeric/to_c_spec.rb",
@@ -58,7 +59,30 @@ class MSpecScript
"^spec/ruby/core/string/crypt_spec.rb",
"^spec/ruby/core/string/gsub_spec.rb",
"^spec/ruby/core/string/match_spec.rb",
"^spec/ruby/core/string/modulo_spec.rb"
"^spec/ruby/core/string/modulo_spec.rb",
"^spec/ruby/core/struct/each_spec.rb", # Windows
"^spec/ruby/core/struct/element_reference_spec.rb", # Windows
"^spec/ruby/core/struct/element_set_spec.rb", # Windows
"^spec/ruby/core/struct/eql_spec.rb", # Windows
"^spec/ruby/core/struct/equal_value_spec.rb", # Windows
"^spec/ruby/core/struct/hash_spec.rb", # Windows
"^spec/ruby/core/struct/initialize_copy_spec.rb", # Windows
"^spec/ruby/core/struct/initialize_spec.rb", # Windows
"^spec/ruby/core/struct/inspect_spec.rb", # Windows
"^spec/ruby/core/struct/instance_variables_spec.rb", # Windows
"^spec/ruby/core/struct/length_spec.rb", # Windows
"^spec/ruby/core/struct/members_spec.rb", # Windows
"^spec/ruby/core/struct/new_spec.rb", # Windows
"^spec/ruby/core/struct/select_spec.rb", # Windows
"^spec/ruby/core/struct/size_spec.rb", # Windows
"^spec/ruby/core/struct/struct_spec.rb", # Windows
"^spec/ruby/core/struct/to_a_spec.rb", # Windows
"^spec/ruby/core/struct/to_h_spec.rb", # Windows
"^spec/ruby/core/struct/to_s_spec.rb", # Windows
"^spec/ruby/core/struct/values_at_spec.rb", # Windows
"^spec/ruby/core/struct/values_spec.rb", # Windows
"^spec/ruby/core/symbol/versions/encoding_1.9_spec.rb", # Windows
"^spec/ruby/core/unboundmethod/source_location_spec.rb" # Windows
]

set :rubysl, [
12 changes: 12 additions & 0 deletions test/pom.rb
Original file line number Diff line number Diff line change
@@ -235,6 +235,8 @@
'<arg value="-Xparser.warn.shadowing_local=false" />' +
'<arg value="-Xparser.warn.regex_condition=false" />' +
'<arg value="-Xparser.warn.argument_prefix=false" />' +
'<arg value="-Xparser.warn.ambiguous_argument=false" />' +
'<arg value="-Xparser.warn.flags_ignored=false" />' +
'<arg value="-J-ea" />' +
'<arg value="-J-Xmx1G" />' +
'<arg value="spec/mspec/bin/mspec" />' +
@@ -258,6 +260,10 @@
#'<arg value="-T" />' +
#'<arg value="-Xparser.warn.argument_prefix=false" />' +
#'<arg value="-T" />' +
#'<arg value="-Xparser.warn.ambiguous_argument=false" />' +
#'<arg value="-T" />' +
#'<arg value="-Xparser.warn.flags_ignored=false" />' +
#'<arg value="-T" />' +
#'<arg value="-J-ea" />' +
'<arg value="--config" />' +
'<arg value="spec/truffle/truffle.mspec" />' +
@@ -286,6 +292,8 @@
'<arg value="-Xparser.warn.shadowing_local=false" />' +
'<arg value="-Xparser.warn.regex_condition=false" />' +
'<arg value="-Xparser.warn.argument_prefix=false" />' +
'<arg value="-Xparser.warn.ambiguous_argument=false" />' +
'<arg value="-Xparser.warn.flags_ignored=false" />' +
'<arg value="-J-ea" />' +
'<arg value="-J-Xmx1G" />' +
'<arg value="spec/mspec/bin/mspec" />' +
@@ -309,6 +317,10 @@
#'<arg value="-T" />' +
#'<arg value="-Xparser.warn.argument_prefix=false" />' +
#'<arg value="-T" />' +
#'<arg value="-Xparser.warn.ambiguous_argument=false" />' +
#'<arg value="-T" />' +
#'<arg value="-Xparser.warn.flags_ignored=false" />' +
#'<arg value="-T" />' +
#'<arg value="-J-ea" />' +
'<arg value="--config" />' +
'<arg value="spec/truffle/truffle.mspec" />' +
11 changes: 4 additions & 7 deletions test/pom.xml
Original file line number Diff line number Diff line change
@@ -34,19 +34,12 @@
<version>2.0.7</version>
<scope>test</scope>
</dependency>
<!-- FIXME: only depend on lib, ideally -->
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby-core</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jruby</groupId>
<artifactId>jruby-truffle</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
@@ -731,6 +724,8 @@
<arg value="-Xparser.warn.shadowing_local=false" />
<arg value="-Xparser.warn.regex_condition=false" />
<arg value="-Xparser.warn.argument_prefix=false" />
<arg value="-Xparser.warn.ambiguous_argument=false" />
<arg value="-Xparser.warn.flags_ignored=false" />
<arg value="-J-ea" />
<arg value="-J-Xmx1G" />
<arg value="spec/mspec/bin/mspec" />
@@ -774,6 +769,8 @@
<arg value="-Xparser.warn.shadowing_local=false" />
<arg value="-Xparser.warn.regex_condition=false" />
<arg value="-Xparser.warn.argument_prefix=false" />
<arg value="-Xparser.warn.ambiguous_argument=false" />
<arg value="-Xparser.warn.flags_ignored=false" />
<arg value="-J-ea" />
<arg value="-J-Xmx1G" />
<arg value="spec/mspec/bin/mspec" />
2 changes: 1 addition & 1 deletion truffle/pom.xml
Original file line number Diff line number Diff line change
@@ -76,7 +76,7 @@
<artifactId>maven-shade-plugin</artifactId>
<executions>
<execution>
<id>pack lib/jruby-truffle.jar</id>
<id>create lib/jruby-truffle.jar</id>
<phase>package</phase>
<goals>
<goal>shade</goal>
35 changes: 20 additions & 15 deletions truffle/src/main/java/org/jruby/truffle/nodes/core/ArrayNodes.java
Original file line number Diff line number Diff line change
@@ -1420,7 +1420,7 @@ public Object eachIntegerFixnum(VirtualFrame frame, RubyArray array, RubyProc bl
}
} finally {
if (CompilerDirectives.inInterpreter()) {
((RubyRootNode) getRootNode()).reportLoopCount(count);
getRootNode().reportLoopCount(count);
}
}

@@ -1457,7 +1457,7 @@ public Object eachLongFixnum(VirtualFrame frame, RubyArray array, RubyProc block
}
} finally {
if (CompilerDirectives.inInterpreter()) {
((RubyRootNode) getRootNode()).reportLoopCount(count);
getRootNode().reportLoopCount(count);
}
}

@@ -1494,7 +1494,7 @@ public Object eachFloat(VirtualFrame frame, RubyArray array, RubyProc block) {
}
} finally {
if (CompilerDirectives.inInterpreter()) {
((RubyRootNode) getRootNode()).reportLoopCount(count);
getRootNode().reportLoopCount(count);
}
}

@@ -1531,7 +1531,7 @@ public Object eachObject(VirtualFrame frame, RubyArray array, RubyProc block) {
}
} finally {
if (CompilerDirectives.inInterpreter()) {
((RubyRootNode) getRootNode()).reportLoopCount(count);
getRootNode().reportLoopCount(count);
}
}

@@ -1591,7 +1591,7 @@ public Object eachWithIndexObject(VirtualFrame frame, RubyArray array, RubyProc
}
} finally {
if (CompilerDirectives.inInterpreter()) {
((RubyRootNode) getRootNode()).reportLoopCount(count);
getRootNode().reportLoopCount(count);
}
}

@@ -2084,7 +2084,7 @@ public Object injectObject(VirtualFrame frame, RubyArray array, Object initial,
}
} finally {
if (CompilerDirectives.inInterpreter()) {
((RubyRootNode) getRootNode()).reportLoopCount(count);
getRootNode().reportLoopCount(count);
}
}

@@ -2328,7 +2328,7 @@ public RubyArray mapIntegerFixnum(VirtualFrame frame, RubyArray array, RubyProc
}
} finally {
if (CompilerDirectives.inInterpreter()) {
((RubyRootNode) getRootNode()).reportLoopCount(count);
getRootNode().reportLoopCount(count);
}
}

@@ -2353,7 +2353,7 @@ public RubyArray mapLongFixnum(VirtualFrame frame, RubyArray array, RubyProc blo
}
} finally {
if (CompilerDirectives.inInterpreter()) {
((RubyRootNode) getRootNode()).reportLoopCount(count);
getRootNode().reportLoopCount(count);
}
}

@@ -2403,7 +2403,7 @@ public RubyArray mapObject(VirtualFrame frame, RubyArray array, RubyProc block)
}
} finally {
if (CompilerDirectives.inInterpreter()) {
((RubyRootNode) getRootNode()).reportLoopCount(count);
getRootNode().reportLoopCount(count);
}
}

@@ -2427,6 +2427,11 @@ public MapInPlaceNode(MapInPlaceNode prev) {
arrayBuilder = prev.arrayBuilder;
}

@Specialization(guards = "isNull")
public RubyArray mapInPlaceNull(RubyArray array, RubyProc block) {
return array;
}

@Specialization(guards = "isIntegerFixnum")
public RubyArray mapInPlaceFixnumInteger(VirtualFrame frame, RubyArray array, RubyProc block) {
final int[] store = (int[]) array.getStore();
@@ -2445,7 +2450,7 @@ public RubyArray mapInPlaceFixnumInteger(VirtualFrame frame, RubyArray array, Ru
}
} finally {
if (CompilerDirectives.inInterpreter()) {
((RubyRootNode) getRootNode()).reportLoopCount(count);
getRootNode().reportLoopCount(count);
}
}

@@ -2472,7 +2477,7 @@ public RubyArray mapInPlaceObject(VirtualFrame frame, RubyArray array, RubyProc
}
} finally {
if (CompilerDirectives.inInterpreter()) {
((RubyRootNode) getRootNode()).reportLoopCount(count);
getRootNode().reportLoopCount(count);
}
}

@@ -3228,7 +3233,7 @@ public Object selectObject(VirtualFrame frame, RubyArray array, RubyProc block)
}
} finally {
if (CompilerDirectives.inInterpreter()) {
((RubyRootNode) getRootNode()).reportLoopCount(count);
getRootNode().reportLoopCount(count);
}
}

@@ -3261,7 +3266,7 @@ public Object selectFixnumInteger(VirtualFrame frame, RubyArray array, RubyProc
}
} finally {
if (CompilerDirectives.inInterpreter()) {
((RubyRootNode) getRootNode()).reportLoopCount(count);
getRootNode().reportLoopCount(count);
}
}

@@ -3411,7 +3416,7 @@ public Object selectObject(VirtualFrame frame, RubyArray array, RubyProc block)
}
} finally {
if (CompilerDirectives.inInterpreter()) {
((RubyRootNode) getRootNode()).reportLoopCount(count);
getRootNode().reportLoopCount(count);
}
}

@@ -3444,7 +3449,7 @@ public Object selectFixnumInteger(VirtualFrame frame, RubyArray array, RubyProc
}
} finally {
if (CompilerDirectives.inInterpreter()) {
((RubyRootNode) getRootNode()).reportLoopCount(count);
getRootNode().reportLoopCount(count);
}
}

20 changes: 20 additions & 0 deletions truffle/src/main/java/org/jruby/truffle/nodes/core/FileNodes.java
Original file line number Diff line number Diff line change
@@ -52,6 +52,26 @@ public RubyString absolutePath(RubyString path) {

}

@CoreMethod(names = "basename", onSingleton = true, required = 1)
public abstract static class BasenameNode extends CoreMethodNode {

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

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

@Specialization
public RubyString basename(RubyString path) {
notDesignedForCompilation();

return getContext().makeString(new File(path.toString()).getName());
}

}

@CoreMethod(names = "close")
public abstract static class CloseNode extends CoreMethodNode {

Original file line number Diff line number Diff line change
@@ -573,7 +573,7 @@ public RubyHash eachPackedArray(VirtualFrame frame, RubyHash hash, RubyProc bloc
}
} finally {
if (CompilerDirectives.inInterpreter()) {
((RubyRootNode) getRootNode()).reportLoopCount(count);
getRootNode().reportLoopCount(count);
}
}

@@ -897,7 +897,7 @@ public RubyArray mapPackedArray(VirtualFrame frame, RubyHash hash, RubyProc bloc
}
} finally {
if (CompilerDirectives.inInterpreter()) {
((RubyRootNode) getRootNode()).reportLoopCount(count);
getRootNode().reportLoopCount(count);
}
}

Original file line number Diff line number Diff line change
@@ -12,7 +12,9 @@
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.source.SourceSection;

import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.UndefinedPlaceholder;
import org.jruby.truffle.runtime.core.RubyArray;
import org.jruby.truffle.runtime.core.RubyFile;
import org.jruby.truffle.runtime.core.RubyProc;
@@ -40,6 +42,13 @@ public OpenNode(OpenNode prev) {
super(prev);
}

@Specialization
public Object open(VirtualFrame frame, RubyString fileName, RubyString mode, UndefinedPlaceholder block) {
notDesignedForCompilation();

return RubyFile.open(getContext(), fileName.toString(), mode.toString());
}

@Specialization
public Object open(VirtualFrame frame, RubyString fileName, RubyString mode, RubyProc block) {
notDesignedForCompilation();
Original file line number Diff line number Diff line change
@@ -545,6 +545,14 @@ public Object eval(VirtualFrame frame, RubyString source, UndefinedPlaceholder b
return eval(source, getCallerBinding(frame), filename, lineNumber);
}

@Specialization
public Object eval(VirtualFrame frame, RubyString source, RubyNilClass noBinding, RubyString filename, int lineNumber) {
notDesignedForCompilation();

// TODO (nirvdrum Dec. 29, 2014) Do something with the supplied filename.
return eval(frame, source, UndefinedPlaceholder.INSTANCE, UndefinedPlaceholder.INSTANCE, UndefinedPlaceholder.INSTANCE);
}

@Specialization
public Object eval(RubyString source, RubyBinding binding, UndefinedPlaceholder filename, UndefinedPlaceholder lineNumber) {
notDesignedForCompilation();
Original file line number Diff line number Diff line change
@@ -14,6 +14,7 @@
import com.oracle.truffle.api.Truffle;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.nodes.Node.Child;
import com.oracle.truffle.api.source.Source;
import com.oracle.truffle.api.source.SourceSection;

@@ -24,6 +25,7 @@
import org.jruby.truffle.nodes.cast.BooleanCastNode;
import org.jruby.truffle.nodes.cast.BooleanCastNodeFactory;
import org.jruby.truffle.nodes.control.SequenceNode;
import org.jruby.truffle.nodes.core.KernelNodes.BindingNode;
import org.jruby.truffle.nodes.dispatch.*;
import org.jruby.truffle.nodes.methods.SetMethodDeclarationContext;
import org.jruby.truffle.nodes.methods.arguments.CheckArityNode;
@@ -384,6 +386,7 @@ public static void attrAccessor(RubyNode currentNode, RubyContext context, Sourc
public abstract static class ClassEvalNode extends CoreMethodNode {

@Child private YieldDispatchHeadNode yield;
@Child private BindingNode bindingNode;

public ClassEvalNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
@@ -395,6 +398,14 @@ public ClassEvalNode(ClassEvalNode prev) {
yield = prev.yield;
}

protected RubyBinding getCallerBinding(VirtualFrame frame) {
if (bindingNode == null) {
CompilerDirectives.transferToInterpreterAndInvalidate();
bindingNode = insert(KernelNodesFactory.BindingNodeFactory.create(getContext(), getSourceSection(), new RubyNode[] {}));
}
return bindingNode.executeRubyBinding(frame);
}

@Specialization
public Object classEval(VirtualFrame frame, RubyModule module, RubyString code, @SuppressWarnings("unused") UndefinedPlaceholder file, @SuppressWarnings("unused") UndefinedPlaceholder line, @SuppressWarnings("unused") UndefinedPlaceholder block) {
notDesignedForCompilation();
@@ -420,7 +431,9 @@ public Object classEval(VirtualFrame frame, RubyModule module, RubyString code,
}

private Object classEvalSource(VirtualFrame frame, RubyModule module, Source source, Encoding encoding) {
return getContext().execute(getContext(), source, encoding, TranslatorDriver.ParserContext.MODULE, module, frame.materialize(), this, new NodeWrapper() {
RubyBinding binding = getCallerBinding(frame);

return getContext().execute(getContext(), source, encoding, TranslatorDriver.ParserContext.MODULE, module, binding.getFrame(), this, new NodeWrapper() {
@Override
public RubyNode wrap(RubyNode node) {
return new SetMethodDeclarationContext(node.getContext(), node.getSourceSection(), "class_eval", node);
Original file line number Diff line number Diff line change
@@ -124,7 +124,7 @@ public RubyArray collect(VirtualFrame frame, RubyRange.IntegerFixnumRange range,
}
} finally {
if (CompilerDirectives.inInterpreter()) {
((RubyRootNode) getRootNode()).reportLoopCount(count);
getRootNode().reportLoopCount(count);
}
}

@@ -178,7 +178,7 @@ public Object each(VirtualFrame frame, RubyRange.IntegerFixnumRange range, RubyP
}
} finally {
if (CompilerDirectives.inInterpreter()) {
((RubyRootNode) getRootNode()).reportLoopCount(count);
getRootNode().reportLoopCount(count);
}
}

@@ -342,7 +342,7 @@ public Object step(VirtualFrame frame, RubyRange.IntegerFixnumRange range, int s
}
} finally {
if (CompilerDirectives.inInterpreter()) {
((RubyRootNode) getRootNode()).reportLoopCount(count);
getRootNode().reportLoopCount(count);
}
}

Original file line number Diff line number Diff line change
@@ -27,6 +27,7 @@
import org.jruby.truffle.runtime.core.RubyString;
import org.jruby.truffle.runtime.core.RubySymbol;
import org.jruby.util.ByteList;
import org.jruby.util.cli.Options;

import static org.jruby.util.StringSupport.CR_7BIT;

@@ -249,7 +250,9 @@ public RubyRegexp initialize(RubyRegexp regexp, RubyRegexp from, @SuppressWarnin
public RubyRegexp initialize(RubyRegexp regexp, RubyRegexp from, @SuppressWarnings("unused") Object options) {
notDesignedForCompilation();

getContext().getWarnings().warn("flags ignored");
if (Options.PARSER_WARN_FLAGS_IGNORED.load()) {
getContext().getWarnings().warn("flags ignored");
}

return initialize(regexp, from, UndefinedPlaceholder.INSTANCE);
}
Original file line number Diff line number Diff line change
@@ -196,8 +196,6 @@ public static interface ObjectGraphVisitor {
public Map<Long, RubyBasicObject> collectLiveObjects() {
RubyNode.notDesignedForCompilation();

// TODO(CS): probably a race condition here if multiple threads try to collect at the same time

liveObjects = new HashMap<>();

visitor = new ObjectGraphVisitor() {

0 comments on commit 6ee6976

Please sign in to comment.