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: fcc8afc9e817
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: ec5b7a375d64
Choose a head ref
  • 18 commits
  • 29 files changed
  • 4 contributors

Commits on Jan 28, 2015

  1. Copy the full SHA
    a88eb46 View commit details

Commits on Jan 29, 2015

  1. Copy the full SHA
    028697a View commit details
  2. Copy the full SHA
    4ddbaaa View commit details
  3. Copy the full SHA
    3ab35b1 View commit details
  4. Copy the full SHA
    a939cef View commit details
  5. Reformat code properly.

    headius committed Jan 29, 2015
    Copy the full SHA
    0e20c3d View commit details
  6. Fix BC self-first-classloader tests.

    System properties are often loaded only once, as is the case for
    this value loaded into a static field of RubyInstanceConfig. This
    fix sets the mode in the container's config, removes the static
    field (just go directly to the Option), and provides get/set
    on ScriptingContainer.
    headius committed Jan 29, 2015
    Copy the full SHA
    9b4d8e9 View commit details
  7. Copy the full SHA
    d70d45e View commit details
  8. Copy the full SHA
    ec4d2af View commit details
  9. MSpec: do not add a tag if there is already one with the same tag and…

    … description.
    
    * So adding comments do not provoke duplication of tags with `mspec tag`.
    * Reuse existing logic to read tags.
    eregon committed Jan 29, 2015
    Copy the full SHA
    86c8313 View commit details
  10. [Truffle] JT: use system since it works better on windows.

    * Improve message on failure.
    eregon committed Jan 29, 2015
    Copy the full SHA
    783c9b2 View commit details
  11. Copy the full SHA
    6c5dfd6 View commit details
  12. Copy the full SHA
    2c73464 View commit details
  13. [Truffle] Reorganize imports.

    eregon committed Jan 29, 2015
    Copy the full SHA
    42db50f View commit details
  14. Copy the full SHA
    ac26614 View commit details
  15. Copy the full SHA
    b3bfc9d View commit details
  16. Copy the full SHA
    12ed071 View commit details
  17. Merge branch 'master' into truffle-head

    Conflicts:
    	truffle/src/main/java/org/jruby/truffle/runtime/core/RubyBasicObject.java
    chrisseaton committed Jan 29, 2015
    Copy the full SHA
    ec5b7a3 View commit details
Showing with 154 additions and 58 deletions.
  1. +1 −0 .travis.yml
  2. +1 −2 core/src/main/java/org/jruby/RubyInstanceConfig.java
  3. +27 −0 core/src/main/java/org/jruby/embed/ScriptingContainer.java
  4. +1 −0 core/src/main/java/org/jruby/util/cli/Options.java
  5. +6 −0 core/src/main/ruby/jruby/truffle/core/shims.rb
  6. +7 −6 ...by-complete/src/it/bouncycastle-with-bc-gem/src/test/java/org/jruby/its/BouncyCastleTestCase.java
  7. +6 −5 maven/jruby-complete/src/it/bouncycastle/src/test/java/org/jruby/its/BouncyCastleTestCase.java
  8. +6 −5 maven/jruby/src/it/bouncycastle-with-bc-gem/src/test/java/org/jruby/its/BouncyCastleTestCase.java
  9. +8 −7 maven/jruby/src/it/bouncycastle/src/test/java/org/jruby/its/BouncyCastleTestCase.java
  10. +9 −8 spec/mspec/lib/mspec/runner/mspec.rb
  11. +1 −0 spec/truffle/tags/core/class/inherited_tags.txt
  12. +1 −0 spec/truffle/tags/core/encoding/dummy_tags.txt
  13. +1 −0 spec/truffle/tags/core/encoding/find_tags.txt
  14. +1 −2 spec/truffle/tags/core/env/has_value_tags.txt
  15. +1 −2 spec/truffle/tags/core/env/value_tags.txt
  16. +4 −0 spec/truffle/tags/core/io/close_on_exec_tags.txt
  17. +2 −0 spec/truffle/tags/core/io/read_tags.txt
  18. +2 −0 spec/truffle/tags/core/io/readlines_tags.txt
  19. +2 −0 spec/truffle/tags/core/io/write_tags.txt
  20. +2 −1 spec/truffle/tags/core/kernel/eval_tags.txt
  21. +4 −0 spec/truffle/tags/core/kernel/fork_tags.txt
  22. +2 −0 spec/truffle/tags/core/kernel/spawn_tags.txt
  23. +7 −0 test/pom.xml
  24. +9 −3 tool/jt.rb
  25. +4 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/DirNodes.java
  26. +8 −0 truffle/src/main/java/org/jruby/truffle/nodes/core/TrufflePrimitiveNodes.java
  27. +6 −2 truffle/src/main/java/org/jruby/truffle/runtime/RubyContext.java
  28. +10 −0 truffle/src/main/java/org/jruby/truffle/runtime/core/RubyClass.java
  29. +15 −14 truffle/src/main/java/org/jruby/truffle/runtime/subsystems/ObjectSpaceManager.java
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -70,6 +70,7 @@ matrix:
- env: PHASE='-Prake -Dtask=spec:jrubyc'
- env: PHASE='-Prake -Dtask=spec:profiler'
- env: COMMAND=tool/truffle-findbugs.sh
- env: PHASE='-Pmain'

