Skip to content

Commit

Permalink
Showing 285 changed files with 30,977 additions and 1,956 deletions.
417 changes: 399 additions & 18 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:
53 changes: 0 additions & 53 deletions bin/jruby-cext-c

This file was deleted.

148 changes: 137 additions & 11 deletions ci.hocon
Original file line number Diff line number Diff line change
@@ -98,7 +98,7 @@ jruby-noindy-metrics: {
GUEST_VM: jruby,
GUEST_VM_CONFIG: noindy,
JRUBY_OPTS: "-Xclassic -Xcompile.invokedynamic=false",
MX_BENCHMARK_OPTS: --no-graal
MX_NO_GRAAL: "true"
}
}

@@ -107,7 +107,7 @@ jruby-noindy-benchmark: {
GUEST_VM: jruby,
GUEST_VM_CONFIG: noindy,
JRUBY_OPTS: "-Xclassic -X+C -Xcompile.invokedynamic=false",
MX_BENCHMARK_OPTS: --no-graal
MX_NO_GRAAL: "true"
}
}

@@ -116,7 +116,7 @@ jruby-indy-metrics: {
GUEST_VM: jruby,
GUEST_VM_CONFIG: indy,
JRUBY_OPTS: "-Xclassic -Xcompile.invokedynamic=true",
MX_BENCHMARK_OPTS: --no-graal
MX_NO_GRAAL: "true"
}
}

@@ -125,7 +125,7 @@ jruby-indy-benchmark: {
GUEST_VM: jruby,
GUEST_VM_CONFIG: indy,
JRUBY_OPTS: "-Xclassic -X+C -Xcompile.invokedynamic=true",
MX_BENCHMARK_OPTS: --no-graal
MX_NO_GRAAL: "true"
}
}

@@ -153,6 +153,12 @@ daily-bench-caps: {
timelimit: "02:00:00"
}

weekly-bench-caps: {
capabilities: [x52, linux]
targets: [weekly]
timelimit: "02:00:00"
}

post-process-and-upload-results: [
[tool/truffle/post-process-results-json.rb, bench-results.json, bench-results-processed.json],
[cat, bench-results-processed.json],
@@ -214,20 +220,127 @@ micro-benchmarks: {
] ${post-process-and-upload-results}
}

server-benchmarks: {
packages: {
"apache/ab": ">=2.3"
}

run: ${setup-benchmarks} [
[mx, benchmark, server]
] ${post-process-and-upload-results}
}

test-gems: {
environment: {
GEM_HOME: jruby-truffle-gem-test-pack/gems
}

setup: ${common-setup} [
[mx, sclone, --kind, git, "https://github.com/jruby/jruby-truffle-gem-test-pack.git", jruby-truffle-gem-test-pack]
]

run: [
${jt} [test, gems]
]
}

test-cexts: {
packages: {
llvm: "==3.3"
}

downloads: {
JVMCI_JAVA_HOME: {
name: labsjdk,
version: "8u92-jvmci-0.17",
platformspecific: true
}
}

setup: ${common-setup} [
[mv, mx.jruby, temp_mx],
[mkdir, sulong-workspace],
[cd, sulong-workspace],
[mx, sclone, --kind, git, "https://github.com/graalvm/sulong.git", sulong],
[cd, sulong],
[mx, sforceimports],
[mx, --java-home, "$JVMCI_JAVA_HOME", build],
[cd, ../..],
[mv, temp_mx, mx.jruby]
[mx, sclone, --kind, git, "https://github.com/jruby/jruby-truffle-gem-test-pack.git", jruby-truffle-gem-test-pack],
${jt} [build, cexts]
]

environment: {
GEM_HOME: jruby-truffle-gem-test-pack/gems
GRAAL_HOME: sulong-workspace/sulong,
SULONG_DIR: sulong-workspace/sulong,
USE_SYSTEM_CLANG: "true",
HOST_VM: server,
HOST_VM_CONFIG: graal-core
}

run: [
${jt} [test, specs, --graal, ":capi"],
${jt} [test, cexts]
]
}

chunky-benchmarks-x: {
run: [
[mx, benchmark, chunky]
] ${post-process-and-upload-results}
}

