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

Commits on Jan 11, 2018

  1. Copy the full SHA
    eb7db5a View commit details
  2. Copy the full SHA
    60c7a27 View commit details
  3. Copy the full SHA
    3f39d54 View commit details
11 changes: 6 additions & 5 deletions core/src/main/java/org/jruby/Ruby.java
Original file line number Diff line number Diff line change
@@ -66,6 +66,7 @@
import org.jruby.runtime.JavaSites;
import org.jruby.runtime.invokedynamic.InvokeDynamicSupport;
import org.jruby.util.MRIRecursionGuard;
import org.jruby.util.StringSupport;
import org.jruby.util.StrptimeParser;
import org.jruby.util.StrptimeToken;
import org.jruby.util.io.EncodingUtils;
@@ -3022,14 +3023,14 @@ public void addBoundMethod(String className, String methodName, String rubyName)
}

public void addBoundMethodsPacked(String className, String packedTuples) {
String[] names = Helpers.SEMICOLON_PATTERN.split(packedTuples);
for (int i = 0; i < names.length; i += 2) {
addBoundMethod(className, names[i], names[i+1]);
List<String> names = StringSupport.split(packedTuples, ';');
for (int i = 0; i < names.size(); i += 2) {
addBoundMethod(className, names.get(i), names.get(i+1));
}
}

public void addSimpleBoundMethodsPacked(String className, String packedNames) {
String[] names = Helpers.SEMICOLON_PATTERN.split(packedNames);
List<String> names = StringSupport.split(packedNames, ';');
for (String name : names) {
addBoundMethod(className, name, name);
}
@@ -5145,7 +5146,7 @@ private MRIRecursionGuard oldRecursionGuard() {
private EnumMap<RubyThread.Status, RubyString> threadStatuses = new EnumMap<RubyThread.Status, RubyString>(RubyThread.Status.class);

public interface ObjectSpacer {
public void addToObjectSpace(Ruby runtime, boolean useObjectSpace, IRubyObject object);
void addToObjectSpace(Ruby runtime, boolean useObjectSpace, IRubyObject object);
}

private static final ObjectSpacer DISABLED_OBJECTSPACE = new ObjectSpacer() {
6 changes: 3 additions & 3 deletions core/src/main/java/org/jruby/runtime/Helpers.java
Original file line number Diff line number Diff line change
@@ -14,7 +14,6 @@
import java.util.StringTokenizer;
import java.util.regex.Pattern;

import com.headius.modulator.Modulator;
import jnr.constants.platform.Errno;
import org.jruby.*;
import org.jruby.ast.ArgsNode;
@@ -40,7 +39,6 @@
import org.jruby.javasupport.JavaUtil;
import org.jruby.javasupport.proxy.InternalJavaProxy;
import org.jruby.parser.StaticScope;
import org.jruby.platform.Platform;
import org.jruby.runtime.JavaSites.HelpersSites;
import org.jruby.runtime.backtrace.BacktraceData;
import org.jruby.runtime.builtin.IRubyObject;
@@ -543,7 +541,9 @@ public static IRubyObject nullToNil(IRubyObject value, Ruby runtime) {
return value != null ? value : runtime.getNil();
}

@Deprecated // not used
/**
* @see Ruby#getNullToNilHandle()
*/
public static IRubyObject nullToNil(IRubyObject value, IRubyObject nil) {
return value != null ? value : nil;
}
16 changes: 8 additions & 8 deletions core/src/main/java/org/jruby/runtime/MethodIndex.java
Original file line number Diff line number Diff line change
@@ -38,6 +38,7 @@
import java.util.Set;
import java.util.concurrent.ConcurrentHashMap;

import org.jruby.RubyInstanceConfig;
import org.jruby.anno.FrameField;
import org.jruby.runtime.callsite.LtCallSite;
import org.jruby.runtime.callsite.LeCallSite;
@@ -47,7 +48,6 @@
import org.jruby.runtime.callsite.GtCallSite;
import org.jruby.runtime.callsite.PlusCallSite;
import org.jruby.runtime.callsite.GeCallSite;
import org.jruby.RubyInstanceConfig;
import org.jruby.runtime.callsite.CmpCallSite;
import org.jruby.runtime.callsite.EqCallSite;
import org.jruby.runtime.callsite.BitAndCallSite;
@@ -60,6 +60,7 @@
import org.jruby.runtime.callsite.VariableCachingCallSite;
import org.jruby.runtime.callsite.XorCallSite;
import org.jruby.runtime.invokedynamic.MethodNames;
import org.jruby.util.StringSupport;
import org.jruby.util.log.Logger;
import org.jruby.util.log.LoggerFactory;

@@ -244,26 +245,25 @@ private static void processFrameFields(int bits, String methodNames, String usag
if (DEBUG) LOG.debug("Adding method fields for {}: {} for {}", usage, writes, methodNames);

if (writes.size() > 0) {
String[] names = Helpers.SEMICOLON_PATTERN.split(methodNames);
List<String> namesList = Arrays.asList(names);
List<String> names = StringSupport.split(methodNames, ';');

addAwareness(needsFrame, needsScope, namesList);
addAwareness(needsFrame, needsScope, names);

addFieldAccesses(methodFrameAccesses, names, writes);
}
}

private static void addFieldAccesses(Map<String, Set<FrameField>> methodFrameWrites, String[] names, Set<FrameField> writes) {
private static void addFieldAccesses(Map<String, Set<FrameField>> methodFrameWrites, List<String> names, Set<FrameField> writes) {
for (String name : names) {
methodFrameWrites.compute(
name,
(key, cur) -> cur == null ? writes : concat(cur.stream(), writes.stream()).collect(toSet()));
}
}

private static void addAwareness(boolean needsFrame, boolean needsScope, List<String> namesList) {
if (needsFrame) FRAME_AWARE_METHODS.addAll(namesList);
if (needsScope) SCOPE_AWARE_METHODS.addAll(namesList);
private static void addAwareness(boolean needsFrame, boolean needsScope, List<String> names) {
if (needsFrame) FRAME_AWARE_METHODS.addAll(names);
if (needsScope) SCOPE_AWARE_METHODS.addAll(names);
}

public static void addMethodReadFields(String name, FrameField[] reads) {
1 change: 0 additions & 1 deletion core/src/main/java/org/jruby/util/StringSupport.java
Original file line number Diff line number Diff line change
@@ -34,7 +34,6 @@
import org.jcodings.exception.EncodingError;
import org.jcodings.exception.EncodingException;
import org.jcodings.specific.ASCIIEncoding;
import org.jcodings.specific.USASCIIEncoding;
import org.jcodings.specific.UTF8Encoding;
import org.jcodings.util.IntHash;
import org.joni.Matcher;