Skip to content

Instantly share code, notes, and snippets.

Charles Oliver Nutter headius

Block or report user

Report or block headius

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@headius
headius / BRANCH
Created Jun 25, 2019
Latest startup comparison with load service branch
View BRANCH
[--dev] ~/projects/jruby $ time jruby -e 1 > /dev/null
real 0m2.086s
user 0m2.063s
sys 0m0.322s
[--dev] ~/projects/jruby $ time jruby -e 1 > /dev/null
real 0m1.482s
user 0m2.029s
View ConditionVariable#broadcast as JVM (+indy) bytecode
// access flags 0x9
public static RUBY$method$broadcast$7(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;
TRYCATCHBLOCK L0 L1 L1 java/lang/Throwable
TRYCATCHBLOCK L1 L2 L2 java/lang/Throwable
L3
NOP
ALOAD 0
ALOAD 4
ALOAD 5
ALOAD 2
@headius
headius / gist:4405fae8ffbb6de778443582bfe36655
Created Mar 16, 2019
Graal JIT error during benchmark of JRuby+Rails
View gist:4405fae8ffbb6de778443582bfe36655
[Use -Dgraal.LogFile=<path> to redirect Graal log output to a file.]
Thread[JVMCI CompilerThread2,9,system]: Compilation of Users.headius.projects.jruby.lib.ruby.stdlib.monitor.RUBY$method$broadcast$0(ThreadContext, StaticScope, IRubyObject, Block, RubyModule, String) failed:
org.graalvm.compiler.graph.GraalGraphError: Invalid frame state 87|FrameState@-3[AFTER_BCI]
at node: 2312|Read
at org.graalvm.compiler.hotspot.HotSpotDebugInfoBuilder.raiseInvalidFrameStateError(HotSpotDebugInfoBuilder.java:122)
at org.graalvm.compiler.hotspot.HotSpotDebugInfoBuilder.computeFrameForState(HotSpotDebugInfoBuilder.java:92)
at org.graalvm.compiler.core.gen.DebugInfoBuilder.build(DebugInfoBuilder.java:101)
at org.graalvm.compiler.core.gen.NodeLIRBuilder.stateForWithExceptionEdge(NodeLIRBuilder.java:748)
at org.graalvm.compiler.core.gen.NodeLIRBuilder.stateFor(NodeLIRBuilder.java:740)
at org.graalvm.compiler.core.gen.NodeLIRBuilder.state(NodeLIRBuilder.java:729)
@headius
headius / gist:a2e858daa0a5f62f112de57684c3d1c3
Last active Feb 7, 2019
Wouldn't it be nice if Java allowed normal shebangs?
View gist:a2e858daa0a5f62f112de57684c3d1c3
# Shebangs are supported in Java 11, but only if:
# * You pass "--source 11" to a fully-qualifed `java` command.
# * The script does *not* end with .java.
[] ~/projects/jruby $ cat Blah.java
public class Blah {
public static void main(String[] args) {
return;
}
}
View .diff
diff --git a/lib/ruby/stdlib/tracer.rb b/lib/ruby/stdlib/tracer.rb
index faafd803f4..0dc6fa8f51 100644
--- a/lib/ruby/stdlib/tracer.rb
+++ b/lib/ruby/stdlib/tracer.rb
@@ -260,7 +260,7 @@ class Tracer
# "Kernel" == klass.to_s
# end
- def Tracer.add_filter(p = proc)
+ def Tracer.add_filter(&p)
@headius
headius / gist:deaf944f8447645b534507451be72a82
Created Dec 6, 2018
Comparison of JRuby stack trace versus the raw JVM trace underneath
View gist:deaf944f8447645b534507451be72a82
[] ~/projects/jruby $ jruby -e "def foo; 1.times { raise }; end; class Blah; [1].each { foo }; end"
RuntimeError: No current exception
foo at -e:1
foo at -e:1
Blah at -e:1
each at org/jruby/RubyArray.java:1792
<module:Blah> at -e:1
<main> at -e:1
[] ~/projects/jruby $ jruby -Xbacktrace.style=raw -e "def foo; 1.times { raise }; end; class Blah; [1].each { foo }; end"
View blah.md

This security release updates the native Windows "jruby" executables shipped in the bin directory. We received a report that several virus scanners will flag one of these executables, jrubyw.exe, as containing a virus. We scanned the systems used for building those executables, and were unable to find any evidence of infection, but as a precaution we have rebuilt those binaries on a known clean system for this release.

We have released JRuby 9.2.4.1 to address virus warnings about one of the Windows executables we ship. No other evidence of infection, but better safe than sorry!

View .diff
diff --git a/core/src/main/java/org/jruby/RubyEncoding.java b/core/src/main/java/org/jruby/RubyEncoding.java
index f327459c89..daa8b21acd 100755
--- a/core/src/main/java/org/jruby/RubyEncoding.java
+++ b/core/src/main/java/org/jruby/RubyEncoding.java
@@ -58,6 +58,8 @@ import org.jruby.util.StringSupport;
import org.jruby.util.io.EncodingUtils;
import org.jruby.util.unsafe.UnsafeHolder;
+import static org.jruby.util.io.ChannelHelper.clearBuffer;
+
@headius
headius / gist:a7e1e819555f53f892947795c12f7983
Created Oct 31, 2018
oracle-enhanced adapter failures on jruby@081d774d15e4e61bb47137c8fe0d6543d1f872ab
View gist:a7e1e819555f53f892947795c12f7983
This file has been truncated, but you can view the full file.
Coverage may be inaccurate; set the "--debug" command line option, or do JRUBY_OPTS="--debug" or set the "debug.fullTrace=true" option in your .jrubyrc
/home/vagrant/.rbenv/versions/jruby-9.2.1.0-dev/lib/ruby/gems/shared/bundler/gems/simplecov-994dbff2780a/lib/simplecov.rb:53: warning: tracing (e.g. set_trace_func) will not capture all events without --debug flag
==> Loading config from ENV or use default
==> Running specs with JRuby version 9.2.1.0-SNAPSHOT
/home/vagrant/.rbenv/versions/jruby-9.2.1.0-dev/lib/ruby/gems/shared/bundler/gems/rails-abda6fc3e82b/activerecord/lib/active_record/connection_handling.rb:113: warning: shadowing outer local variable - role
/home/vagrant/.rbenv/versions/jruby-9.2.1.0-dev/lib/ruby/gems/shared/bundler/gems/ruby-plsql-914c46ab36d2/lib/plsql/jdbc_connection.rb:225: warning: constant ::Fixnum is deprecated
View gist:b46011747891bdce3664ad374ed3dac0
[] ~/projects/jruby $ pickjdk 6
New JDK: jdk1.8.0_181.jdk
[] ~/projects/jruby $ time jruby -e 1
real 0m2.013s
user 0m5.435s
sys 0m0.276s
[] ~/projects/jruby $ time jruby --dev -e 1
You can’t perform that action at this time.