Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into test-new-recursion
Browse files Browse the repository at this point in the history
headius committed May 16, 2016
2 parents 1778c00 + d04d3cc commit 4101c6a
Showing 169 changed files with 1,414 additions and 2,088 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -96,7 +96,6 @@ matrix:
jdk: oraclejdk8
- env: PHASE='-Pj2ee'
jdk: oraclejdk7
- env: JT='test gems' JAVA_OPTS="$JAVA_OPTS -Xmx512m" HAS_REDIS=true
# NOTE: build seems to never start (waited for any to finish for more than a day) - probably a travis-ci bug
#- env: PHASE='-Pmain'
# sudo: required
2 changes: 1 addition & 1 deletion lib/ruby/truffle/jruby+truffle/gem_ci/activemodel.rb
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
repository_name 'rails'

git_clone 'https://github.com/rails/rails.git' unless File.exists? repository_dir
git_checkout git_tag('4.2.5.2')
git_checkout git_tag('4.2.6')

use_only_https_git_paths!

2 changes: 1 addition & 1 deletion lib/ruby/truffle/jruby+truffle/gem_ci/activesupport.rb
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
repository_name 'rails'

git_clone 'https://github.com/rails/rails.git' unless File.exists? repository_dir
git_checkout git_tag('4.2.5.2')
git_checkout git_tag('4.2.6')

use_only_https_git_paths!

Original file line number Diff line number Diff line change
@@ -141,6 +141,9 @@
# do not let bundler to install db gem group
:without:
- db
:before:
# temporary workaround, rake 10.4.2 will not install
- ruby -e 'File.write "../Gemfile.lock", File.read("../Gemfile.lock").gsub(/rake \(10\.4\.2\)/,"rake (11.1.2)")'
:run:
:require:
- rubygems
Original file line number Diff line number Diff line change
@@ -65,6 +65,9 @@
# do not let bundler to install db gem group
:without:
- db
:before:
# temporary workaround, rake 10.4.2 will not install
- ruby -e 'File.write "../Gemfile.lock", File.read("../Gemfile.lock").gsub(/rake \(10\.4\.2\)/,"rake (11.1.2)")'
:run:
:require:
- rubygems
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
module Truffle

def self.exclude_rspec_examples(exclusions)
exclusions.each do |mod_name, tests|

a_module = Object.const_get mod_name

Array(tests).each do |test|
puts "Excluding: #{a_module}##{test}"
a_module.send :undef_method, test
a_module.send :define_method, test do
skip 'excluded test'
end
end

end
end

