Skip to content

Commit

Permalink
Showing 2,188 changed files with 67,276 additions and 137,056 deletions.
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -24,9 +24,10 @@
build
build.properties
build_graph.png
mx*/*pyc
mx*/env
mxbuild
/mx.jruby/*pyc
/mx.jruby/env
/mxbuild
/mx.imports
core/src/main/java/org/jruby/runtime/Constants.java
dependency-reduced-pom.xml
dev_null
15 changes: 3 additions & 12 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -82,22 +82,13 @@ matrix:
jdk: oraclejdk8
- env: JT='test specs :truffle'
jdk: oraclejdk8
- env: JT='test integration'
jdk: oraclejdk8
- env: JT='test gems' JAVA_OPTS="$JAVA_OPTS -Xmx512m" HAS_REDIS=true
jdk: oraclejdk8
- env: JT='test tck'
jdk: oraclejdk8
- env: JT=check_ambiguous_arguments SKIP_BUILD=true
jdk: oraclejdk8
- env:
- USE_BUILD_PACK=yes
- JT='test fast'
jdk: oraclejdk8
allow_failures:
- env: PHASE='-Prake -Dtask=test:mri:fullint'
- 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
421 changes: 402 additions & 19 deletions COPYING

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ For [`rbenv`](https://github.com/sstephenson/rbenv) you will need the
package manager can provide these. Then you can run:

```
$ rbenv install jruby-9.0.5.0
$ rbenv install jruby-9.1.2.0
```

For [`rvm`](https://rvm.io) you can simply do:
30 changes: 0 additions & 30 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -15,33 +15,3 @@ begin
/(#{Rake::Backtrace::SUPPRESS_PATTERN})|(^org\/jruby)/
rescue
end

task :default => [:build]

desc "Build JRuby"
task :build do
ant "jar"
end

task :jar => :build

desc "Clean all built output"
task :clean do
delete_files = FileList.new do |fl|
fl.
include("#{BUILD_DIR}/**").
exclude("#{BUILD_DIR}/rubyspec").
include(DIST_DIR).
include(API_DOCS_DIR)
end

delete_files.each {|files| rm_rf files, :verbose => true}
end

desc "Generate sources, compile and add to jar file"
task :gen do
mkdir_p 'build/src_gen'
system 'apt -nocompile -cp lib/jruby.jar:build_lib/asm-4.0.jar:build_lib/asm-util-4.0.jar -factory org.jruby.anno.AnnotationBinder src/org/jruby/*.java'
system 'javac -cp lib/jruby.jar build/src_gen/*.java'
system 'jar -uf lib/jruby.jar -C build/src_gen .'
end
28 changes: 24 additions & 4 deletions bench/java/bench_array_to_java.rb
Original file line number Diff line number Diff line change
@@ -5,9 +5,29 @@

TIMES.times do
Benchmark.bm(30) do |bm|
bm.report("control") {a = [1,2,3,4]; 100_000.times {a}}
bm.report("ary.to_java") {a = [1,2,3,4]; 100_000.times {a.to_java}}
bm.report("ary.to_java :object") {a = [1,2,3,4]; 100_000.times {a.to_java :object}}
bm.report("ary.to_java :string") {a = [1,2,3,4]; 100_000.times {a.to_s.to_java :string}}
bm.report("control") { ary = [1,2,3,4,5,6,7,8]; 1_000_000.times { ary } }
bm.report("ary.to_java") { ary = [1,2,3,4,5,6,7,8]; 1_000_000.times { ary.to_java } }
bm.report("ary.to_java :object") { ary = [1,2,3,4,5,6,7,8]; 1_000_000.times { ary.to_java :object } }
bm.report("ary.to_java java.lang.Integer") { ary = [1,2,3,4,5,6,7,8]; 1_000_000.times { ary.to_java java.lang.Integer } }
bm.report("ary.to_java :int") { ary = [1,2,3,4,5,6,7,8]; 1_000_000.times { ary.to_java :int } }
bm.report("ary.to_java Java::int") { ary = [1,2,3,4,5,6,7,8]; 1_000_000.times { ary.to_java Java::int } }
bm.report("ary.to_java :short") { ary = [1,2,3,4,5,6,7,8]; 1_000_000.times { ary.to_java :short } }

bm.report("long_ary.to_java") do
long_ary = (0..255).to_a
100_000.times { long_ary.to_java }
end
bm.report("long_ary.to_java :int") do
long_ary = (0..255).to_a
100_000.times { long_ary.to_java :int }
end
bm.report("long_ary.to_java Java::int") do
long_ary = (0..255).to_a
100_000.times { long_ary.to_java Java::int }
end
bm.report("long_ary.to_java :short") do
long_ary = (0..255).to_a
100_000.times { long_ary.to_java :short }
end
end
end
73 changes: 73 additions & 0 deletions bench/java/bench_java_coll_member.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
require 'java'
require 'benchmark'

TIMES = (ARGV[0] || 5).to_i

CONTENTS = (1..36).to_a

TIMES.times do
Benchmark.bm(10) do |bm|
bm.report('ArrayList#include? hit ') do
list = java.util.ArrayList.new CONTENTS
hit = 32
1_000_000.times { list.include?(hit) }
end
bm.report('ArrayList#include? miss') do
list = java.util.ArrayList.new CONTENTS
miss = 0
1_000_000.times { list.include?(miss) }
end
bm.report('ArrayList#contains hit ') do
list = java.util.ArrayList.new CONTENTS
hit = 32
1_000_000.times { list.contains(hit) }
end
bm.report('ArrayList#contains miss') do
list = java.util.ArrayList.new CONTENTS
miss = 0
1_000_000.times { list.contains(miss) }
end

bm.report('HashSet#include? hit ') do
list = java.util.HashSet.new CONTENTS
hit = 32
1_000_000.times { list.include?(hit) }
end
bm.report('HashSet#include? miss ') do
list = java.util.HashSet.new CONTENTS
miss = 0
1_000_000.times { list.include?(miss) }
end
bm.report('HashSet#contains hit ') do
list = java.util.HashSet.new CONTENTS
hit = 32
1_000_000.times { list.contains(hit) }
end
bm.report('HashSet#contains miss ') do
list = java.util.HashSet.new CONTENTS
miss = 0
1_000_000.times { list.contains(miss) }
end

bm.report('LHashSet#include? hit ') do
list = java.util.LinkedHashSet.new CONTENTS
hit = 32
1_000_000.times { list.include?(hit) }
end
bm.report('LHashSet#include? miss ') do
list = java.util.LinkedHashSet.new CONTENTS
miss = 0
1_000_000.times { list.include?(miss) }
end
bm.report('LHashSet#contains hit ') do
list = java.util.LinkedHashSet.new CONTENTS
hit = 32
1_000_000.times { list.contains(hit) }
end
bm.report('LHashSet#contains miss ') do
list = java.util.LinkedHashSet.new CONTENTS
miss = 0
1_000_000.times { list.contains(miss) }
end
end
end
45 changes: 45 additions & 0 deletions bench/java/bench_java_list_ext.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
require 'java'
require 'benchmark'

TIMES = (ARGV[0] || 5).to_i

TIMES.times do
Benchmark.bm(10) do |bm|
bm.report('ArrayList') do
list = java.util.ArrayList.new
one = 1.to_java
two = 2.to_java
thr = 3.to_java
1_000_000.times do
list.clear

list << one; list << two; list << thr

list[2] = one; list[0] = two; list[1] = thr

list.index(one)
list.rindex(thr)

list.to_a
end
end
bm.report('LinkedList') do
list = java.util.LinkedList.new
one = 1.to_java
two = 2.to_java
thr = 3.to_java
1_000_000.times do
list.clear

list << one; list << two; list << thr

list[2] = one; list[0] = two; list[1] = thr

list.index(one)
list.rindex(thr)

list.to_a
end
end
end
end
53 changes: 0 additions & 53 deletions bin/jruby-cext-c

This file was deleted.

10 changes: 8 additions & 2 deletions bin/jruby.bash
Original file line number Diff line number Diff line change
@@ -243,9 +243,10 @@ do
# Pass -X... and -X? search options through
-X*\.\.\.|-X*\?)
ruby_args=("${ruby_args[@]}" "$1") ;;
-Xclassic)
unset USING_TRUFFLE
;;
-X+T)
JRUBY_CP="$JRUBY_CP$CP_DELIMITER$JRUBY_HOME/lib/jruby-truffle.jar"
ruby_args=("${ruby_args[@]}" "-X+T")
USING_TRUFFLE="true"
;;
# Match -Xa.b.c=d to translate to -Da.b.c=d as a java option
@@ -315,6 +316,11 @@ do
shift
done

if [[ "$USING_TRUFFLE" != "" ]]; then
JRUBY_CP="$JRUBY_CP$CP_DELIMITER$JRUBY_HOME/lib/jruby-truffle.jar"
ruby_args=("-X+T" "${ruby_args[@]}")
fi

# Force file.encoding to UTF-8 when on Mac, since Apple JDK defaults to MacRoman (JRUBY-3576)
if [[ $darwin && -z "$JAVA_ENCODING" ]]; then
java_args=("${java_args[@]}" "-Dfile.encoding=UTF-8")
6 changes: 4 additions & 2 deletions bin/jruby.sh
Original file line number Diff line number Diff line change
@@ -197,8 +197,10 @@ do
-X*\.\.\.|-X*\?)
ruby_args="${ruby_args} $1" ;;
-X+T)
JRUBY_CP="$JRUBY_CP$CP_DELIMITER$JRUBY_HOME/lib/jruby-truffle.jar"
ruby_args="${ruby_args} -X+T"
echo "error: -X+T isn't supported in the shell launcher"
exit 1
;;
-Xclassic)
;;
# Match -Xa.b.c=d to translate to -Da.b.c=d as a java option
-X*)
Loading

0 comments on commit 3402408

Please sign in to comment.