View partials.rb
N=1000_000_000
def threaded_partial_sum(nthreads, n)
puts "Partial sum on #{nthreads} thread(s)"
sum = nthreads.times.collect { 0 }
t1 = Time.now
threads = nthreads.times.collect do |num|
Thread.new do
i=num
psum = 0
View gist:bbf80f8dcca87cd651b7d67398c0190a
public static RUBY$method$foo$1(Lorg/jruby/runtime/ThreadContext;Lorg/jruby/parser/StaticScope;Lorg/jruby/runtime/builtin/IRubyObject;Lorg/jruby/runtime/Block;Lorg/jruby/RubyModule;Ljava/lang/String;)Lorg/jruby/runtime/builtin/IRubyObject;
L0
NOP
NOP
L1
LINENUMBER 2 L1
ALOAD 0
INVOKEDYNAMIC fixnum(Lorg/jruby/runtime/ThreadContext;)Lorg/jruby/runtime/builtin/IRubyObject; [
// handle kind 0x6 : INVOKESTATIC
org/jruby/ir/targets/FixnumObjectSite.bootstrap(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;J)Ljava/lang/invoke/CallSite;
View bench_recursive_fib.rb
# run with: mx vm -XX:+UseJVMCICompiler -Djruby.home=<jruby home> -Djruby.compile.invokedynamic -jar <jruby home>/lib/jruby.jar ../rubybench/time/bench_fib_recursive.rb 1000 35
require 'benchmark'
def fib_ruby(n)
if n < 2
n
else
fib_ruby(n - 2) + fib_ruby(n - 1)
end
View gist:471e93bf65d8240992e36a66954d1684
$ rvm jruby-9.0.3.0 do jruby -Xcompile.invokedynamic benchmark/full_playout.rb
Calculating -------------------------------------
9x9 full playout (+ score)
25.000 i/100ms
13x13 full playout (+ score)
12.000 i/100ms
19x19 full playout (+ score)
4.000 i/100ms
-------------------------------------------------
9x9 full playout (+ score)
View gist:7b18835fed6c62a44823668704ed050c
[] ~/projects/jruby $ cat blah.rb
puts 'Hello, flatbuffers!'
[] ~/projects/jruby $ java -cp lib/jruby.jar org.jruby.ir.persistence.flat.FlatIRInterpreter blah.rb
Hello, flatbuffers!
[] ~/projects/jruby $ ls -l blah.ir
-rw-r--r-- 1 headius staff 1024 Jun 7 02:54 blah.ir
[] ~/projects/jruby $ hexdump -c blah.ir
View joni.diff
diff --git a/src/org/joni/ByteCodeMachine.java b/src/org/joni/ByteCodeMachine.java
index 5cf643e..f02c013 100644
--- a/src/org/joni/ByteCodeMachine.java
+++ b/src/org/joni/ByteCodeMachine.java
@@ -36,6 +36,8 @@ import org.joni.constants.OPSize;
import org.joni.exception.ErrorMessages;
import org.joni.exception.InternalException;
+import java.util.Arrays;
+
View 3762_fix.diff
diff --git a/core/src/main/java/org/jruby/util/io/EncodingUtils.java b/core/src/main/java/org/jruby/util/io/EncodingUtils.java
index 6fee359..62e29ce 100644
--- a/core/src/main/java/org/jruby/util/io/EncodingUtils.java
+++ b/core/src/main/java/org/jruby/util/io/EncodingUtils.java
@@ -50,7 +50,7 @@ import org.jruby.util.TypeConverter;
import java.util.Arrays;
public class EncodingUtils {
- public static final int ECONV_DEFAULT_NEWLINE_DECORATOR = Platform.IS_WINDOWS ? EConvFlags.CRLF_NEWLINE_DECORATOR : 0;
+ public static final int ECONV_DEFAULT_NEWLINE_DECORATOR = Platform.IS_WINDOWS ? EConvFlags.UNIVERSAL_NEWLINE_DECORATOR : 0;
View ecflags_for_fdopen.diff
diff --git a/core/src/main/java/org/jruby/RubyIO.java b/core/src/main/java/org/jruby/RubyIO.java
index 4223b7c..5ea9d30 100644
--- a/core/src/main/java/org/jruby/RubyIO.java
+++ b/core/src/main/java/org/jruby/RubyIO.java
@@ -1068,7 +1068,7 @@ public class RubyIO extends RubyObject implements IOEncodable {
// We are creating a new IO object that shares the same
// IOHandler (and fileno).
try {
- return ChannelStream.fdopen(runtime, existingDescriptor, modes);
+ return ChannelStream.fdopen(runtime, existingDescriptor, modes, ecflags);
View gist:2671350c4f0ad6788c0a
Index: src/main/java/org/apache/maven/shared/release/phase/CheckDependencySnapshotsPhase.java
===================================================================
--- src/main/java/org/apache/maven/shared/release/phase/CheckDependencySnapshotsPhase.java (revision 1734625)
+++ src/main/java/org/apache/maven/shared/release/phase/CheckDependencySnapshotsPhase.java (working copy)
@@ -34,7 +34,6 @@
import org.apache.maven.artifact.ArtifactUtils;
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.artifact.InvalidDependencyVersionException;
import org.apache.maven.shared.release.ReleaseExecutionException;
View patch.diff
diff --git a/core/src/main/java/org/jruby/runtime/marshal/MarshalStream.java b/core/src/main/java/org/jruby/runtime/marshal/MarshalStream.java
index 4b14a54..b1b7a9a 100644
--- a/core/src/main/java/org/jruby/runtime/marshal/MarshalStream.java
+++ b/core/src/main/java/org/jruby/runtime/marshal/MarshalStream.java
@@ -46,6 +46,7 @@ import org.jruby.RubyArray;
import org.jruby.RubyBignum;
import org.jruby.RubyBoolean;
import org.jruby.RubyClass;
+import org.jruby.RubyEncoding;
import org.jruby.RubyFixnum;