branches:
only:
3 changes: 1 addition & 2 deletions core/src/main/java/org/jruby/RubyInstanceConfig.java
Original file line number Diff line number Diff line change
@@ -1494,7 +1494,7 @@ public void setProfilingService( String service ) {
* Whether native code is enabled for this configuration.
*/
private boolean _nativeEnabled = NATIVE_ENABLED;
private boolean _selfFirstClassLoader = SELF_FIRST_CLASS_LOADER;
private boolean _selfFirstClassLoader = Options.SELF_FIRST_CLASS_LOADER.load();

private TraceType traceType =
TraceType.traceTypeFor(Options.BACKTRACE_STYLE.load());
@@ -1697,7 +1697,6 @@ public boolean shouldPrecompileAll() {
* Set with the <tt>jruby.native.enabled</tt> system property.
*/
public static final boolean NATIVE_ENABLED = Options.NATIVE_ENABLED.load();
public static final boolean SELF_FIRST_CLASS_LOADER = Options.SELF_FIRST_CLASS_LOADER.load();

@Deprecated
public final static boolean CEXT_ENABLED = false;
27 changes: 27 additions & 0 deletions core/src/main/java/org/jruby/embed/ScriptingContainer.java
Original file line number Diff line number Diff line change
@@ -1858,4 +1858,31 @@ public void finalize() throws Throwable {
// singleton containers share global runtime, and should not tear it down
if (scope != LocalContextScope.SINGLETON) terminate();
}

/**
* Force dynamically-loaded Java classes to load first from the classloader provided by
* JRuby before searching parent classloaders. This can be used to isolated dependency
* in different runtimes from each other and from parent classloaders. The default
* behavior is to defer to parent classloaders if they can provide the requested
* classes.
*
* Note that if different versions of a library are loaded by both a parent
* classloader and the JRuby classloader, those classess would be incompatible
* with each other and with other library objects from the opposing classloader.
*
* @param selfFirstClassloader set whether prefer the JRuby classloader when dynamically loading classes
* @since JRuby 9.0.0.0
*/
public void setSelfFirstClassloader(boolean selfFirstClassloader) {
getProvider().getRubyInstanceConfig().setSelfFirstClassLoader(selfFirstClassloader);
}

/**
* Retrieve the self-first classloader setting.
*
* @see ScriptingContainer#setSelfFirstClassloader(boolean)
*/
public boolean getSelfFirstClassloader() {
return getProvider().getRubyInstanceConfig().isSelfFirstClassLoader();
}
}
1 change: 1 addition & 0 deletions core/src/main/java/org/jruby/util/cli/Options.java
Original file line number Diff line number Diff line change
@@ -156,6 +156,7 @@ public class Options {
public static final Option<String> TRUFFLE_TRANSLATOR_PRINT_PARSE_TREE = string(TRUFFLE, "truffle.translator.print_parse_trees", "", "Comma delimited list of method names to print the JRuby parse tree of before translation.");
public static final Option<Integer> TRUFFLE_PASSALOT = integer(TRUFFLE, "truffle.passalot", 0, "Probabilty between 0 and 100 to randomly insert Thread.pass at a given line.");
public static final Option<Integer> TRUFFLE_STACK_SERVER_PORT = integer(TRUFFLE, "truffle.stack_server_port", 0, "Port number to run an HTTP server on that returns stack traces");
public static final Option<Boolean> TRUFFLE_COVERAGE = bool(TRUFFLE, "truffle.coverage", false, "Enable coverage (will be enabled by default in the future - currently has some bugs");

public static final Option<Boolean> NATIVE_ENABLED = bool(NATIVE, "native.enabled", true, "Enable/disable native code, including POSIX features and C exts.");
public static final Option<Boolean> NATIVE_VERBOSE = bool(NATIVE, "native.verbose", false, "Enable verbose logging of native extension loading.");
6 changes: 6 additions & 0 deletions core/src/main/ruby/jruby/truffle/core/shims.rb
Original file line number Diff line number Diff line change
@@ -119,6 +119,12 @@ def each_value
end
end

def value?(value)
values.any? { |v| v == value }
end

alias_method :has_value?, :value?

end

class Regexp
Original file line number Diff line number Diff line change
@@ -11,23 +11,24 @@
import org.jruby.embed.ScriptingContainer;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.*;

public class BouncyCastleTestCase {

@Test
public void java(){
assertEquals( "BouncyCastle Security Provider v1.47", new BouncyCastleProvider().getInfo() );
public void java() {
assertEquals("BouncyCastle Security Provider v1.47", new BouncyCastleProvider().getInfo());
}

@Test
public void ruby(){
System.setProperty( "jruby.self.first.class.loader", "true" );
public void ruby() {
ScriptingContainer container = new ScriptingContainer();
container.setSelfFirstClassloader(true);
Object result = container.parse( "gem 'bouncy-castle-java', '1.5.0146.1'; require 'bouncy-castle-java'; Java::OrgBouncycastleJceProvider::BouncyCastleProvider.new.info").run();
assertEquals( "BouncyCastle Security Provider v1.46", result.toString() );

result = container.parse( "JRuby.runtime.jruby_class_loader").run();
assertEquals( "org.jruby.util.SelfFirstJRubyClassLoader", result.toString().replaceFirst( "@.*$", "" ) );
result = container.parse("JRuby.runtime.jruby_class_loader").run();
assertEquals("org.jruby.util.SelfFirstJRubyClassLoader", result.toString().replaceFirst("@.*$", ""));
}
}
Original file line number Diff line number Diff line change
@@ -5,22 +5,23 @@
import org.bouncycastle.jce.provider.BouncyCastleProvider;
import org.jruby.embed.ScriptingContainer;
import org.junit.Test;

import static org.junit.Assert.*;

public class BouncyCastleTestCase {
@Test
public void java(){
assertEquals( "BouncyCastle Security Provider v1.47", new BouncyCastleProvider().getInfo() );
public void java() {
assertEquals("BouncyCastle Security Provider v1.47", new BouncyCastleProvider().getInfo());
}

@Test
public void ruby(){
System.setProperty( "jruby.self.first.class.loader", "true" );
ScriptingContainer container = new ScriptingContainer();
container.setSelfFirstClassloader(true);
Object result = container.parse( "require 'openssl'; Java::OrgBouncycastleJceProvider::BouncyCastleProvider.new.info").run();
assertEquals( "BouncyCastle Security Provider v1.49", result.toString() );

result = container.parse( "JRuby.runtime.jruby_class_loader").run();
assertEquals( "org.jruby.util.SelfFirstJRubyClassLoader", result.toString().replaceFirst( "@.*$", "" ) );
result = container.parse("JRuby.runtime.jruby_class_loader").run();
assertEquals("org.jruby.util.SelfFirstJRubyClassLoader", result.toString().replaceFirst("@.*$", ""));
}
}
Original file line number Diff line number Diff line change
@@ -11,23 +11,24 @@
import org.jruby.embed.ScriptingContainer;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.*;

public class BouncyCastleTestCase {

@Test
public void java(){
assertEquals( "BouncyCastle Security Provider v1.49", new BouncyCastleProvider().getInfo() );
public void java() {
assertEquals("BouncyCastle Security Provider v1.49", new BouncyCastleProvider().getInfo());
}

@Test
public void ruby(){
System.setProperty( "jruby.self.first.class.loader", "true" );
ScriptingContainer container = new ScriptingContainer();
container.setSelfFirstClassloader(true);
Object result = container.parse( "gem 'bouncy-castle-java', '1.5.0146.1'; require 'bouncy-castle-java'; Java::OrgBouncycastleJceProvider::BouncyCastleProvider.new.info").run();
assertEquals( "BouncyCastle Security Provider v1.46", result.toString() );

result = container.parse( "JRuby.runtime.jruby_class_loader").run();
assertEquals( "org.jruby.util.SelfFirstJRubyClassLoader", result.toString().replaceFirst( "@.*$", "" ) );
result = container.parse("JRuby.runtime.jruby_class_loader").run();
assertEquals("org.jruby.util.SelfFirstJRubyClassLoader", result.toString().replaceFirst("@.*$", ""));
}
}
Original file line number Diff line number Diff line change
@@ -11,28 +11,29 @@
import org.jruby.embed.ScriptingContainer;
import org.junit.Before;
import org.junit.Test;

import static org.junit.Assert.*;

public class BouncyCastleTestCase {

@Before
public void setupProvider() throws Exception{
Security.addProvider( new BouncyCastleProvider() );
public void setupProvider() throws Exception {
Security.addProvider(new BouncyCastleProvider());
}

@Test
public void java(){
assertEquals( "BouncyCastle Security Provider v1.47", new BouncyCastleProvider().getInfo() );
public void java() {
assertEquals("BouncyCastle Security Provider v1.47", new BouncyCastleProvider().getInfo());
}

@Test
public void ruby(){
System.setProperty( "jruby.self.first.class.loader", "true" );
ScriptingContainer container = new ScriptingContainer();
container.setSelfFirstClassloader(true);
Object result = container.parse( "require 'openssl'; Java::OrgBouncycastleJceProvider::BouncyCastleProvider.new.info").run();
assertEquals( "BouncyCastle Security Provider v1.49", result.toString() );

result = container.parse( "JRuby.runtime.jruby_class_loader").run();
assertEquals( "org.jruby.util.SelfFirstJRubyClassLoader", result.toString().replaceFirst( "@.*$", "" ) );
result = container.parse("JRuby.runtime.jruby_class_loader").run();
assertEquals("org.jruby.util.SelfFirstJRubyClassLoader", result.toString().replaceFirst("@.*$", ""));
}
}
17 changes: 9 additions & 8 deletions spec/mspec/lib/mspec/runner/mspec.rb
Original file line number Diff line number Diff line change
@@ -293,7 +293,7 @@ def self.read_tags(keys)
f.each_line do |line|
line.chomp!
next if line.empty?
tag = SpecTag.new line.chomp
tag = SpecTag.new line
tags << tag if keys.include? tag.tag
end
end
@@ -315,16 +315,17 @@ def self.write_tags(tags)
# Writes +tag+ to the tag file if it does not already exist.
# Returns +true+ if the tag is written, +false+ otherwise.
def self.write_tag(tag)
string = tag.to_s
tags = read_tags([tag.tag])
tags.each do |t|
if t.tag == tag.tag and t.description == tag.description
return false
end
end

file = tags_file
path = File.dirname file
FileUtils.mkdir_p path unless File.exist? path
if File.exist? file
File.open(file, "rb") do |f|
f.each_line { |line| return false if line.chomp == string }
end
end
File.open(file, "ab") { |f| f.puts string }
File.open(file, "ab") { |f| f.puts tag.to_s }
return true
end

1 change: 1 addition & 0 deletions spec/truffle/tags/core/class/inherited_tags.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
fails:Class.inherited is invoked with the child Class when self is subclassed
fails(windows bug):Class.inherited is invoked only once per subclass
1 change: 1 addition & 0 deletions spec/truffle/tags/core/encoding/dummy_tags.txt
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
fails(inherited):Encoding#dummy? returns true for dummy encodings
fails(windows bug):Encoding#dummy? returns true for dummy encodings
1 change: 1 addition & 0 deletions spec/truffle/tags/core/encoding/find_tags.txt
Original file line number Diff line number Diff line change
@@ -10,3 +10,4 @@ fails:Encoding.find supports the 'locale' encoding alias
fails:Encoding.find returns default external encoding for the 'external' encoding alias
fails:Encoding.find returns default internal encoding for the 'internal' encoding alias
fails:Encoding.find uses default external encoding for the 'filesystem' encoding alias
fails(windows - Encoding.aliases):Encoding.find needs to be reviewed for spec completeness
3 changes: 1 addition & 2 deletions spec/truffle/tags/core/env/has_value_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
fails:ENV.has_value? returns true if ENV has the value
fails:ENV.has_value? returns false if ENV doesn't have the value
fails(windows - Hash#has_value?):ENV.has_value? looks up values case-insensitively
3 changes: 1 addition & 2 deletions spec/truffle/tags/core/env/value_tags.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
fails:ENV.value? returns true if ENV has the value
fails:ENV.value? returns false if ENV doesn't have the value
fails(windows - Hash#value?):ENV.value? looks up values case-insensitively
4 changes: 4 additions & 0 deletions spec/truffle/tags/core/io/close_on_exec_tags.txt
Original file line number Diff line number Diff line change
@@ -8,3 +8,7 @@ fails:IO#close_on_exec= returns nil
fails:IO#close_on_exec? returns true by default
fails:IO#close_on_exec? returns true if set
fails:IO#close_on_exec? raises IOError if called on a closed IO
fails(windows):IO#close_on_exec= returns false from #respond_to?
fails(windows):IO#close_on_exec= raises a NotImplementedError when called
fails(windows):IO#close_on_exec? returns false from #respond_to?
fails(windows):IO#close_on_exec? raises a NotImplementedError when called
2 changes: 2 additions & 0 deletions spec/truffle/tags/core/io/read_tags.txt
Original file line number Diff line number Diff line change
@@ -92,3 +92,5 @@ fails:IO#read with internal encoding specified by encoding: option when passed n
fails:IO#read with internal encoding specified by encoding: option when passed nil for limit sets the buffer's encoding to the internal encoding
fails:IO#read with large data reads all the data at once
fails:IO#read with large data reads only the requested number of bytes
fails(windows):IO#read on Windows normalizes line endings in text mode
fails(windows):IO#read on Windows does not normalize line endings in binary mode
2 changes: 2 additions & 0 deletions spec/truffle/tags/core/io/readlines_tags.txt
Original file line number Diff line number Diff line change
@@ -45,3 +45,5 @@ fails:IO.readlines when passed name, separator, limit, options calls #to_hash to
fails:IO.readlines encodes lines using the default external encoding
fails:IO.readlines encodes lines using the default internal encoding, when set
fails:IO.readlines ignores the default internal encoding if the external encoding is ASCII-8BIT
fails(windows bug):IO.readlines does not change $_
fails(windows bug):IO.readlines raises TypeError if the first parameter is nil
2 changes: 2 additions & 0 deletions spec/truffle/tags/core/io/write_tags.txt
Original file line number Diff line number Diff line change
@@ -29,3 +29,5 @@ fails:IO#write does not warn if called after IO#read
fails:IO#write writes to the current position after IO#read
fails:IO#write advances the file position by the count of given bytes
fails:IO#write raises IOError on closed stream
fails(windows):IO#write on Windows normalizes line endings in text mode
fails(windows):IO#write on Windows does not normalize line endings in binary mode
3 changes: 2 additions & 1 deletion spec/truffle/tags/core/kernel/eval_tags.txt
Original file line number Diff line number Diff line change
@@ -9,4 +9,5 @@ fails:Kernel#eval returns from the scope calling #eval when evaluating 'return'
fails:Kernel#eval unwinds through a Proc-style closure and returns from a lambda-style closure in the closure chain
slow:Kernel#eval raises a LocalJumpError if there is no lambda-style closure in the chain
slow:Kernel#eval does not share locals across eval scopes

fails(windows bug):Kernel#eval does not share locals across eval scopes
fails(windows bug):Kernel#eval raises a LocalJumpError if there is no lambda-style closure in the chain
4 changes: 4 additions & 0 deletions spec/truffle/tags/core/kernel/fork_tags.txt
Original file line number Diff line number Diff line change
@@ -5,3 +5,7 @@ fails:Kernel#fork marks threads from the parent as killed
fails:Kernel.fork returns nil for the child process
fails:Kernel.fork runs a block in a child process
fails:Kernel.fork marks threads from the parent as killed
fails(windows):Kernel#fork returns false from #respond_to?
fails(windows):Kernel#fork raises a NotImplementedError when called
fails(windows):Kernel.fork returns false from #respond_to?
fails(windows):Kernel.fork raises a NotImplementedError when called
2 changes: 2 additions & 0 deletions spec/truffle/tags/core/kernel/spawn_tags.txt
Original file line number Diff line number Diff line change
@@ -139,3 +139,5 @@ fails:Kernel.spawn when passed :chdir changes to the directory passed for :chdir
fails:Kernel.spawn when passed :chdir calls #to_path to convert the :chdir value
fails:Kernel#spawn with Integer option keys maps the key to a file descriptor in the child that inherits the file descriptor from the parent specified by the value
fails:Kernel.spawn with Integer option keys maps the key to a file descriptor in the child that inherits the file descriptor from the parent specified by the value
fails(windows):Kernel#spawn raises an ArgumentError if given :pgroup option
fails(windows):Kernel.spawn raises an ArgumentError if given :pgroup option
7 changes: 7 additions & 0 deletions test/pom.xml
Original file line number Diff line number Diff line change
@@ -34,12 +34,19 @@
<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>
12 changes: 9 additions & 3 deletions tool/jt.rb
Original file line number Diff line number Diff line change
@@ -35,10 +35,16 @@ def self.find_graal
module ShellUtils
private

def raw_sh(*args)
unless system(*args)
$stderr.puts "FAILED (#{$?}): #{args * ' '}"
exit $?.exitstatus
end
end

def sh(*args)
Dir.chdir(JRUBY_DIR) do
system(*args)
raise 'failed' unless $? == 0
raw_sh(*args)
end
end

@@ -106,7 +112,7 @@ def run(*args)
jruby_args += %w[-J-XX:+UnlockDiagnosticVMOptions -J-XX:CompileCommand=print,*::callRoot]
end

exec(env_vars, "#{JRUBY_DIR}/bin/jruby", *jruby_args, *args)
raw_sh(env_vars, "#{JRUBY_DIR}/bin/jruby", *jruby_args, *args)
end

def test(*args)
Original file line number Diff line number Diff line change
@@ -145,8 +145,11 @@ private static RubyArray glob(final RubyContext context, String glob) {
// Get the first star
final int firstStar = absoluteGlob.indexOf('*');

// If there's no star, there's nothing to glob. Return an empty result set.
// If there's no star, it behaves similarly to [glob if File.exist?(glob)].compact
if (firstStar == -1) {
if (new File(glob).exists()) {
array.slowPush(context.makeString(glob));
}
return array;
}

Original file line number Diff line number Diff line change
@@ -92,6 +92,10 @@ public CoverageResultNode(CoverageResultNode prev) {

@Specialization
public RubyHash coverageResult() {
if (getContext().getCoverageTracker() == null) {
throw new UnsupportedOperationException("coverage is disabled");
}

final Collection<KeyValue> keyValues = new ArrayList<>();

for (Map.Entry<Source, Long[]> source : getContext().getCoverageTracker().getCounts().entrySet()) {
@@ -132,6 +136,10 @@ public CoverageStartNode(CoverageStartNode prev) {

@Specialization
public RubyNilClass coverageStart() {
if (getContext().getCoverageTracker() == null) {
throw new UnsupportedOperationException("coverage is disabled");
}

getContext().getCoverageTracker().install();
return getContext().getCoreLibrary().getNilObject();
}
Loading