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

Commits on Apr 23, 2015

  1. Copy the full SHA
    5c53e3c View commit details
  2. Copy the full SHA
    c770ac5 View commit details
Showing with 53 additions and 95 deletions.
  1. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/cast/StringToSymbolNode.java
  2. +2 −2 truffle/src/main/java/org/jruby/truffle/nodes/conversion/ToSymbolNode.java
  3. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/ArrayNodes.java
  4. +1 −4 truffle/src/main/java/org/jruby/truffle/nodes/core/BindingNodes.java
  5. +4 −20 truffle/src/main/java/org/jruby/truffle/nodes/core/EncodingNodes.java
  6. +4 −11 truffle/src/main/java/org/jruby/truffle/nodes/core/KernelNodes.java
  7. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/MethodNodes.java
  8. +2 −2 truffle/src/main/java/org/jruby/truffle/nodes/core/ModuleNodes.java
  9. +2 −3 truffle/src/main/java/org/jruby/truffle/nodes/core/ProcessNodes.java
  10. +1 −2 truffle/src/main/java/org/jruby/truffle/nodes/core/StringNodes.java
  11. +4 −7 truffle/src/main/java/org/jruby/truffle/nodes/core/SymbolNodes.java
  12. +1 −1 truffle/src/main/java/org/jruby/truffle/nodes/core/UnboundMethodNodes.java
  13. +2 −3 truffle/src/main/java/org/jruby/truffle/nodes/dispatch/CachedDispatchNode.java
  14. +1 −7 truffle/src/main/java/org/jruby/truffle/nodes/methods/AddMethodNode.java
  15. +14 −18 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/EncodingConverterPrimitiveNodes.java
  16. +8 −8 truffle/src/main/java/org/jruby/truffle/nodes/rubinius/IOBufferPrimitiveNodes.java
  17. +3 −3 truffle/src/main/java/org/jruby/truffle/runtime/RubyContext.java
  18. +1 −1 truffle/src/main/java/org/jruby/truffle/translator/BodyTranslator.java
Original file line number Diff line number Diff line change
@@ -37,7 +37,7 @@ public StringToSymbolNode(StringToSymbolNode prev) {
public RubySymbol doString(RubyString string) {
notDesignedForCompilation();

return getContext().newSymbol(string.toString());
return getContext().getSymbol(string.toString());
}

}
Original file line number Diff line number Diff line change
@@ -40,12 +40,12 @@ protected RubySymbol toSymbol(RubySymbol symbol) {

@Specialization
protected RubySymbol toSymbol(RubyString string) {
return getContext().newSymbol(string.getBytes());
return getContext().getSymbol(string.getBytes());
}

@Specialization
protected RubySymbol toSymbol(String string) {
return getContext().newSymbol(string);
return getContext().getSymbol(string);
}

}
Original file line number Diff line number Diff line change
@@ -1300,7 +1300,7 @@ public abstract static class EachNode extends YieldingCoreMethodNode {

public EachNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
eachSymbol = getContext().getSymbolTable().getSymbol("each");
eachSymbol = getContext().getSymbol("each");
}

