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: 457a84a8edb8
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 7addc754609a
Choose a head ref

Commits on Jul 6, 2015

  1. adds rmvn command since it comes with ruby-maven and make regular bin…

    …/mvn inside the gem executable
    mkristian committed Jul 6, 2015
    Copy the full SHA
    d0a2955 View commit details
  2. use user.dir as CWD when code is inside a jar on backquote execution

    when inside a jar the CWD is uri:classloader:/ and executing a system
    command can not change into this CWD. use java system property user.dir
    in such a case
    
    Sponsored by Lookout Inc.
    mkristian committed Jul 6, 2015
    Copy the full SHA
    1fd27e6 View commit details
  3. Copy the full SHA
    08ecc3c View commit details

Commits on Jul 7, 2015

  1. Bump for 1.7.21

    enebo committed Jul 7, 2015
    Copy the full SHA
    e5955c8 View commit details
  2. Off by one error in proc to interface optimization for 2 and 3 arity …

    …paths (still missing test)
    enebo committed Jul 7, 2015
    1
    Copy the full SHA
    a741a82 View commit details
  3. Copy the full SHA
    424661f View commit details

Commits on Jul 8, 2015

  1. Copy the full SHA
    d51c9bf View commit details
  2. Update for next dev cycle

    enebo committed Jul 8, 2015
    Copy the full SHA
    bcc9b29 View commit details
  3. Copy the full SHA
    8e4b0bd View commit details

Commits on Jul 9, 2015

  1. Copy the full SHA
    6182486 View commit details

Commits on Jul 10, 2015

  1. Copy the full SHA
    207b8be View commit details

Commits on Jul 13, 2015

  1. [Truffle] Allow RubyBasicObject to go through FixnumLowerNode.

    * The missing specialization error will catch it anyway.
    * Fixes issue in the string_pattern primitive.
    eregon committed Jul 13, 2015
    Copy the full SHA
    2d142da View commit details
  2. [Truffle] Refactor RangeLiteralNode.

    * Create lowered ranges (IntegerFixnumRange) directly.
    eregon committed Jul 13, 2015
    Copy the full SHA
    a347363 View commit details
  3. [Truffle] Remove the lowering of ranges from FixnumLowerNode.

    * It is done eagerly at creation time now.
    eregon committed Jul 13, 2015
    Copy the full SHA
    68a1d95 View commit details
  4. Improve Thread#wakeup spec

    eregon committed Jul 13, 2015
    Copy the full SHA
    9888ee5 View commit details
  5. [Truffle] Tag flaky spec.

    eregon committed Jul 13, 2015
    Copy the full SHA
    d9a309e View commit details
  6. [Truffle] Replace the legacy FixnumLowerNode with NewFixnumLowerNode.

    * Also let any other object pass through,
      the specializations will deal with it.
    eregon committed Jul 13, 2015
    Copy the full SHA
    5c8c448 View commit details
  7. Copy the full SHA
    b91c9ed View commit details
  8. Copy the full SHA
    de7597b View commit details

