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

Commits on Jun 1, 2016

  1. Copy the full SHA
    1f644b6 View commit details
  2. Copy the full SHA
    9e9722c View commit details
Original file line number Diff line number Diff line change
@@ -23,15 +23,15 @@
public class TruffleArrayNodes {

@CoreMethod(names = "steal_storage", onSingleton = true, required = 2)
public abstract static class TakeOwnershipOfStoreNode extends CoreMethodArrayArgumentsNode {
public abstract static class StealStorageNode extends CoreMethodArrayArgumentsNode {

@Specialization(guards = "array == other")
public DynamicObject takeOwnershipOfStoreNoOp(DynamicObject array, DynamicObject other) {
public DynamicObject stealStorageNoOp(DynamicObject array, DynamicObject other) {
return array;
}

@Specialization(guards = { "array != other", "isRubyArray(other)" })
public DynamicObject takeOwnershipOfStore(DynamicObject array, DynamicObject other) {
public DynamicObject stealStorage(DynamicObject array, DynamicObject other) {
final int size = getSize(other);
final Object store = getStore(other);
setStoreAndSize(array, store, size);
Original file line number Diff line number Diff line change
@@ -460,9 +460,9 @@ public DynamicObject noMethodErrorOnReceiver(String name, Object receiver, Node
final DynamicObject logicalClass = context.getCoreLibrary().getLogicalClass(receiver);
final String moduleName = Layouts.MODULE.getFields(logicalClass).getName();

// e.g. BasicObject does not have to_s
final boolean hasToS = ModuleOperations.lookupMethod(logicalClass, "to_s", Visibility.PUBLIC) != null;
final Object stringRepresentation = hasToS ? context.send(receiver, "to_s", null) : context.getCoreLibrary().getNilObject();
// e.g. BasicObject does not have inspect
final boolean hasInspect = ModuleOperations.lookupMethod(logicalClass, "inspect", Visibility.PUBLIC) != null;
final Object stringRepresentation = hasInspect ? context.send(receiver, "inspect", null) : context.getCoreLibrary().getNilObject();

return noMethodError(String.format("undefined method `%s' for %s:%s", name, stringRepresentation, moduleName), name, currentNode);
}