end
9 changes: 7 additions & 2 deletions lib/ruby/truffle/jruby+truffle/lib/truffle/runner.rb
Original file line number Diff line number Diff line change
@@ -120,6 +120,7 @@ module OptionBlocks
},
setup: {
help: ['-h', '--help', 'Show this message', STORE_NEW_VALUE, false],
before: ['--before SH_CMD', 'Commands to execute before setup', ADD_TO_ARRAY, []],
after: ['--after SH_CMD', 'Commands to execute after setup', ADD_TO_ARRAY, []],
file: ['--file NAME,CONTENT', Array, 'Create file in truffle_bundle_path', MERGE_TO_HASH, {}],
without: ['--without GROUP', 'Do not install listed gem group by bundler', ADD_TO_ARRAY, []]
@@ -181,8 +182,8 @@ module OptionBlocks

run_help = <<-TXT.gsub(/^ {6}/, '')
Usage: #{EXECUTABLE} [options] run [subcommand-options] -- [ruby-options]
Usage: #{EXECUTABLE} [options] run [subcommand-options] -- [prepended-ruby-options] -- [appended-ruby-options]
Usage: #{EXECUTABLE} [options] run [subcommand-options] -- [ruby-options] [RUBY-FILE]
Usage: #{EXECUTABLE} [options] run [subcommand-options] -- [prepended-ruby-options] -- [appended-ruby-options] [RUBY-FILE]
Usage: #{EXECUTABLE} [options] run [subcommand-options] -S GEM_EXECUTABLE -- [ruby-options] -- [gem-executable-options]
Usage: #{EXECUTABLE} [options] run [subcommand-options] -S GEM_EXECUTABLE -- [gem-executable-options]
('--' divides different kind of options)
@@ -384,6 +385,10 @@ def subcommand_setup(rest)
bundle_options = @options[:global][:bundle_options].split(' ')
bundle_path = File.expand_path(@options[:global][:truffle_bundle_path])

@options[:setup][:before].each do |cmd|
execute_cmd cmd
end

bundle_cli([*bundle_options,
'install',
'--standalone',
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -16,5 +16,6 @@ def initialize(value)
end


example "Truffle::Interop.read(InteropPE::A.new(42), :@foo)", 42
example "Truffle::Interop.read(InteropPE::A.new(42), '@foo')", 42
# The Truffle API's these use are different from GraalVM 0.12 and Truffle 0.13
tagged example "Truffle::Interop.read(InteropPE::A.new(42), :@foo)", 42
tagged example "Truffle::Interop.read(InteropPE::A.new(42), '@foo')", 42
Original file line number Diff line number Diff line change
@@ -6,4 +6,5 @@
# GNU General Public License version 2
# GNU Lesser General Public License version 2.1

main_thread example "Truffle::Interop.eval('application/javascript', '14 + 2')", 16
# The Truffle API's this uses are different from GraalVM 0.12 and Truffle 0.13
tagged main_thread example "Truffle::Interop.eval('application/javascript', '14 + 2')", 16
File renamed without changes.
6 changes: 3 additions & 3 deletions test/truffle/compiler/pe/pe.rb
Original file line number Diff line number Diff line change
@@ -86,15 +86,15 @@ def counter(example)
require_relative 'core/block_given_pe.rb'
require_relative 'core/string_pe.rb'
require_relative 'core/class_pe'
require_relative 'core/interop_pe'
require_relative 'interop/interop_pe'
require_relative 'macro/pushing_pixels_pe.rb'

if Truffle::Interop.mime_type_supported?('application/javascript')
require_relative 'js.rb'
require_relative 'interop/js.rb'
end

if Truffle::Interop.mime_type_supported?('application/x-r')
require_relative 'r.rb'
require_relative 'interop/r.rb'
end

end
2 changes: 1 addition & 1 deletion test/truffle/gems/rack-server.sh
Original file line number Diff line number Diff line change
@@ -3,5 +3,5 @@
set -e

bin/jruby bin/gem install rack -v 1.6.1
source test/truffle/gems/common/test_server.sh.inc
source test/truffle/common/test_server.sh.inc
ruby -X+T -Ilib/ruby/gems/shared/gems/rack-1.6.1/lib test/truffle/gems/rack-server/rack-server.rb & test_server
2 changes: 1 addition & 1 deletion test/truffle/gems/sinatra-server.sh
Original file line number Diff line number Diff line change
@@ -6,5 +6,5 @@ bin/jruby bin/gem install rack -v 1.6.1
bin/jruby bin/gem install tilt -v 2.0.1
bin/jruby bin/gem install rack-protection -v 1.5.3
bin/jruby bin/gem install sinatra -v 1.4.6
source test/truffle/gems/common/test_server.sh.inc
source test/truffle/common/test_server.sh.inc
ruby -X+T -Ilib/ruby/gems/shared/gems/rack-1.6.1/lib -Ilib/ruby/gems/shared/gems/tilt-2.0.1/lib -Ilib/ruby/gems/shared/gems/rack-protection-1.5.3/lib -Ilib/ruby/gems/shared/gems/sinatra-1.4.6/lib test/truffle/gems/sinatra-server/sinatra-server.rb & test_server
2 changes: 1 addition & 1 deletion test/truffle/integration/tcp-server.sh
Original file line number Diff line number Diff line change
@@ -2,5 +2,5 @@

set -e

source test/truffle/integration/common/test_server.sh.inc
source test/truffle/common/test_server.sh.inc
ruby -X+T test/truffle/integration/tcp-server/tcp-server.rb & test_server
2 changes: 1 addition & 1 deletion test/truffle/integration/webrick-server.sh
Original file line number Diff line number Diff line change
@@ -2,5 +2,5 @@

set -e

source test/truffle/integration/common/test_server.sh.inc
source test/truffle/common/test_server.sh.inc
ruby -X+T test/truffle/integration/webrick-server/webrick-server.rb & test_server
45 changes: 23 additions & 22 deletions tool/jt.rb
Original file line number Diff line number Diff line change
@@ -64,18 +64,18 @@ def self.find_graal
end
raise "couldn't find graal - download it as described in https://github.com/jruby/jruby/wiki/Downloading-GraalVM and extract it into the JRuby repository or parent directory"
end

def self.find_sulong_graal(dir)
searches = [
"#{dir}/../jvmci/jdk*/product/bin/java",
"#{dir}/../graal-core/mx.imports/binary/jvmci/jdk*/product/bin/java"
]

searches.each do |search|
java = Dir[search].first
return java if java
end

raise "couldn't find the Java build in the Sulong repository - you need to check it out and build it"
end

@@ -134,7 +134,7 @@ def self.git_branch
def self.mangle_for_env(name)
name.upcase.tr('-', '_')
end

def self.find_jvmci
jvmci_locations = [
ENV['JVMCI_DIR'],
@@ -149,7 +149,7 @@ def self.find_jvmci
Dir.exist?(location)
end
end

def self.igv_running?
`ps ax`.include?('IdealGraphVisualizer')
end
@@ -168,14 +168,14 @@ def self.ensure_igv_running
puts "-------------"
puts
puts

sleep 3

until igv_running?
puts 'still waiting for IGV to appear in ps ax...'
sleep 3
end

puts 'just a few more seconds...'
sleep 6
end
@@ -414,16 +414,17 @@ def run(*args)
if args.delete('--sulong')
dir = Utilities.find_sulong_dir
env_vars["JAVACMD"] = Utilities.find_sulong_graal(dir)

if ENV["SULONG_CLASSPATH"]
jruby_args << '-J-classpath' << ENV["SULONG_CLASSPATH"]
else
jruby_args << '-J-classpath' << "#{dir}/lib/*"
jruby_args << '-J-classpath' << "#{dir}/build/sulong.jar"
nfi_classes = File.expand_path('../graal-core/mxbuild/graal/com.oracle.nfi/bin', dir)
jruby_args << '-J-classpath' << nfi_classes
jruby_args << '-J-XX:-UseJVMCIClassLoader'
end

jruby_args << '-J-XX:-UseJVMCIClassLoader'
end

if args.delete('--asm')
@@ -483,8 +484,8 @@ def test(*args)
test_tck
test_specs('run')
# test_mri # TODO (pitr-ch 29-Mar-2016): temporarily disabled since it uses refinements
test_integration ({})
test_gems ({ 'HAS_REDIS' => 'true' })
test_integration
test_gems('HAS_REDIS' => 'true')
test_compiler
test_cexts if ENV['SULONG_DIR']
when 'compiler' then test_compiler(*rest)
@@ -527,19 +528,19 @@ def test_compiler(*args)
jruby_opts = []
jruby_opts << '-J-Djvmci.Compiler=graal'
jruby_opts << '-Xtruffle.graal.warn_unless=false'

if ENV['GRAAL_JS_JAR']
jruby_opts << '-J-classpath'
jruby_opts << Utilities.find_graal_js
end

jruby_opts << '-Xtruffle.exceptions.print_java=true'

env_vars = {}
env_vars["JAVACMD"] = Utilities.find_graal unless args.delete('--no-java-cmd')
env_vars["JRUBY_OPTS"] = jruby_opts.join(' ')
env_vars["PATH"] = "#{Utilities.find_jruby_bin_dir}:#{ENV["PATH"]}"

Dir["#{JRUBY_DIR}/test/truffle/compiler/*.sh"].each do |test_script|
sh env_vars, test_script
end
@@ -745,7 +746,7 @@ def metrics(command, *args)
raise ArgumentError, command
end
end

def metrics_alloc(score_name, *args)
samples = []
METRICS_REPS.times do
@@ -780,7 +781,7 @@ def memory_allocated(trace)
end
allocated
end

def metrics_minheap(score_name, *args)
heap = 10
log '>', "Trying #{heap} MB"
@@ -812,11 +813,11 @@ def metrics_minheap(score_name, *args)
puts "#{heap} MB"
end
end

def can_run_in_heap(heap, *command)
run("-J-Xmx#{heap}M", *command, {err: '/dev/null', out: '/dev/null'}, :continue_on_failure, :no_print_cmd)
end

def metrics_time(score_name, *args)
samples = []
METRICS_REPS.times do
@@ -882,7 +883,7 @@ def human_size(bytes)
"#{(bytes/1024.0**4).round(2)} TB"
end
end

def tarball
mvn '-Pdist'
generated_file = "#{JRUBY_DIR}/maven/jruby-dist/target/jruby-dist-#{Utilities.jruby_version}-bin.tar.gz"
@@ -891,7 +892,7 @@ def tarball
FileUtils.copy "#{generated_file}.sha256", "#{final_file}.sha256"
sh 'test/truffle/tarball.sh', final_file
end

def log(tty_message, full_message)
if STDOUT.tty?
print(tty_message) unless tty_message.nil?
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ public Object execute(org.jruby.ast.RootNode rootNode) {
"See https://github.com/jruby/jruby/wiki/Truffle-FAQ#how-do-i-get-jrubytruffle");
}

context.setInitialJRubyRootNode(rootNode);
context.getJRubyInterop().setOriginalInputFile(rootNode.getPosition().getFile());

try {
return engine.eval(Source.fromText("Truffle::Boot.run_jruby_root", "run_jruby_root")
9 changes: 0 additions & 9 deletions truffle/src/main/java/org/jruby/truffle/RubyContext.java
Original file line number Diff line number Diff line change
@@ -94,7 +94,6 @@ public class RubyContext extends ExecutionContext {

private final Object classVariableDefinitionLock = new Object();

private org.jruby.ast.RootNode initialJRubyRootNode;
private final AttachmentsManager attachmentsManager;

public RubyContext(Ruby jrubyRuntime, TruffleLanguage.Env env) {
@@ -223,14 +222,6 @@ public void shutdown() {
}
}

public void setInitialJRubyRootNode(org.jruby.ast.RootNode initialJRubyRootNode) {
this.initialJRubyRootNode = initialJRubyRootNode;
}

public org.jruby.ast.RootNode getInitialJRubyRootNode() {
return initialJRubyRootNode;
}

public Options getOptions() {
return options;
}
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@
import org.jruby.truffle.core.rubinius.StatPrimitiveNodesFactory;
import org.jruby.truffle.core.rubinius.UndefinedPrimitiveNodes;
import org.jruby.truffle.core.rubinius.UndefinedPrimitiveNodesFactory;
import org.jruby.truffle.core.rubinius.VMPrimitiveNodesFactory;
import org.jruby.truffle.core.VMPrimitiveNodesFactory;
import org.jruby.truffle.core.rubinius.WeakRefPrimitiveNodesFactory;
import org.jruby.truffle.core.string.StringNodesFactory;
import org.jruby.truffle.core.symbol.SymbolNodesFactory;
6 changes: 3 additions & 3 deletions truffle/src/main/java/org/jruby/truffle/core/CoreLibrary.java
Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@
import org.jruby.truffle.core.rope.TruffleRopesNodesFactory;
import org.jruby.truffle.core.rubinius.AtomicReferenceNodesFactory;
import org.jruby.truffle.core.rubinius.ByteArrayNodesFactory;
import org.jruby.truffle.core.rubinius.PosixNodesFactory;
import org.jruby.truffle.extra.TrufflePosixNodesFactory;
import org.jruby.truffle.core.rubinius.RubiniusTypeNodesFactory;
import org.jruby.truffle.core.string.StringNodesFactory;
import org.jruby.truffle.core.string.StringOperations;
@@ -592,6 +592,7 @@ public CoreLibrary(RubyContext context) {
defineModule(truffleModule, "Kernel");
defineModule(truffleModule, "Process");
defineModule(truffleModule, "Binding");
defineModule(truffleModule, "POSIX");
psychModule = defineModule("Psych");
psychParserClass = defineClass(psychModule, objectClass, "Parser");
final DynamicObject psychHandlerClass = defineClass(psychModule, objectClass, "Handler");
@@ -609,7 +610,6 @@ public CoreLibrary(RubyContext context) {
rubiniusModule = defineModule("Rubinius");

rubiniusFFIModule = defineModule(rubiniusModule, "FFI");
defineModule(defineModule(rubiniusFFIModule, "Platform"), "POSIX");
rubiniusFFIPointerClass = defineClass(rubiniusFFIModule, objectClass, "Pointer");
Layouts.CLASS.setInstanceFactoryUnsafe(rubiniusFFIPointerClass, Layouts.POINTER.createPointerShape(rubiniusFFIPointerClass, rubiniusFFIPointerClass));

@@ -733,7 +733,7 @@ public void addCoreMethods() {
coreMethodNodeManager.addCoreMethodNodes(UnboundMethodNodesFactory.getFactories());
coreMethodNodeManager.addCoreMethodNodes(ByteArrayNodesFactory.getFactories());
coreMethodNodeManager.addCoreMethodNodes(TimeNodesFactory.getFactories());
coreMethodNodeManager.addCoreMethodNodes(PosixNodesFactory.getFactories());
coreMethodNodeManager.addCoreMethodNodes(TrufflePosixNodesFactory.getFactories());
coreMethodNodeManager.addCoreMethodNodes(RubiniusTypeNodesFactory.getFactories());
coreMethodNodeManager.addCoreMethodNodes(ThreadBacktraceLocationNodesFactory.getFactories());
coreMethodNodeManager.addCoreMethodNodes(DigestNodesFactory.getFactories());
Loading

0 comments on commit 4101c6a

Please sign in to comment.