sulong-benchmarks: {
packages: {
llvm: "==3.3"
}

downloads: {
JVMCI_JAVA_HOME: {
name: labsjdk,
version: "8u92-jvmci-0.17",
platformspecific: true
}
}

setup: ${common-setup} [
[mv, mx.jruby, temp_mx],
[mkdir, sulong-workspace],
[cd, sulong-workspace],
[mx, sclone, --kind, git, "https://github.com/graalvm/sulong.git", sulong],
[cd, sulong],
[mx, sforceimports],
[mx, --java-home, "$JVMCI_JAVA_HOME", build],
[cd, ../..],
[mv, temp_mx, mx.jruby],
${jt} [build, cexts]
] ${setup-benchmarks} [
${jt} [cextc, all-ruby-benchmarks/chunky_png/oily_png]
]

environment: {
GRAAL_HOME: sulong-workspace/sulong,
SULONG_DIR: sulong-workspace/sulong,
USE_SYSTEM_CLANG: "true",
HOST_VM: server,
HOST_VM_CONFIG: graal-core,
USE_CEXTS: "true"
}
}

builds: [
{name: ruby-test-fast} ${common} ${gate-caps} {run: [${jt} [test, fast]]},
{name: ruby-test-tck} ${common} ${gate-caps} {run: [${jt} [test, tck]]},
{name: ruby-test-specs-command-line} ${common} ${gate-caps} {run: [${jt} [test, specs, ":command_line"]]},
{name: ruby-test-specs-language} ${common} ${gate-caps} {run: [${jt} [test, specs, ":language"]]},
{name: ruby-test-specs-core} ${common} ${gate-caps} {run: [${jt} [test, specs, ":core"]]},
{name: ruby-test-specs-library} ${common} ${gate-caps} {run: [${jt} [test, specs, ":library"]]},
{name: ruby-test-specs-truffle} ${common} ${gate-caps} {run: [${jt} [test, specs, ":truffle"]]},
{name: ruby-test-integration} ${common} ${gate-caps} {run: [${jt} [test, integration]]},
{name: ruby-test-gems} ${common} ${gate-caps} {
setup: ${common-setup} [[mx, sclone, --kind, git, "https://github.com/jruby/jruby-truffle-gem-test-pack.git", jruby-truffle-gem-test-pack]]
environment: {GEM_HOME: jruby-truffle-gem-test-pack/gems}
run: [${jt} [test, gems]]
},
{name: ruby-test-tck} ${common} ${gate-caps} {run: [${jt} [test, tck]]},
{name: ruby-test-cexts} ${common} ${gate-caps} ${test-cexts},
{name: ruby-test-gems} ${common} ${gate-caps} ${test-gems},
{name: ruby-test-tarball} ${common} ${gate-caps} {run: [${jt} [tarball]]},

{name: ruby-test-compiler-graal-core} ${common} ${graal-core} ${gate-caps} {run: [${jt} [test, compiler]]},
@@ -243,31 +356,44 @@ builds: [

{name: ruby-benchmarks-classic-noindy} ${common} ${no-graal} ${daily-bench-caps} ${jruby-noindy-benchmark} ${classic-benchmarks},
{name: ruby-benchmarks-classic-indy} ${common} ${no-graal} ${daily-bench-caps} ${jruby-indy-benchmark} ${classic-benchmarks},
{name: ruby-benchmarks-classic-no-graal} ${common} ${no-graal} ${weekly-bench-caps} ${jruby-truffle} ${classic-benchmarks},
{name: ruby-benchmarks-classic-graal-core} ${common} ${graal-core} ${bench-caps} ${jruby-truffle} ${classic-benchmarks},
{name: ruby-benchmarks-classic-graal-enterprise} ${common} ${graal-enterprise} ${bench-caps} ${jruby-truffle} ${classic-benchmarks},
{name: ruby-benchmarks-classic-graal-vm} ${common} ${graal-vm} ${daily-bench-caps} ${jruby-truffle} ${classic-benchmarks},

{name: ruby-benchmarks-chunky-noindy} ${common} ${no-graal} ${daily-bench-caps} ${jruby-noindy-benchmark} ${chunky-benchmarks},
{name: ruby-benchmarks-chunky-indy} ${common} ${no-graal} ${daily-bench-caps} ${jruby-indy-benchmark} ${chunky-benchmarks},
{name: ruby-benchmarks-chunky-no-graal} ${common} ${no-graal} ${weekly-bench-caps} ${jruby-truffle} ${chunky-benchmarks},
{name: ruby-benchmarks-chunky-graal-core} ${common} ${graal-core} ${bench-caps} ${jruby-truffle} ${chunky-benchmarks},
{name: ruby-benchmarks-chunky-graal-enterprise} ${common} ${graal-enterprise} ${bench-caps} ${jruby-truffle} ${chunky-benchmarks},
{name: ruby-benchmarks-chunky-graal-vm} ${common} ${graal-vm} ${daily-bench-caps} ${jruby-truffle} ${chunky-benchmarks},
//{name: ruby-benchmarks-chunky-sulong} ${common} ${sulong-benchmarks} ${gate-caps} ${jruby-truffle} ${chunky-benchmarks-x},

{name: ruby-benchmarks-psd-noindy} ${common} ${no-graal} ${daily-bench-caps} ${jruby-noindy-benchmark} ${psd-benchmarks},
{name: ruby-benchmarks-psd-indy} ${common} ${no-graal} ${daily-bench-caps} ${jruby-indy-benchmark} ${psd-benchmarks},
{name: ruby-benchmarks-psd-no-graal} ${common} ${no-graal} ${weekly-bench-caps} ${jruby-truffle} ${psd-benchmarks},
{name: ruby-benchmarks-psd-graal-core} ${common} ${graal-core} ${bench-caps} ${jruby-truffle} ${psd-benchmarks},
{name: ruby-benchmarks-psd-graal-enterprise} ${common} ${graal-enterprise} ${bench-caps} ${jruby-truffle} ${psd-benchmarks},
{name: ruby-benchmarks-psd-graal-vm} ${common} ${graal-vm} ${daily-bench-caps} ${jruby-truffle} ${psd-benchmarks},

{name: ruby-benchmarks-synthetic-noindy} ${common} ${no-graal} ${daily-bench-caps} ${jruby-noindy-benchmark} ${synthetic-benchmarks},
{name: ruby-benchmarks-synthetic-indy} ${common} ${no-graal} ${daily-bench-caps} ${jruby-indy-benchmark} ${synthetic-benchmarks},
{name: ruby-benchmarks-synthetic-no-graal} ${common} ${no-graal} ${weekly-bench-caps} ${jruby-truffle} ${synthetic-benchmarks},
{name: ruby-benchmarks-synthetic-graal-core} ${common} ${graal-core} ${bench-caps} ${jruby-truffle} ${synthetic-benchmarks},
{name: ruby-benchmarks-synthetic-graal-enterprise} ${common} ${graal-enterprise} ${bench-caps} ${jruby-truffle} ${synthetic-benchmarks},
{name: ruby-benchmarks-synthetic-graal-vm} ${common} ${graal-vm} ${daily-bench-caps} ${jruby-truffle} ${synthetic-benchmarks},

{name: ruby-benchmarks-micro-noindy} ${common} ${no-graal} ${daily-bench-caps} ${jruby-noindy-benchmark} ${micro-benchmarks},
{name: ruby-benchmarks-micro-indy} ${common} ${no-graal} ${daily-bench-caps} ${jruby-indy-benchmark} ${micro-benchmarks},
{name: ruby-benchmarks-micro-no-graal} ${common} ${no-graal} ${weekly-bench-caps} ${jruby-truffle} ${micro-benchmarks},
{name: ruby-benchmarks-micro-graal-core} ${common} ${graal-core} ${bench-caps} ${jruby-truffle} ${micro-benchmarks},
{name: ruby-benchmarks-micro-graal-enterprise} ${common} ${graal-enterprise} ${bench-caps} ${jruby-truffle} ${micro-benchmarks},
{name: ruby-benchmarks-micro-graal-vm} ${common} ${graal-vm} ${daily-bench-caps} ${jruby-truffle} ${micro-benchmarks}
{name: ruby-benchmarks-micro-graal-vm} ${common} ${graal-vm} ${daily-bench-caps} ${jruby-truffle} ${micro-benchmarks},

{name: ruby-benchmarks-server-noindy} ${common} ${no-graal} ${daily-bench-caps} ${jruby-noindy-benchmark} ${server-benchmarks},
{name: ruby-benchmarks-server-indy} ${common} ${no-graal} ${daily-bench-caps} ${jruby-indy-benchmark} ${server-benchmarks},
{name: ruby-benchmarks-server-no-graal} ${common} ${no-graal} ${weekly-bench-caps} ${jruby-truffle} ${server-benchmarks},
{name: ruby-benchmarks-server-graal-core} ${common} ${graal-core} ${bench-caps} ${jruby-truffle} ${server-benchmarks},
{name: ruby-benchmarks-server-graal-enterprise} ${common} ${graal-enterprise} ${bench-caps} ${jruby-truffle} ${server-benchmarks},
{name: ruby-benchmarks-server-graal-vm} ${common} ${graal-vm} ${daily-bench-caps} ${jruby-truffle} ${server-benchmarks}
]
2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/Main.java
Original file line number Diff line number Diff line change
@@ -465,7 +465,7 @@ private boolean checkStreamSyntax(Ruby runtime, InputStream in, String filename)
} catch (RaiseException re) {
if (re.getException().getMetaClass().getBaseName().equals("SyntaxError")) {
context.setErrorInfo($ex);
config.getError().println("SyntaxError in " + re.getException().message(runtime.getCurrentContext()));
config.getError().println("SyntaxError in " + re.getException().message(context));
return false;
}
throw re;
36 changes: 18 additions & 18 deletions core/src/main/java/org/jruby/Ruby.java
Original file line number Diff line number Diff line change
@@ -1240,10 +1240,10 @@ private void init() {
threadService.initMainThread();

// Get the main threadcontext (gets constructed for us)
ThreadContext tc = getCurrentContext();
final ThreadContext context = getCurrentContext();

// Construct the top-level execution frame and scope for the main thread
tc.prepareTopLevel(objectClass, topSelf);
context.prepareTopLevel(objectClass, topSelf);

// Initialize all the core classes
bootstrap();
@@ -1259,14 +1259,14 @@ private void init() {
// FIXME: This registers itself into static scope as a side-effect. Let's make this
// relationship handled either more directly or through a descriptice method
// FIXME: We need a failing test case for this since removing it did not regress tests
new IRScriptBody(irManager, "", tc.getCurrentScope().getStaticScope());
new IRScriptBody(irManager, "", context.getCurrentScope().getStaticScope());

// Initialize the "dummy" class used as a marker
dummyClass = new RubyClass(this, classClass);
dummyClass.freeze(tc);
dummyClass.freeze(context);

// Create global constants and variables
RubyGlobal.createGlobals(tc, this);
RubyGlobal.createGlobals(context, this);

// Prepare LoadService and load path
getLoadService().init(config.getLoadPaths());
@@ -1291,9 +1291,8 @@ && getInstanceConfig().getCompileMode() != CompileMode.TRUFFLE) {
isRestricted.set(null, false);
isRestricted.setAccessible(false);
} catch (Exception e) {
if (isDebug()) {
System.err.println("unable to enable unlimited-strength crypto");
e.printStackTrace();
if (isDebug() || LOG.isDebugEnabled()) {
LOG.debug("unable to enable unlimited-strength crypto", e);
}
}

@@ -1315,7 +1314,7 @@ && getInstanceConfig().getCompileMode() != CompileMode.TRUFFLE) {
initRubyPreludes();

// everything booted, so SizedQueue should be available; set up root fiber
ThreadFiber.initRootFiber(tc);
ThreadFiber.initRootFiber(context);
}

if(config.isProfiling()) {
@@ -1340,7 +1339,7 @@ && getInstanceConfig().getCompileMode() != CompileMode.TRUFFLE) {
// Require in all libraries specified on command line
if (getInstanceConfig().getCompileMode() != CompileMode.TRUFFLE) {
for (String scriptName : config.getRequiredLibraries()) {
topSelf.callMethod(getCurrentContext(), "require", RubyString.newString(this, scriptName));
topSelf.callMethod(context, "require", RubyString.newString(this, scriptName));
}
}
}
@@ -4362,18 +4361,19 @@ public ExecRecursiveParams() {}

private void recursivePush(IRubyObject list, IRubyObject obj, IRubyObject paired_obj) {
IRubyObject pair_list;
if(paired_obj == null) {
((RubyHash)list).op_aset(getCurrentContext(), obj, getTrue());
} else if((pair_list = ((RubyHash)list).fastARef(obj)) == null) {
((RubyHash)list).op_aset(getCurrentContext(), obj, paired_obj);
final ThreadContext context = getCurrentContext();
if (paired_obj == null) {
((RubyHash) list).op_aset(context, obj, getTrue());
} else if ((pair_list = ((RubyHash)list).fastARef(obj)) == null) {
((RubyHash) list).op_aset(context, obj, paired_obj);
} else {
if(!(pair_list instanceof RubyHash)) {
if (!(pair_list instanceof RubyHash)) {
IRubyObject other_paired_obj = pair_list;
pair_list = RubyHash.newHash(this);
((RubyHash)pair_list).op_aset(getCurrentContext(), other_paired_obj, getTrue());
((RubyHash)list).op_aset(getCurrentContext(), obj, pair_list);
((RubyHash) pair_list).op_aset(context, other_paired_obj, getTrue());
((RubyHash) list).op_aset(context, obj, pair_list);
}
((RubyHash)pair_list).op_aset(getCurrentContext(), paired_obj, getTrue());
((RubyHash)pair_list).op_aset(context, paired_obj, getTrue());
}
}

Loading

0 comments on commit 0180583

Please sign in to comment.