public EachNode(EachNode prev) {
Original file line number Diff line number Diff line change
@@ -11,12 +11,9 @@

import com.oracle.truffle.api.Truffle;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.FrameInstance;
import com.oracle.truffle.api.frame.FrameSlot;
import com.oracle.truffle.api.frame.MaterializedFrame;
import com.oracle.truffle.api.source.SourceSection;
import org.jruby.Ruby;
import org.jruby.runtime.Visibility;
import org.jruby.truffle.nodes.globals.GetFromThreadLocalNode;
import org.jruby.truffle.nodes.globals.WrapInThreadLocalNode;
import org.jruby.truffle.runtime.RubyArguments;
@@ -151,7 +148,7 @@ public RubyArray localVariables(RubyBinding binding) {
while (frame != null) {
for (Object name : frame.getFrameDescriptor().getIdentifiers()) {
if (name instanceof String) {
array.slowPush(getContext().newSymbol((String) name));
array.slowPush(getContext().getSymbol((String) name));
}
}

Original file line number Diff line number Diff line change
@@ -11,45 +11,29 @@

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.dsl.CreateCast;
import com.oracle.truffle.api.dsl.NodeChild;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.source.SourceSection;
import com.oracle.truffle.api.utilities.ConditionProfile;

import org.jcodings.Encoding;
import org.jcodings.EncodingDB;
import org.jcodings.specific.ASCIIEncoding;
import org.jcodings.specific.UTF8Encoding;
import org.jcodings.util.CaseInsensitiveBytesHash;
import org.jcodings.util.Hash;
import org.jruby.Ruby;
import org.jruby.RubyObject;
import org.jruby.runtime.encoding.EncodingService;
import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.nodes.coerce.ToStrNode;
import org.jruby.truffle.nodes.coerce.ToStrNodeFactory;
import org.jruby.truffle.nodes.dispatch.CallDispatchHeadNode;
import org.jruby.truffle.nodes.dispatch.DispatchHeadNode;
import org.jruby.truffle.nodes.dispatch.DispatchHeadNodeFactory;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.control.RaiseException;
import org.jruby.truffle.runtime.core.RubyArray;
import org.jruby.truffle.runtime.core.RubyBasicObject;
import org.jruby.truffle.runtime.core.RubyEncoding;
import org.jruby.truffle.runtime.core.RubyHash;
import org.jruby.truffle.runtime.core.RubyNilClass;
import org.jruby.truffle.runtime.core.RubyRegexp;
import org.jruby.truffle.runtime.core.RubyString;
import org.jruby.truffle.runtime.core.RubySymbol;
import org.jruby.truffle.runtime.hash.HashOperations;
import org.jruby.truffle.runtime.hash.KeyValue;
import org.jruby.util.ByteList;

import java.util.ArrayList;
import java.util.List;

@CoreClass(name = "Encoding")
public abstract class EncodingNodes {

@@ -422,19 +406,19 @@ public Object encodingMap(VirtualFrame frame) {

final Encoding defaultInternalEncoding = getContext().getRuntime().getDefaultInternalEncoding();
final Object internalTuple = getContext().makeTuple(frame, newTupleNode, getContext().makeString("internal"), indexLookup(encodings, defaultInternalEncoding));
lookupTableWriteNode.call(frame, ret, "[]=", null, getContext().newSymbol("INTERNAL"), internalTuple);
lookupTableWriteNode.call(frame, ret, "[]=", null, getContext().getSymbol("INTERNAL"), internalTuple);

final Encoding defaultExternalEncoding = getContext().getRuntime().getDefaultExternalEncoding();
final Object externalTuple = getContext().makeTuple(frame, newTupleNode, getContext().makeString("external"), indexLookup(encodings, defaultExternalEncoding));
lookupTableWriteNode.call(frame, ret, "[]=", null, getContext().newSymbol("EXTERNAL"), externalTuple);
lookupTableWriteNode.call(frame, ret, "[]=", null, getContext().getSymbol("EXTERNAL"), externalTuple);

final Encoding localeEncoding = getContext().getRuntime().getEncodingService().getLocaleEncoding();
final Object localeTuple = getContext().makeTuple(frame, newTupleNode, getContext().makeString("locale"), indexLookup(encodings, localeEncoding));
lookupTableWriteNode.call(frame, ret, "[]=", null, getContext().newSymbol("LOCALE"), localeTuple);
lookupTableWriteNode.call(frame, ret, "[]=", null, getContext().getSymbol("LOCALE"), localeTuple);

final Encoding filesystemEncoding = getContext().getRuntime().getEncodingService().getLocaleEncoding();
final Object filesystemTuple = getContext().makeTuple(frame, newTupleNode, getContext().makeString("filesystem"), indexLookup(encodings, filesystemEncoding));
lookupTableWriteNode.call(frame, ret, "[]=", null, getContext().newSymbol("FILESYSTEM"), filesystemTuple);
lookupTableWriteNode.call(frame, ret, "[]=", null, getContext().getSymbol("FILESYSTEM"), filesystemTuple);

return ret;
}
Original file line number Diff line number Diff line change
@@ -26,23 +26,17 @@
import org.jruby.common.IRubyWarnings;
import org.jruby.runtime.Visibility;
import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.nodes.ThreadLocalObjectNode;
import org.jruby.truffle.nodes.cast.NumericToFloatNode;
import org.jruby.truffle.nodes.cast.NumericToFloatNodeFactory;
import org.jruby.truffle.nodes.coerce.ToStrNodeFactory;
import org.jruby.truffle.nodes.control.WhileNode;
import org.jruby.truffle.nodes.core.ClassNodes.NewNode;
import org.jruby.truffle.nodes.core.ClassNodesFactory.NewNodeFactory;
import org.jruby.truffle.nodes.core.KernelNodesFactory.CopyNodeFactory;
import org.jruby.truffle.nodes.core.KernelNodesFactory.SameOrEqualNodeFactory;
import org.jruby.truffle.nodes.dispatch.*;
import org.jruby.truffle.nodes.globals.WrapInThreadLocalNode;
import org.jruby.truffle.nodes.literal.BooleanLiteralNode;
import org.jruby.truffle.nodes.objects.*;
import org.jruby.truffle.nodes.objectstorage.WriteHeadObjectFieldNode;
import org.jruby.truffle.nodes.rubinius.ObjectPrimitiveNodes;
import org.jruby.truffle.nodes.rubinius.ObjectPrimitiveNodesFactory;
import org.jruby.truffle.nodes.yield.YieldNode;
import org.jruby.truffle.runtime.*;
import org.jruby.truffle.runtime.backtrace.Activation;
import org.jruby.truffle.runtime.backtrace.Backtrace;
@@ -58,7 +52,6 @@
import org.jruby.util.cli.Options;

import java.io.*;
import java.math.BigInteger;
import java.nio.charset.StandardCharsets;
import java.util.*;

@@ -1155,7 +1148,7 @@ public RubyArray localVariables() {

for (Object name : Truffle.getRuntime().getCallerFrame().getFrame(FrameInstance.FrameAccess.READ_ONLY, false).getFrameDescriptor().getIdentifiers()) {
if (name instanceof String) {
array.slowPush(getContext().newSymbol((String) name));
array.slowPush(getContext().getSymbol((String) name));
}
}

@@ -1255,7 +1248,7 @@ public RubyArray methods(RubyBasicObject self, boolean includeInherited) {

for (InternalMethod method : methods.values()) {
if (method.getVisibility() == Visibility.PUBLIC || method.getVisibility() == Visibility.PROTECTED) {
array.slowPush(self.getContext().newSymbol(method.getName()));
array.slowPush(self.getContext().getSymbol(method.getName()));
}
}

@@ -1313,7 +1306,7 @@ public RubyArray private_methods(RubyBasicObject self, boolean includeInherited)

for (InternalMethod method : methods.values()) {
if (method.getVisibility() == Visibility.PRIVATE) {
array.slowPush(self.getContext().newSymbol(method.getName()));
array.slowPush(self.getContext().getSymbol(method.getName()));
}
}

@@ -1376,7 +1369,7 @@ public RubyArray methods(RubyBasicObject self, UndefinedPlaceholder includeInher

for (InternalMethod method : methods.values()) {
if (method.getVisibility() == Visibility.PUBLIC) {
array.slowPush(self.getContext().newSymbol(method.getName()));
array.slowPush(self.getContext().getSymbol(method.getName()));
}
}

Original file line number Diff line number Diff line change
@@ -139,7 +139,7 @@ public NameNode(NameNode prev) {
public RubySymbol name(RubyMethod method) {
notDesignedForCompilation();

return getContext().newSymbol(method.getMethod().getName());
return getContext().getSymbol(method.getMethod().getName());
}

}
Original file line number Diff line number Diff line change
@@ -843,7 +843,7 @@ public RubyArray constants(RubyModule module, boolean inherit) {

for (Entry<String, RubyConstant> constant : constants.entrySet()) {
if (!constant.getValue().isPrivate()) {
constantsArray.add(getContext().newSymbol(constant.getKey()));
constantsArray.add(getContext().getSymbol(constant.getKey()));
}
}

@@ -1724,7 +1724,7 @@ public RubyArray instanceMethods(RubyModule module, boolean includeAncestors) {
for (InternalMethod method : methods.values()) {
if (method.getVisibility() != Visibility.PRIVATE && !method.isUndefined()) {
// TODO(CS): shoudln't be using this
array.slowPush(getContext().newSymbol(method.getName()));
array.slowPush(getContext().getSymbol(method.getName()));
}
}

Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@
*/
package org.jruby.truffle.nodes.core;

import com.oracle.truffle.api.CompilerDirectives;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.source.SourceSection;

@@ -34,8 +33,8 @@ public abstract static class ClockGetTimeNode extends CoreMethodNode {

public ClockGetTimeNode(RubyContext context, SourceSection sourceSection) {
super(context, sourceSection);
floatSecondSymbol = context.newSymbol("float_second");
nanosecondSymbol = context.newSymbol("nanosecond");
floatSecondSymbol = context.getSymbol("float_second");
nanosecondSymbol = context.getSymbol("nanosecond");
}

public ClockGetTimeNode(ClockGetTimeNode prev) {
Original file line number Diff line number Diff line change
@@ -44,7 +44,6 @@
import org.joni.Matcher;
import org.joni.Option;
import org.jruby.Ruby;
import org.jruby.runtime.Visibility;
import org.jruby.truffle.nodes.RubyNode;
import org.jruby.truffle.nodes.cast.CmpIntNode;
import org.jruby.truffle.nodes.cast.CmpIntNodeFactory;
@@ -2263,7 +2262,7 @@ public ToSymNode(ToSymNode prev) {
public RubySymbol toSym(RubyString string) {
notDesignedForCompilation();

return getContext().newSymbol(string.getByteList());
return getContext().getSymbol(string.getByteList());
}
}

Original file line number Diff line number Diff line change
@@ -13,8 +13,6 @@
import com.oracle.truffle.api.Truffle;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.source.SourceSection;
import org.jruby.Ruby;
import org.jruby.RubyObject;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.core.RubyArray;
import org.jruby.truffle.runtime.core.RubyEncoding;
@@ -23,7 +21,6 @@
import org.jruby.truffle.runtime.core.RubyString;
import org.jruby.truffle.runtime.core.RubySymbol;
import org.jruby.util.ByteList;
import org.jruby.util.StringSupport;

@CoreClass(name = "Symbol")
public abstract class SymbolNodes {
@@ -116,7 +113,7 @@ public CapitalizeNode(CapitalizeNode prev) {
public RubySymbol capitalize(RubySymbol symbol) {
notDesignedForCompilation();
final ByteList byteList = SymbolNodesHelper.capitalize(symbol.getByteList());
return getContext().newSymbol(byteList);
return getContext().getSymbol(byteList);
}

}
@@ -163,7 +160,7 @@ public RubySymbol downcase(RubySymbol symbol) {
notDesignedForCompilation();

final ByteList byteList = SymbolNodesHelper.downcase(symbol.getByteList());
return getContext().newSymbol(byteList);
return getContext().getSymbol(byteList);
}

}
@@ -354,7 +351,7 @@ public RubySymbol swapcase(RubySymbol symbol) {
notDesignedForCompilation();

final ByteList byteList = SymbolNodesHelper.swapcase(symbol.getByteList());
return getContext().newSymbol(byteList);
return getContext().getSymbol(byteList);
}

}
@@ -375,7 +372,7 @@ public RubySymbol upcase(RubySymbol symbol) {
notDesignedForCompilation();

final ByteList byteList = SymbolNodesHelper.upcase(symbol.getByteList());
return getContext().newSymbol(byteList);
return getContext().getSymbol(byteList);
}

}
Original file line number Diff line number Diff line change
@@ -129,7 +129,7 @@ public NameNode(NameNode prev) {
public RubySymbol name(RubyUnboundMethod unboundMethod) {
notDesignedForCompilation();

return getContext().newSymbol(unboundMethod.getMethod().getName());
return getContext().getSymbol(unboundMethod.getMethod().getName());
}

}
Original file line number Diff line number Diff line change
@@ -13,7 +13,6 @@
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.core.RubyString;
import org.jruby.truffle.runtime.core.RubySymbol;
import org.jruby.truffle.runtime.methods.InternalMethod;

public abstract class CachedDispatchNode extends DispatchNode {

@@ -39,9 +38,9 @@ public CachedDispatchNode(
if (cachedName instanceof RubySymbol) {
cachedNameAsSymbol = (RubySymbol) cachedName;
} else if (cachedName instanceof RubyString) {
cachedNameAsSymbol = context.newSymbol(((RubyString) cachedName).getBytes());
cachedNameAsSymbol = context.getSymbol(((RubyString) cachedName).getBytes());
} else if (cachedName instanceof String) {
cachedNameAsSymbol = context.newSymbol((String) cachedName);
cachedNameAsSymbol = context.getSymbol((String) cachedName);
} else {
throw new UnsupportedOperationException();
}
Original file line number Diff line number Diff line change
@@ -9,13 +9,9 @@
*/
package org.jruby.truffle.nodes.methods;

import com.oracle.truffle.api.Truffle;
import com.oracle.truffle.api.frame.Frame;
import com.oracle.truffle.api.frame.FrameInstance;
import com.oracle.truffle.api.frame.FrameInstanceVisitor;
import com.oracle.truffle.api.frame.FrameSlot;
import com.oracle.truffle.api.frame.VirtualFrame;
import com.oracle.truffle.api.frame.FrameInstance.FrameAccess;
import com.oracle.truffle.api.source.SourceSection;

import org.jruby.runtime.Visibility;
@@ -25,8 +21,6 @@
import org.jruby.truffle.runtime.ModuleOperations;
import org.jruby.truffle.runtime.RubyArguments;
import org.jruby.truffle.runtime.RubyContext;
import org.jruby.truffle.runtime.control.TruffleFatalException;
import org.jruby.truffle.runtime.core.RubyBasicObject;
import org.jruby.truffle.runtime.core.RubyModule;
import org.jruby.truffle.runtime.core.RubySymbol;
import org.jruby.truffle.runtime.methods.InternalMethod;
@@ -70,7 +64,7 @@ public RubySymbol execute(VirtualFrame frame) {
module.addMethod(this, method);
}

return getContext().newSymbol(method.getName());
return getContext().getSymbol(method.getName());
}

private static Visibility getVisibility(Frame frame, String name) {
Loading