Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jruby/jruby
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: c3017e20358d
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: df3434483c97
Choose a head ref

Commits on Dec 9, 2016

  1. Copy the full SHA
    87d63a0 View commit details
  2. [Truffle] Fix broken mx.

    chrisseaton committed Dec 9, 2016
    Copy the full SHA
    a97a93f View commit details
  3. Copy the full SHA
    d6d3202 View commit details

Commits on Dec 10, 2016

  1. Revert "[Truffle] We don't seem to need ASM."

    This reverts commit d6d3202.
    chrisseaton committed Dec 10, 2016
    Copy the full SHA
    0eeba7d View commit details
  2. Copy the full SHA
    3dfe29c View commit details
  3. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    39ecd01 View commit details
  4. Copy the full SHA
    ffba0e4 View commit details
  5. Copy the full SHA
    6663035 View commit details
  6. Copy the full SHA
    1697564 View commit details
  7. [Truffle] Remove Sprintf.

    chrisseaton committed Dec 10, 2016
    Copy the full SHA
    ee66d69 View commit details
  8. Copy the full SHA
    b93ef00 View commit details
  9. Copy the full SHA
    b32827b View commit details
  10. Copy the full SHA
    ec867e3 View commit details
  11. Copy the full SHA
    5943d07 View commit details
  12. Copy the full SHA
    90b9176 View commit details
  13. Copy the full SHA
    bf8637b View commit details
  14. Copy the full SHA
    e63c3d8 View commit details
  15. Copy the full SHA
    a5a0d23 View commit details
  16. Copy the full SHA
    40ab461 View commit details
  17. Copy the full SHA
    aadb06a View commit details
  18. Copy the full SHA
    35c11f9 View commit details
  19. Copy the full SHA
    6c8e051 View commit details
  20. [Truffle] Fix mx warning.

    chrisseaton committed Dec 10, 2016
    Copy the full SHA
    c4120ac View commit details
  21. Copy the full SHA
    1fb4b4a View commit details
  22. Copy the full SHA
    8ed664f View commit details
  23. Copy the full SHA
    26a6822 View commit details
  24. Copy the full SHA
    ca459dd View commit details
  25. Copy the full SHA
    9fa0bdc View commit details
  26. Copy the full SHA
    f8cde15 View commit details
  27. Copy the full SHA
    0338914 View commit details
  28. Copy the full SHA
    c6176a5 View commit details
  29. Copy the full SHA
    2a7c4dd View commit details
  30. Copy the full SHA
    bbfa92e View commit details
  31. Copy the full SHA
    04287d8 View commit details
  32. [Truffle] Rename for clarity.

    eregon committed Dec 10, 2016
    Copy the full SHA
    98d3f35 View commit details
  33. [Truffle] Simplify and inline.

    * GregorianCalendar.from(ZonedDateTime) already has the right defaults.
    eregon committed Dec 10, 2016
    Copy the full SHA
    9281dcb View commit details
  34. Copy the full SHA
    b9b7586 View commit details
  35. [Truffle] We no longer need joda-time.

    * Java 8's time API is used instead.
    eregon committed Dec 10, 2016
    Copy the full SHA
    c9eb0d8 View commit details
  36. Copy the full SHA
    fd6e410 View commit details
  37. Copy the full SHA
    80fc5b5 View commit details
  38. Copy the full SHA
    74aef4e View commit details
  39. Copy the full SHA
    d47bae0 View commit details
  40. Copy the full SHA
    04473f1 View commit details
  41. Copy the full SHA
    3d78fb2 View commit details
  42. Copy the full SHA
    939f18f View commit details
  43. Copy the full SHA
    ddc4db5 View commit details
  44. Copy the full SHA
    b3aee53 View commit details
  45. Copy the full SHA
    530f3b1 View commit details

Commits on Dec 11, 2016

  1. Copy the full SHA
    cd313f3 View commit details
  2. Copy the full SHA
    dedab2c View commit details
