View snippit.java
public static ObjectAllocator specializeForVariables(RubyClass klass, Set<String> foundVariables) {
int size = foundVariables.size();
ClassAndAllocator cna = getClassForSize(size);
if (cna == null) {
final String clsPath = "org/jruby/gen/RubyObject" + size;
Class specialized;
synchronized (LOADER) {
try {
View Loop.java
public class Loop {
public static void main(String[] args) {
while (true) { }
}
}
View gist:f7fdf4a39b2233842afe1778ed4523bb
[] ~/projects/jruby $ cat min.rb
def low_min(a, b)
if a < b
a
else
b
end
end
def high_min(a, b)
View Gemfile.diff
diff --git a/Gemfile b/Gemfile
index 3db4f98f0a..75cd7943a3 100644
--- a/Gemfile
+++ b/Gemfile
@@ -3,7 +3,7 @@ source 'https://rubygems.org'
#source 'http://production.cf.rubygems.org'
# does not install in linux ATM, so hack this for now
-gem 'bootsnap', require: false
+gem 'bootsnap', require: false, platform: :mri
View listing.txt
[] ~/projects/ruby $ ls /var/folders/y0/b32crdwx1zvb9zvq3w_ccny80000gn/T/*mjit*
/var/folders/y0/b32crdwx1zvb9zvq3w_ccny80000gn/T/_ruby_mjit_hp20901u0.h.gch
/var/folders/y0/b32crdwx1zvb9zvq3w_ccny80000gn/T/_ruby_mjit_p20901u0.bundle
/var/folders/y0/b32crdwx1zvb9zvq3w_ccny80000gn/T/_ruby_mjit_p20901u0.c
/var/folders/y0/b32crdwx1zvb9zvq3w_ccny80000gn/T/_ruby_mjit_p20901u1.bundle
/var/folders/y0/b32crdwx1zvb9zvq3w_ccny80000gn/T/_ruby_mjit_p20901u1.c
/var/folders/y0/b32crdwx1zvb9zvq3w_ccny80000gn/T/_ruby_mjit_p20901u10.bundle
/var/folders/y0/b32crdwx1zvb9zvq3w_ccny80000gn/T/_ruby_mjit_p20901u10.c
/var/folders/y0/b32crdwx1zvb9zvq3w_ccny80000gn/T/_ruby_mjit_p20901u100.bundle
/var/folders/y0/b32crdwx1zvb9zvq3w_ccny80000gn/T/_ruby_mjit_p20901u100.c
View gist:5c3b25bdd1fbca47513416223e82861a
Hotspot:
root@87006c934ea0:~/jruby# time jruby -e 1
real 0m1.469s
user 0m3.440s
sys 0m0.210s
root@87006c934ea0:~/jruby# time jruby -e 1
View bench.java
private static final Method nop1;
private static final MethodHandle nop2;
private static final MethodHandle nop3;
static {
Method _nop1 = null;
MethodHandle _nop2 = null;
MethodHandle _nop3 = null;
try {
_nop1 = Hello.class.getMethod("nop", long.class);
View bloop
[] ~/projects/jruby $ cat > wacky.c
#include <stdio.h>
int main() {
printf("this " "is " "a " "C " "thing" "\n");
return 0;
}
^D
[] ~/projects/jruby $ gcc wacky.c ; ./a.out
this is a C thing
View Hello.java
import java.lang.invoke.MethodHandles;
import java.lang.invoke.MethodType;
public class Hello {
private static final MethodHandles.Lookup lookup = MethodHandles.lookup();
public static void main(String[] args) throws Throwable {
System.out.println("Hello, " + args[0]);
}
View gist:88d7f5449049794e286aab364de9830d
From https://travis-ci.org/jruby/jruby/jobs/325348807
```
[exec] 1. [1/2] Assertion for "stdout"
[exec] | <["[fcall(proc,[],&block([],[unary(!,ref(y))]))]"]> expected but was
[exec] | <["#",
[exec] | "# There is insufficient memory for the Java Runtime Environment to continue.",
[exec] | "# Native memory allocation (mmap) failed to map 262144 bytes for committing reserved memory.",
[exec] | "# An error report file with more information is saved as:",
[exec] | "# /home/travis/build/jruby/jruby/hs_err_pid14318.log"]>.