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

Commits on Jun 14, 2015

  1. [Truffle] Don't run tagged PE tests, check errors more carefully, and…

    … tag some failing tests.
    chrisseaton committed Jun 14, 2015
    Copy the full SHA
    73e0e2a View commit details
  2. Copy the full SHA
    fb46ef6 View commit details
  3. [Truffle] Use simple getResourceAsStream to load the core library.

    LoadService doesn't seem to work when Truffle is on the boot class path.
    chrisseaton committed Jun 14, 2015
    Copy the full SHA
    ffa60fd View commit details
  4. 2
    Copy the full SHA
    2ad052f View commit details
7 changes: 7 additions & 0 deletions bin/jruby.bash
Original file line number Diff line number Diff line change
@@ -146,6 +146,13 @@ for j in "$JRUBY_HOME"/lib/jruby.jar "$JRUBY_HOME"/lib/jruby-complete.jar; do
JRUBY_ALREADY_ADDED=true
done

# The Truffle jar always needs to be on the boot classpath so that the VM can
# substitute classes. We add it even if the jar isn't necessarily available,
# but this doesn't cause any problems.
if [ -e "$JRUBY_HOME/lib/jruby-truffle.jar" ]; then
JRUBY_CP="$JRUBY_CP$CP_DELIMITER$JRUBY_HOME/lib/jruby-truffle.jar"
fi

if $cygwin; then
JRUBY_CP=`cygpath -p -w "$JRUBY_CP"`
fi
6 changes: 6 additions & 0 deletions bin/jruby.sh
Original file line number Diff line number Diff line change
@@ -107,6 +107,12 @@ for j in "$JRUBY_HOME"/lib/jruby.jar "$JRUBY_HOME"/lib/jruby-complete.jar; do
JRUBY_ALREADY_ADDED=true
done

# The Truffle jar always needs to be on the boot classpath so that the VM can
# substitute classes. We add it even if the jar isn't necessarily available,
# but this doesn't cause any problems.
if [ -e "$JRUBY_HOME/lib/jruby-truffle.jar" ]; then
JRUBY_CP="$JRUBY_CP$CP_DELIMITER$JRUBY_HOME/lib/jruby-truffle.jar"
fi

# ----- Set Up The System Classpath -------------------------------------------

4 changes: 3 additions & 1 deletion test/truffle/pe/language/constant_pe.rb
Original file line number Diff line number Diff line change
@@ -51,7 +51,9 @@ def self.const_missing(const)
example "ConstantFixtures.get_existing"
example "ConstantFixtures.get"
example "ConstantFixtures.get_const_get(:A)"
example "ConstantFixtures.get_const_get('A')"

# Internal Graal compiler error
tagged_example "ConstantFixtures.get_const_get('A')"

example "ConstantFixtures::Nested.get_nested"
example "ConstantFixtures::Child.get_inherited"
38 changes: 25 additions & 13 deletions test/truffle/pe/pe.rb
Original file line number Diff line number Diff line change
@@ -56,27 +56,38 @@ def tagged_example(code)

tested = 0
failed = 0
tagged = 0
errored = 0
timedout = 0

EXAMPLES.each do |code, expected_constant, tagged|
next if tagged

finished = false

test_thread = Thread.new do
begin
tested += 1
eval "loop { Truffle::Primitive.assert_constant #{code}; Truffle::Primitive.assert_not_compiled; Thread.pass }"
rescue RubyTruffleError => e
constant = e.message.include? 'Truffle::Primitive.assert_not_compiled'
if expected_constant
unless constant
puts "FAILURE: #{code} wasn't constant"
failed += 1
end
if e.message.include? 'Truffle::Primitive.assert_not_compiled'
constant = true
elsif e.message.include? 'Truffle::Primitive.assert_constant'
constant = false
else
constant = nil
end

if constant.nil?
puts "ERROR: #{code} errored in some unexpected way: #{e.message}"
errored += 1
else
if constant
if tagged
puts "QUERY: #{code} was tagged but it still passed"
else
if expected_constant
unless constant
puts "FAILURE: #{code} wasn't constant"
failed += 1
end
else
if constant
puts "QUERY: #{code} wasn't supposed to be constant but it was"
failed += 1
end
@@ -91,9 +102,10 @@ def tagged_example(code)

unless finished
puts "TIMEOUT: #{code} didn't compile in time so I don't know if it's constant or not"
timedout += 1
end
end

puts "Tested #{tested}, #{EXAMPLES.select{|c,e,t| t}.size} tagged, #{failed} failed"
puts "Tested #{tested}, #{EXAMPLES.select{|c,e,t| t}.size} tagged, #{failed} failed, #{errored} errored, #{timedout} timed out"

exit 1 unless failed.zero?
exit 1 unless failed.zero? && errored.zero? && timedout.zero?
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ public RubyBasicObject assertCompilationConstant(Object value) {

if (!compilationConstant[0]) {
CompilerDirectives.transferToInterpreterAndInvalidate();
throw new RaiseException(getContext().getCoreLibrary().internalError("Value was not constant", this));
throw new RaiseException(getContext().getCoreLibrary().internalError("Value in Truffle::Primitive.assert_constant was not constant", this));
}

return nil();
Original file line number Diff line number Diff line change
@@ -634,17 +634,13 @@ public void loadRubyCore(String fileName, String prefix) {
}

public InputStream getRubyCoreInputStream(String fileName) {
final LoadServiceResource resource = context.getRuntime().getLoadService().getClassPathResource(getClass().getClassLoader(), fileName);
final InputStream resource = getClass().getResourceAsStream("/" + fileName);

if (resource == null) {
throw new RuntimeException("couldn't load Truffle core library " + fileName);
}

try {
return resource.getInputStream();
} catch (IOException e) {
throw new RuntimeException(e);
}
return resource;
}

public void initializeEncodingConstants() {