Showing 988 changed files with 13,161 additions and 19,318 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -35,6 +35,7 @@ env:
- PHASE='-Prake -Dtask=test:jruby'
- PHASE='-Prake -Dtask=test:jruby:fullint'
- PHASE='-Prake -Dtask=test:jruby:jit'
- PHASE='-Prake -Dtask=test:jruby:aot'
- PHASE='-Prake -Dtask=test:mri'
- PHASE='-Prake -Dtask=test:mri:fullint'
- PHASE='-Prake -Dtask=test:mri:jit'
4 changes: 2 additions & 2 deletions COPYING
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
JRuby is Copyright (c) 2007-2016 The JRuby project, and is released
JRuby is Copyright (c) 2007-2017 The JRuby project, and is released
under a tri EPL/GPL/LGPL license. You can use it, redistribute it
and/or modify it under the terms of the:

@@ -12,7 +12,7 @@ bytelist (http://github.com/jruby/bytelist),
yydebug (http://svn.codehaus.org/jruby/trunk/jay/yydebug)
are released under the same copyright/license.

The Truffle component is copyright (c) 2013-2016 Oracle and/or its
The Truffle component is copyright (c) 2013-2017 Oracle and/or its
affiliates and is released under the same licenses.

The Truffle component also distributes:
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9.1.7.0-SNAPSHOT
9.1.8.0-SNAPSHOT
5 changes: 4 additions & 1 deletion bin/jruby-truffle-tool
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
#!/usr/bin/env bash

exec `dirname $BASH_SOURCE[0]`/jruby `dirname $BASH_SOURCE[0]`/../lib/ruby/truffle/jruby-truffle-tool/bin/jruby-truffle-tool "$@"
bin="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
root="$(dirname "$bin")"

exec $bin/jruby $root/lib/ruby/truffle/jruby-truffle-tool/bin/jruby-truffle-tool "$@"
2 changes: 1 addition & 1 deletion ci.hocon
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@ graal-vm: {
downloads: {
GRAALVM_DIR: {
name: graalvm-release,
version: "0.18",
version: "0.19",
platformspecific: true
}
}
12 changes: 2 additions & 10 deletions core/pom.rb
Original file line number Diff line number Diff line change
@@ -13,9 +13,6 @@
'tzdata.version' => '2013d',
'tzdata.scope' => 'provided',

'unsafe.version' => '8.92.1',
'unsafe.jar' => '${settings.localRepository}/com/headius/unsafe-mock/${unsafe.version}/unsafe-mock-${unsafe.version}.jar',

'maven.build.timestamp.format' => 'yyyy-MM-dd',
'maven.test.skip' => 'true',
'build.date' => '${maven.build.timestamp}',
@@ -49,7 +46,7 @@
jar 'com.github.jnr:jnr-enxio:0.14', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-x86asm:1.0.2', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-unixsocket:0.15', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-posix:3.0.33', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-posix:3.0.34-SNAPSHOT', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-constants:0.9.6', :exclusions => ['com.github.jnr:jnr-ffi']
jar 'com.github.jnr:jnr-ffi:2.1.2'
jar 'com.github.jnr:jffi:${jffi.version}'
@@ -62,8 +59,7 @@

jar 'com.headius:invokebinder:1.7'
jar 'com.headius:options:1.4'
jar 'com.headius:coro-mock:1.0', :scope => 'provided'
jar 'com.headius:unsafe-mock', '${unsafe.version}', :scope => 'provided'
jar 'com.headius:unsafe-fences:1.0'

jar 'bsf:bsf:2.4.0', :scope => 'provided'
jar 'com.jcraft:jzlib:1.1.3'
@@ -192,17 +188,13 @@
'compilerArgs' => [ '-XDignore.symbol.file=true',
'-J-Duser.language=en',
'-J-Dfile.encoding=UTF-8',
'-J-Xbootclasspath/p:${unsafe.jar}',
'-Xbootclasspath/p:${unsafe.jar}',
'-J-Xmx${jruby.compile.memory}' ] )
execute_goals( 'compile',
:id => 'populators',
:phase => 'process-classes',
'compilerArgs' => [ '-XDignore.symbol.file=true',
'-J-Duser.language=en',
'-J-Dfile.encoding=UTF-8',
'-J-Xbootclasspath/p:${unsafe.jar}',
'-Xbootclasspath/p:${unsafe.jar}',
'-J-Xmx${jruby.compile.memory}' ],
'includes' => [ 'org/jruby/gen/**/*.java' ] )
execute_goals( 'compile',
19 changes: 3 additions & 16 deletions core/pom.xml
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ DO NOT MODIFIY - GENERATED CODE
<parent>
<groupId>org.jruby</groupId>
<artifactId>jruby-parent</artifactId>
<version>9.1.7.0-SNAPSHOT</version>
<version>9.1.8.0-SNAPSHOT</version>
</parent>
<artifactId>jruby-core</artifactId>
<name>JRuby Core</name>
@@ -22,7 +22,6 @@ DO NOT MODIFIY - GENERATED CODE
<spec.tags.dir>${spec.dir}/tags</spec.tags.dir>
<polyglot.dump.pom>pom.xml</polyglot.dump.pom>
<pkg.dir>${build.dir}/pkg</pkg.dir>
<unsafe.jar>${settings.localRepository}/com/headius/unsafe-mock/${unsafe.version}/unsafe-mock-${unsafe.version}.jar</unsafe.jar>
<spec.dir>spec</spec.dir>
<maven.build.timestamp.format>yyyy-MM-dd</maven.build.timestamp.format>
<jruby.test.memory.permgen>2G</jruby.test.memory.permgen>
@@ -41,7 +40,6 @@ DO NOT MODIFIY - GENERATED CODE
<jruby.launch.memory>1024M</jruby.launch.memory>
<jruby.compile.memory>2G</jruby.compile.memory>
<version.ruby.major>2.3</version.ruby.major>
<unsafe.version>8.92.1</unsafe.version>
<release.dir>release</release.dir>
<create.sources.jar>false</create.sources.jar>
<lib.dir>lib</lib.dir>
@@ -137,7 +135,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>com.github.jnr</groupId>
<artifactId>jnr-posix</artifactId>
<version>3.0.33</version>
<version>3.0.34-SNAPSHOT</version>
<exclusions>
<exclusion>
<artifactId>jnr-ffi</artifactId>
@@ -204,15 +202,8 @@ DO NOT MODIFIY - GENERATED CODE
</dependency>
<dependency>
<groupId>com.headius</groupId>
<artifactId>coro-mock</artifactId>
<artifactId>unsafe-fences</artifactId>
<version>1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.headius</groupId>
<artifactId>unsafe-mock</artifactId>
<version>${unsafe.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>bsf</groupId>
@@ -496,8 +487,6 @@ DO NOT MODIFIY - GENERATED CODE
<compilerArg>-XDignore.symbol.file=true</compilerArg>
<compilerArg>-J-Duser.language=en</compilerArg>
<compilerArg>-J-Dfile.encoding=UTF-8</compilerArg>
<compilerArg>-J-Xbootclasspath/p:${unsafe.jar}</compilerArg>
<compilerArg>-Xbootclasspath/p:${unsafe.jar}</compilerArg>
<compilerArg>-J-Xmx${jruby.compile.memory}</compilerArg>
</compilerArgs>
</configuration>
@@ -513,8 +502,6 @@ DO NOT MODIFIY - GENERATED CODE
<compilerArg>-XDignore.symbol.file=true</compilerArg>
<compilerArg>-J-Duser.language=en</compilerArg>
<compilerArg>-J-Dfile.encoding=UTF-8</compilerArg>
<compilerArg>-J-Xbootclasspath/p:${unsafe.jar}</compilerArg>
<compilerArg>-Xbootclasspath/p:${unsafe.jar}</compilerArg>
<compilerArg>-J-Xmx${jruby.compile.memory}</compilerArg>
</compilerArgs>
<includes>
33 changes: 33 additions & 0 deletions core/src/main/java/org/jruby/ObjectFlags.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package org.jruby;

import org.jruby.ext.stringio.StringIO;

/**
* Flags used by RubyBasicObject descendants.
*/
public interface ObjectFlags {
FlagRegistry registry = new FlagRegistry();

// These flags must be registered from top of hierarchy down to maintain order.
// TODO: Replace these during the build with their calculated values.
int FALSE_F = registry.newFlag(RubyBasicObject.class);
int NIL_F = registry.newFlag(RubyBasicObject.class);
int FROZEN_F = registry.newFlag(RubyBasicObject.class);
int TAINTED_F = registry.newFlag(RubyBasicObject.class);

int CACHEPROXY_F = registry.newFlag(RubyModule.class);
int NEEDSIMPL_F = registry.newFlag(RubyModule.class);
int REFINED_MODULE_F = registry.newFlag(RubyModule.class);
int IS_OVERLAID_F = registry.newFlag(RubyModule.class);

int CR_7BIT_F = registry.newFlag(RubyString.class);
int CR_VALID_F = registry.newFlag(RubyString.class);

int STRIO_READABLE = registry.newFlag(StringIO.class);
int STRIO_WRITABLE = registry.newFlag(StringIO.class);

int MATCH_BUSY = registry.newFlag(RubyMatchData.class);

int COMPARE_BY_IDENTITY_F = registry.newFlag(RubyHash.class);
int PROCDEFAULT_HASH_F = registry.newFlag(RubyHash.class);
}
44 changes: 25 additions & 19 deletions core/src/main/java/org/jruby/Ruby.java
Original file line number Diff line number Diff line change
@@ -2862,16 +2862,11 @@ public void loadFile(String scriptName, InputStream in, boolean wrap) {
ThreadContext.pushBacktrace(context, "(root)", file, 0);
context.preNodeEval(self);
ParseResult parseResult = parseFile(scriptName, in, null);
RootNode root = (RootNode) parseResult;

if (wrap) {
// toss an anonymous module into the search path
RubyModule wrapper = RubyModule.newModule(this);
((RubyBasicObject)self).extend(new IRubyObject[] {wrapper});
RootNode root = (RootNode) parseResult;
StaticScope top = root.getStaticScope();
StaticScope newTop = staticScopeFactory.newLocalScope(null);
top.setPreviousCRefScope(newTop);
top.setModule(wrapper);
wrapRootForLoad((RubyBasicObject) self, root);
}

runInterpreter(context, parseResult, self);
@@ -2903,24 +2898,39 @@ public void loadScope(IRScope scope, boolean wrap) {
}

public void compileAndLoadFile(String filename, InputStream in, boolean wrap) {
InputStream readStream = in;

// script was not found in cache above, so proceed to compile
RootNode scriptNode = (RootNode) parseFile(readStream, filename, null);

IRubyObject self = wrap ? getTopSelf().rbClone() : getTopSelf();
ThreadContext context = getCurrentContext();
InputStream readStream = in;

String oldFile = context.getFile();
int oldLine = context.getLine();
try {
context.setFileAndLine(scriptNode.getFile(), scriptNode.getLine());
context.preNodeEval(self);
ParseResult parseResult = parseFile(filename, in, null);
RootNode root = (RootNode) parseResult;

runNormally(scriptNode, wrap);
if (wrap) {
wrapRootForLoad((RubyBasicObject) self, root);
} else {
root.getStaticScope().setModule(getObject());
}

runNormally(root, wrap);
} finally {
context.setFileAndLine(oldFile, oldLine);
context.postNodeEval();
}
}

private void wrapRootForLoad(RubyBasicObject self, RootNode root) {
// toss an anonymous module into the search path
RubyModule wrapper = RubyModule.newModule(this);
self.extend(new IRubyObject[] {wrapper});
StaticScope top = root.getStaticScope();
StaticScope newTop = staticScopeFactory.newLocalScope(null);
top.setPreviousCRefScope(newTop);
top.setModule(wrapper);
}

public void loadScript(Script script) {
loadScript(script, false);
}
@@ -3167,10 +3177,6 @@ public void tearDown(boolean systemExit) {

final ThreadContext context = getCurrentContext();

// Disable event hooks during runtime teardown
// This avoids deadlocks if some other thread is holding a debugger lock while we're trying to exit
context.setEventHooksEnabled(false);

// FIXME: 73df3d230b9d92c7237d581c6366df1b92ad9b2b exposed no toplevel scope existing anymore (I think the
// bogus scope I removed was playing surrogate toplevel scope and wallpapering this bug). For now, add a
// bogus scope back for at_exit block run. This is buggy if at_exit is capturing vars.
62 changes: 30 additions & 32 deletions core/src/main/java/org/jruby/RubyArray.java
Original file line number Diff line number Diff line change
@@ -71,6 +71,7 @@

import java.io.IOException;
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Comparator;
@@ -2457,20 +2458,17 @@ protected RubyArray safeReverse() {
/** rb_ary_collect
*
*/
public IRubyObject collect(ThreadContext context, Block block) {
final Ruby runtime = context.runtime;
public RubyArray collect(ThreadContext context, Block block) {
if (!block.isGiven()) return makeShared();

final Ruby runtime = context.runtime;
IRubyObject[] arr = new IRubyObject[realLength];

return collectFrom(context, arr, 0, block);
}

protected IRubyObject collectFrom(ThreadContext context, IRubyObject[] arr, int i, Block block) {
for (i = 0; i < realLength; i++) {
int i = 0;
for (; i < realLength; i++) {
// Do not coarsen the "safe" check, since it will misinterpret AIOOBE from the yield
// See JRUBY-5434
arr[i] = block.yield(context, eltOk(i));
safeArraySet(runtime, arr, i, block.yield(context, eltOk(i))); // arr[i] = ...
}

// use iteration count as new size in case something was deleted along the way
@@ -2664,7 +2662,7 @@ public IRubyObject delete_at(int pos) {
modify();

IRubyObject nil = getRuntime().getNil();
IRubyObject obj = null; // should never return null below
IRubyObject obj;

try {
obj = values[begin + pos];
@@ -2681,7 +2679,7 @@ public IRubyObject delete_at(int pos) {
}

System.arraycopy(values, begin + pos + 1, values, begin + pos, len - (pos + 1));
values[begin + len - 1] = getRuntime().getNil();
values[begin + len - 1] = nil;
} catch (ArrayIndexOutOfBoundsException e) {
throw concurrentModification(getRuntime(), e);
}
@@ -3024,46 +3022,46 @@ protected boolean flatten(ThreadContext context, final int level, final RubyArra
// TODO: (CON) We can flatten packed versions efficiently if length does not change (e.g. [[1,2],[]])
unpack();
final Ruby runtime = context.runtime;
RubyArray stack = newArrayLight(runtime, ARRAY_DEFAULT_SIZE);
IdentityHashMap<Object, Object> memo = new IdentityHashMap<Object, Object>();
RubyArray ary = this;
memo.put(ary, NEVER);
boolean modified = false;

ArrayList<Object> stack = null;
IdentityHashMap<RubyArray, IRubyObject> memo = null; // used as an IdentityHashSet

RubyArray ary = this;
int i = 0;

try {
while (true) {
IRubyObject tmp;
while (i < ary.realLength) {
IRubyObject elt = ary.eltOk(i++);
if (level >= 0 && stack.size() / 2 >= level) {
if (level >= 0 && (stack == null ? 0 : stack.size()) / 2 >= level) {
result.append(elt);
continue;
}
tmp = TypeConverter.checkArrayType(elt);
if (tmp.isNil()) {
result.append(elt);
} else {
modified = true;
IRubyObject tmp = TypeConverter.checkArrayType(elt);
if (tmp.isNil()) result.append(elt);
else { // nested array element
if (memo == null) {
memo = new IdentityHashMap<>(4 + 1);
memo.put(this, NEVER);
}
if (memo.get(tmp) != null) throw runtime.newArgumentError("tried to flatten recursive array");
memo.put(tmp, NEVER);
stack.append(ary);
stack.append(RubyFixnum.newFixnum(runtime, i));
ary = (RubyArray)tmp;
if (stack == null) stack = new ArrayList<>(8); // fine hold 4-level deep nesting
stack.add(ary); stack.add(i); // add (ary, i) pair
ary = (RubyArray) tmp;
memo.put(ary, NEVER);
i = 0;
}
}
if (stack.realLength == 0) break;
memo.remove(ary);
tmp = stack.pop(context);
i = (int) ((RubyFixnum) tmp).getLongValue();
ary = (RubyArray) stack.pop(context);
if (stack == null || stack.size() == 0) break;
memo.remove(ary); // memo != null since stack != null
final int s = stack.size(); // pop (ary, i)
i = (Integer) stack.remove(s - 1);
ary = (RubyArray) stack.remove(s - 2);
}
} catch (ArrayIndexOutOfBoundsException ex) {
throw concurrentModification(context.runtime, ex);
}
return modified;
return stack != null;
}

@JRubyMethod(name = "flatten!")
Loading