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: 4d6c302fa051
Choose a base ref
...
head repository: jruby/jruby
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 8d95baf63e27
Choose a head ref
  • 4 commits
  • 6 files changed
  • 1 contributor

Commits on Aug 25, 2017

  1. Copy the full SHA
    d637cbb View commit details
  2. Copy the full SHA
    e4405d3 View commit details
  3. Copy the full SHA
    557f111 View commit details
  4. Copy the full SHA
    8d95baf View commit details
3 changes: 3 additions & 0 deletions core/src/main/java/org/jruby/Ruby.java
Original file line number Diff line number Diff line change
@@ -4296,18 +4296,21 @@ public RubyInstanceConfig getInstanceConfig() {
return config;
}

@Deprecated
public boolean is2_0() {
return true;
}

/** GET_VM_STATE_VERSION */
@Deprecated // not used
public long getGlobalState() {
synchronized(this) {
return globalState;
}
}

/** INC_VM_STATE_VERSION */
@Deprecated // not used
public void incGlobalState() {
synchronized(this) {
globalState = (globalState+1) & 0x8fffffff;
3 changes: 1 addition & 2 deletions core/src/main/java/org/jruby/RubyGC.java
Original file line number Diff line number Diff line change
@@ -116,8 +116,7 @@ public static IRubyObject count(ThreadContext context, IRubyObject recv) {
}

private static void emptyImplementationWarning(Ruby runtime, ID id, String name) {
runtime.getWarnings().warnOnce(id,
name + " does nothing on JRuby");
runtime.getWarnings().warnOnce(id, name + " does nothing on JRuby");
}

public static int getCollectionCount() {
12 changes: 5 additions & 7 deletions core/src/main/java/org/jruby/RubyObjectSpace.java
Original file line number Diff line number Diff line change
@@ -70,8 +70,7 @@ public static IRubyObject define_finalizer(IRubyObject recv, IRubyObject[] args,
if (args.length == 2) {
finalizer = args[1];
if (!finalizer.respondsTo("call")) {
throw runtime.newArgumentError("wrong type argument "
+ finalizer.getType() + " (should be callable)");
throw runtime.newArgumentError("wrong type argument " + finalizer.getType() + " (should be callable)");
}
} else {
finalizer = runtime.newProc(Block.Type.PROC, block);
@@ -91,10 +90,9 @@ public static IRubyObject undefine_finalizer(IRubyObject recv, IRubyObject obj,
public static IRubyObject id2ref(IRubyObject recv, IRubyObject id) {
final Ruby runtime = id.getRuntime();
if (!(id instanceof RubyFixnum)) {
throw recv.getRuntime().newTypeError(id, recv.getRuntime().getFixnum());
throw runtime.newTypeError(id, runtime.getFixnum());
}
RubyFixnum idFixnum = (RubyFixnum) id;
long longId = idFixnum.getLongValue();
long longId = ((RubyFixnum) id).getLongValue();
if (longId == 0) {
return runtime.getFalse();
} else if (longId == 20) {
@@ -113,7 +111,7 @@ public static IRubyObject id2ref(IRubyObject recv, IRubyObject id) {
return object;
} else {
runtime.getWarnings().warn("ObjectSpace is disabled; _id2ref only supports immediates, pass -X+O to enable");
throw recv.getRuntime().newRangeError(String.format("0x%016x is not id value", longId));
throw runtime.newRangeError(String.format("0x%016x is not id value", longId));
}
}
}
@@ -214,6 +212,6 @@ public IRubyObject op_aref(ThreadContext context, IRubyObject key, IRubyObject v
return context.runtime.newFixnum(System.identityHashCode(value));
}

private final WeakValuedIdentityMap<IRubyObject, IRubyObject> map = new WeakValuedIdentityMap<IRubyObject, IRubyObject>();
private final WeakValuedIdentityMap<IRubyObject, IRubyObject> map = new WeakValuedIdentityMap<>();
}
}
7 changes: 4 additions & 3 deletions core/src/main/java/org/jruby/ext/jruby/JRubyLibrary.java
Original file line number Diff line number Diff line change
@@ -248,10 +248,11 @@ public static IRubyObject compile_ir(ThreadContext context, IRubyObject recv, IR
}

private static IRScriptBody compileIR(ThreadContext context, IRubyObject[] args, Block block) {
RootNode result = (RootNode) parseImpl(context, args, block);
RootNode node = (RootNode) parseImpl(context, args, block);
IRManager manager = new IRManager(context.runtime.getInstanceConfig());
IRScriptBody scope = (IRScriptBody) IRBuilder.buildRoot(manager, result).getScope();
scope.setTopLevelBindingScope(result.getScope());
manager.setDryRun(true);
IRScriptBody scope = (IRScriptBody) IRBuilder.buildRoot(manager, node).getScope();
scope.setTopLevelBindingScope(node.getScope());
return scope;
}

6 changes: 4 additions & 2 deletions core/src/main/java/org/jruby/ir/persistence/IRWriter.java
Original file line number Diff line number Diff line change
@@ -10,16 +10,18 @@
import org.jruby.parser.StaticScope;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
* Write IR data out to persistent store. IRReader is capable of re-reading this
* Write IR data out to persistent store. IRReader is capable of re-reading this
* information back into live IR data again. This class knows the logical order of how
* information will be written out but the IRWriterEncoder actually knows how to encode that
* information.
*/
public class IRWriter {

private IRWriter() { /* static methods only, for now */ }

public static void persist(IRWriterEncoder file, IRScope script) throws IOException {
file.startEncoding(script);
persistScopeInstructions(file, script); // recursive dump of all scopes instructions
Original file line number Diff line number Diff line change
@@ -166,7 +166,7 @@ public void endEncoding(IRScope script) {

private void increment(Operand operand) {
Integer count = operandCounts.get(operand);
if (count == null) count = new Integer(0);
if (count == null) count = Integer.valueOf(0);

operandCounts.put(operand, count + 1);
}