Commits on Jul 14, 2015

  1. Copy the full SHA
    3b68bdb View commit details
  2. Copy the full SHA
    2a6a6f5 View commit details
  3. Copy the full SHA
    cef1af3 View commit details
  4. make sure -Dorg.jruby.embed.compat.version=1.8 works

    with (JSR223) scripting-container (fixes #1365)
    kares committed Jul 14, 2015
    Copy the full SHA
    05531ea View commit details
  5. Copy the full SHA
    fe236a6 View commit details
  6. [Truffle] Make ThreadManager.runOnce() private.

    * This is just an internal helper, there is no valid use case
      for stopping a blocking action based on any interrupt() or guest safepoint.
    eregon committed Jul 14, 2015
    Copy the full SHA
    79e2bd4 View commit details
  7. Copy the full SHA
    7e89610 View commit details
  8. [Truffle] Use a separate flag for waking up a thread.

    * Thread#{wakeup,run} only interrupts #sleep and Thread.stop.
    * Simplifies a lot interactions between the status and blocking actions.
    * Fixes #3131.
    eregon committed Jul 14, 2015
    Copy the full SHA
    dfc5f8a View commit details
  9. Copy the full SHA
    2eca2cb View commit details
  10. Copy the full SHA
    27d7722 View commit details
  11. Copy the full SHA
    b994c1c View commit details
  12. 3
    Copy the full SHA
    35153eb View commit details
  13. Copy the full SHA
    08d8234 View commit details
  14. Copy the full SHA
    76be367 View commit details
  15. Copy the full SHA
    33e3f93 View commit details
  16. Copy the full SHA
    acb8f1e View commit details
  17. Copy the full SHA
    0e7d19b View commit details
  18. Remaining variable specs passing by matching up splat logic to fix he…

    …adius made a few commits ago
    enebo committed Jul 14, 2015
    Copy the full SHA
    c5e6f78 View commit details
  19. Copy the full SHA
    eb5c20b View commit details
  20. Copy the full SHA
    f4c2bed View commit details
  21. Remove outdated spec

    enebo committed Jul 14, 2015
    Copy the full SHA
    16dce38 View commit details
  22. Copy the full SHA
    30cfff8 View commit details
  23. Copy the full SHA
    935553d View commit details
  24. Copy the full SHA
    4afaa6c View commit details

Commits on Jul 15, 2015

  1. spec for regression in proc to iface optimization

    complements commit a741a82
    kares committed Jul 15, 2015
    Copy the full SHA
    c79610c View commit details
  2. Copy the full SHA
    1d90f9f View commit details
  3. Copy the full SHA
    84a2051 View commit details
  4. Copy the full SHA
    27dc383 View commit details
  5. Copy the full SHA
    db7c111 View commit details
  6. Copy the full SHA
    6a9f22e View commit details
  7. Copy the full SHA
    4d98bd7 View commit details
Showing 448 changed files with 6,921 additions and 6,084 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -77,7 +77,7 @@ matrix:
fast_finish: true
allow_failures:
- env: COMMAND=test/truffle/run.sh
- env: PHASE='-Ptruffle-mri-tests'
- env: COMMAND=tool/truffle-findbugs.sh


branches:
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9.0.0.0-SNAPSHOT
9.0.0.0
2 changes: 1 addition & 1 deletion 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.0.0.0-SNAPSHOT</version>
<version>9.0.0.0</version>
</parent>
<artifactId>jruby-core</artifactId>
<name>JRuby Core</name>
14 changes: 14 additions & 0 deletions core/src/main/java/org/jruby/Main.java
Original file line number Diff line number Diff line change
@@ -282,6 +282,8 @@ public void run() {
}

try {
doSetContextClassLoader(runtime);

if (in == null) {
// no script to run, return success
return new Status();
@@ -450,6 +452,18 @@ private boolean checkStreamSyntax(Ruby runtime, InputStream in, String filename)
}
}

private void doSetContextClassLoader(Ruby runtime) {
// set thread context JRuby classloader here, for the main thread
try {
Thread.currentThread().setContextClassLoader(runtime.getJRubyClassLoader());
} catch (SecurityException se) {
// can't set TC classloader
if (runtime.getInstanceConfig().isVerbose()) {
config.getError().println("WARNING: Security restrictions disallowed setting context classloader for main thread.");
}
}
}

private void doProcessArguments(InputStream in) {
config.processArguments(config.parseShebangOptions(in));
}
39 changes: 15 additions & 24 deletions core/src/main/java/org/jruby/RubyArray.java
Original file line number Diff line number Diff line change
@@ -801,15 +801,11 @@ public IRubyObject fetch(ThreadContext context, IRubyObject arg0, IRubyObject ar
/** rb_ary_to_ary
*
*/
private static RubyArray aryToAry(IRubyObject obj) {
if (obj instanceof RubyArray) return (RubyArray) obj;
public static RubyArray aryToAry(IRubyObject obj) {
IRubyObject tmp = TypeConverter.checkArrayType(obj);

if (obj.respondsTo("to_ary")) return obj.convertToArray();

RubyArray arr = new RubyArray(obj.getRuntime(), false); // possibly should not in object space
arr.values = new IRubyObject[]{obj};
arr.realLength = 1;
return arr;
if (!tmp.isNil()) return (RubyArray)tmp;
return obj.getRuntime().newArray(obj);
}

/** rb_ary_splice
@@ -1053,24 +1049,17 @@ public IRubyObject values_at(IRubyObject[] args) {
*
*/
public IRubyObject subseq(long beg, long len) {
int realLength = this.realLength;
if (beg > realLength || beg < 0 || len < 0) return getRuntime().getNil();

if (beg + len > realLength) {
len = realLength - beg;

if (len < 0) len = 0;
}

if (len == 0) return new RubyArray(getRuntime(), getMetaClass(), IRubyObject.NULL_ARRAY);

return makeShared(begin + (int) beg, (int) len, getMetaClass());
return subseq(getMetaClass(), beg, len, true);
}

/** rb_ary_subseq
*
*/
public IRubyObject subseqLight(long beg, long len) {
return subseq(getMetaClass(), beg, len, true);
}

public IRubyObject subseq(RubyClass metaClass, long beg, long len, boolean light) {
Ruby runtime = getRuntime();
if (beg > realLength || beg < 0 || len < 0) return runtime.getNil();

@@ -1079,8 +1068,8 @@ public IRubyObject subseqLight(long beg, long len) {
if (len < 0) len = 0;
}

if (len == 0) return new RubyArray(runtime, getMetaClass(), IRubyObject.NULL_ARRAY, false);
return makeShared(begin + (int) beg, (int) len, new RubyArray(runtime, getMetaClass(), false));
if (len == 0) return new RubyArray(runtime, metaClass, IRubyObject.NULL_ARRAY, !light);
return makeShared(begin + (int) beg, (int) len, new RubyArray(runtime, metaClass, !light));
}

/** rb_ary_length
@@ -2290,13 +2279,15 @@ public IRubyObject collect(ThreadContext context, Block block) {

IRubyObject[] arr = new IRubyObject[realLength];

for (int i = 0; i < realLength; i++) {
int i;
for (i = 0; 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, safeArrayRef(values, i + begin));
}

return new RubyArray(runtime, arr);
// use iteration count as new size in case something was deleted along the way
return new RubyArray(runtime, arr, 0, i);
}

@JRubyMethod(name = {"collect"})
38 changes: 18 additions & 20 deletions core/src/main/java/org/jruby/RubyBasicObject.java
Original file line number Diff line number Diff line change
@@ -595,38 +595,36 @@ public final boolean respondsTo(String name) {
final DynamicMethod respondTo = getMetaClass().searchMethod("respond_to?");
final DynamicMethod respondToMissing = getMetaClass().searchMethod("respond_to_missing?");

// fastest path; builtin respond_to? and respond_to_missing? so we just check isMethodBound
if ( respondTo.equals(runtime.getRespondToMethod()) &&
respondToMissing.equals(runtime.getRespondToMissingMethod()) ) {
// fastest path; builtin respond_to? which just does isMethodBound
return getMetaClass().isMethodBound(name, false);
}

final ThreadContext context = runtime.getCurrentContext();
final RubySymbol mname = runtime.newSymbol(name);
final boolean respondToUndefined = respondTo.isUndefined();
if ( ! ( respondToUndefined && respondToMissing.isUndefined() ) ) {
// medium path, invoke user's respond_to?/respond_to_missing? if defined
final DynamicMethod method; final String respondName;
if ( respondToUndefined ) {
method = respondToMissing; respondName = "respond_to_missing?";
} else {
method = respondTo; respondName = "respond_to?";

// respond_to? or respond_to_missing? is not defined, so we must dispatch to trigger method_missing
if ( respondToUndefined ) {
return callMethod(context, "respond_to?", mname).isTrue();
}

// respond_to? is defined, invoke already-retrieved method object
final String respondName = "respond_to?";

// We have to check and enforce arity
final Arity arity = respondTo.getArity();
if ( arity.isFixed() ) {
if ( arity.required() == 1 ) {
return respondTo.call(context, this, metaClass, respondName, mname).isTrue();
}
// We have to check and enforce arity
final Arity arity = method.getArity();
if ( arity.isFixed() ) {
if ( arity.required() == 1 ) {
return method.call(context, this, metaClass, respondName, mname).isTrue();
}
if ( arity.required() != 2 ) {
throw runtime.newArgumentError(respondName + " must accept 1 or 2 arguments (requires " + arity.getValue() + ")");
}
if ( arity.required() != 2 ) {
throw runtime.newArgumentError(respondName + " must accept 1 or 2 arguments (requires " + arity.getValue() + ")");
}
return method.call(context, this, metaClass, respondName, mname, runtime.getTrue()).isTrue();
}

// slowest path, full callMethod to hit method_missing if present, or produce error
return callMethod(context, "respond_to?", mname).isTrue();
return respondTo.call(context, this, metaClass, respondName, mname, runtime.getTrue()).isTrue();
}

/**
5 changes: 5 additions & 0 deletions core/src/main/java/org/jruby/RubyEncoding.java
Original file line number Diff line number Diff line change
@@ -546,6 +546,11 @@ public static IRubyObject getDefaultInternal(ThreadContext context, IRubyObject
return context.runtime.getEncodingService().getDefaultInternal();
}

@Deprecated
public static IRubyObject getDefaultInternal(IRubyObject recv) {
return getDefaultInternal(recv.getRuntime().getCurrentContext(), recv);
}

@JRubyMethod(name = "default_internal=", required = 1, meta = true)
public static IRubyObject setDefaultInternal(ThreadContext context, IRubyObject recv, IRubyObject encoding) {
if (context.runtime.isVerbose()) context.runtime.getWarnings().warning("setting Encoding.default_internal");
6 changes: 1 addition & 5 deletions core/src/main/java/org/jruby/RubyIO.java
Original file line number Diff line number Diff line change
@@ -4756,12 +4756,8 @@ public static IRubyObject writeStatic(ThreadContext context, IRubyObject recv, I
}

@Deprecated
@JRubyMethod(name = "popen3", rest = true, meta = true)
public static IRubyObject popen3(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) {
return popen3_19(context, recv, args, block);
}

@Deprecated
public static IRubyObject popen3_19(ThreadContext context, IRubyObject recv, IRubyObject[] args, Block block) {
final Ruby runtime = context.runtime;

// TODO: handle opts
6 changes: 3 additions & 3 deletions core/src/main/java/org/jruby/RubyKernel.java
Original file line number Diff line number Diff line change
@@ -396,7 +396,7 @@ public static RubyFloat new_float19(IRubyObject recv, IRubyObject object) {
if (arg.toString().startsWith("0x")) {
return ConvertBytes.byteListToInum19(runtime, arg.getByteList(), 16, true).toFloat();
}
return RubyNumeric.str2fnum19(runtime, arg,true);
return RubyNumeric.str2fnum(runtime, arg, true);
} else if(object.isNil()){
throw runtime.newTypeError("can't convert nil into Float");
} else {
@@ -600,12 +600,12 @@ public static IRubyObject readlines(ThreadContext context, IRubyObject recv, IRu
return RubyArgsFile.readlines(context, context.runtime.getArgsFile(), args);
}

@JRubyMethod(name = "respond_to_missing?", module = true)
@JRubyMethod(name = "respond_to_missing?", visibility = PRIVATE)
public static IRubyObject respond_to_missing_p(ThreadContext context, IRubyObject recv, IRubyObject symbol) {
return context.runtime.getFalse();
}

@JRubyMethod(name = "respond_to_missing?", module = true)
@JRubyMethod(name = "respond_to_missing?", visibility = PRIVATE)
public static IRubyObject respond_to_missing_p(ThreadContext context, IRubyObject recv, IRubyObject symbol, IRubyObject isPrivate) {
return context.runtime.getFalse();
}
33 changes: 25 additions & 8 deletions core/src/main/java/org/jruby/RubyNumeric.java
Original file line number Diff line number Diff line change
@@ -284,11 +284,11 @@ public static int fix2int(RubyFixnum arg) {
}

public static RubyInteger str2inum(Ruby runtime, RubyString str, int base) {
return str2inum(runtime,str,base,false);
return str2inum(runtime, str, base, false);
}

public static RubyNumeric int2fix(Ruby runtime, long val) {
return RubyFixnum.newFixnum(runtime,val);
return RubyFixnum.newFixnum(runtime, val);
}

/** rb_num2fix
@@ -341,12 +341,24 @@ public static RubyInteger str2inum(Ruby runtime, RubyString str, int base, boole
}

/**
* Converts a string representation of a floating-point number to the
* numeric value. Parsing starts at the beginning of the string (after
* leading and trailing whitespace have been removed), and stops at the
* end or at the first character that can't be part of a number. If
* Same as RubyNumeric.str2fnum passing false for strict.
*
* @param runtime the ruby runtime
* @param arg the string to be converted
* @return a RubyFloat representing the result of the conversion, which
* will be 0.0 if the conversion failed.
*/
public static RubyFloat str2fnum(Ruby runtime, RubyString arg) {
return str2fnum(runtime, arg, false);
}

/**
* Converts a string representation of a floating-point number to the
* numeric value. Parsing starts at the beginning of the string (after
* leading and trailing whitespace have been removed), and stops at the
* end or at the first character that can't be part of a number. If
* the string fails to parse as a number, 0.0 is returned.
*
*
* @param runtime the ruby runtime
* @param arg the string to be converted
* @param strict if true, enforce the strict criteria for String encoding of
@@ -358,7 +370,7 @@ public static RubyInteger str2inum(Ruby runtime, RubyString str, int base, boole
* @return a RubyFloat representing the result of the conversion, which
* will be 0.0 if the conversion failed.
*/
public static RubyFloat str2fnum19(Ruby runtime, RubyString arg, boolean strict) {
public static RubyFloat str2fnum(Ruby runtime, RubyString arg, boolean strict) {
return str2fnumCommon(runtime, arg, strict, biteListCaller19);
}

@@ -1224,4 +1236,9 @@ public Throwable fillInStackTrace() {
return this;
}
}

@Deprecated
public static RubyFloat str2fnum19(Ruby runtime, RubyString arg, boolean strict) {
return str2fnumCommon(runtime, arg, strict, biteListCaller19);
}
}
Loading