Skip to content

Commit

Permalink
Showing 161 changed files with 1,395 additions and 2,069 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -53,6 +53,8 @@ matrix:
- env: JT='test mri'
jdk: oraclejdk8
- env: JT='test gems' JAVA_OPTS="$JAVA_OPTS -Xmx512m" HAS_REDIS=true
- env: PHASE='-Pj2ee'
jdk: oraclejdk7
# 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.
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
42 changes: 21 additions & 21 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,7 +414,7 @@ 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
@@ -484,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)
@@ -528,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
@@ -746,7 +746,7 @@ def metrics(command, *args)
raise ArgumentError, command
end
end

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

def metrics_minheap(score_name, *args)
heap = 10
log '>', "Trying #{heap} MB"
@@ -813,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
@@ -883,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"
@@ -892,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
@@ -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());
Original file line number Diff line number Diff line change
@@ -35,7 +35,7 @@
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package org.jruby.truffle.core.rubinius;
package org.jruby.truffle.core;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
@@ -88,9 +88,6 @@
import static jnr.constants.platform.Errno.EINTR;
import static jnr.constants.platform.WaitFlags.WNOHANG;

/**
* Rubinius primitives associated with the VM.
*/
public abstract class VMPrimitiveNodes {

@Primitive(name = "vm_catch", needsSelf = false)
Original file line number Diff line number Diff line change
@@ -45,10 +45,8 @@
public abstract class BindingNodes {

public static DynamicObject createBinding(RubyContext context, MaterializedFrame frame) {
final Object[] arguments = frame.getArguments();

final MaterializedFrame bindingFrame = Truffle.getRuntime().createMaterializedFrame(
RubyArguments.pack(frame, null, RubyArguments.getMethod(arguments), RubyArguments.getDeclarationContext(arguments), null, RubyArguments.getSelf(arguments), RubyArguments.getBlock(arguments), RubyArguments.getArguments(arguments)),
RubyArguments.pack(frame, null, RubyArguments.getMethod(frame), RubyArguments.getDeclarationContext(frame), null, RubyArguments.getSelf(frame), RubyArguments.getBlock(frame), RubyArguments.getArguments(frame)),
newFrameDescriptor(context));

return Layouts.BINDING.createBinding(context.getCoreLibrary().getBindingFactory(), bindingFrame);
@@ -66,7 +64,7 @@ public static FrameDescriptor getFrameDescriptor(DynamicObject binding) {

public static MaterializedFrame getDeclarationFrame(DynamicObject binding) {
assert RubyGuards.isRubyBinding(binding);
return RubyArguments.getDeclarationFrame(Layouts.BINDING.getFrame(binding).getArguments());
return RubyArguments.getDeclarationFrame(Layouts.BINDING.getFrame(binding));
}

protected static class FrameSlotAndDepth {
@@ -329,7 +327,7 @@ public abstract static class ReceiverNode extends UnaryCoreMethodNode {

@Specialization
public Object receiver(DynamicObject binding) {
return RubyArguments.getSelf(Layouts.BINDING.getFrame(binding).getArguments());
return RubyArguments.getSelf(Layouts.BINDING.getFrame(binding));
}
}

Loading

0 comments on commit 4ceccbd

Please sign in to comment.