Skip to content

Commit

Permalink
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions core/src/main/java/org/jruby/truffle/nodes/RubyCallNode.java
Original file line number Diff line number Diff line change
@@ -50,13 +50,13 @@ public class RubyCallNode extends RubyNode {
@Child protected DispatchHeadNode respondToMissing;
@Child protected BooleanCastNode respondToMissingCast;

private final boolean fcall;
private final boolean ignoreVisibility;

public RubyCallNode(RubyContext context, SourceSection section, String methodName, RubyNode receiver, RubyNode block, boolean isSplatted, RubyNode... arguments) {
this(context, section, methodName, receiver, block, isSplatted, false, false, arguments);
}

public RubyCallNode(RubyContext context, SourceSection section, String methodName, RubyNode receiver, RubyNode block, boolean isSplatted, boolean fcall, boolean rubiniusPrimitive, RubyNode... arguments) {
public RubyCallNode(RubyContext context, SourceSection section, String methodName, RubyNode receiver, RubyNode block, boolean isSplatted, boolean ignoreVisibility, boolean rubiniusPrimitive, RubyNode... arguments) {
super(context, section);

this.methodName = methodName;
@@ -72,11 +72,11 @@ public RubyCallNode(RubyContext context, SourceSection section, String methodNam
this.arguments = arguments;
this.isSplatted = isSplatted;

dispatchHead = new DispatchHeadNode(context, fcall, rubiniusPrimitive, Dispatch.MissingBehavior.CALL_METHOD_MISSING);
respondToMissing = new DispatchHeadNode(context, fcall, Dispatch.MissingBehavior.RETURN_MISSING);
dispatchHead = new DispatchHeadNode(context, ignoreVisibility, rubiniusPrimitive, Dispatch.MissingBehavior.CALL_METHOD_MISSING);
respondToMissing = new DispatchHeadNode(context, ignoreVisibility, Dispatch.MissingBehavior.RETURN_MISSING);
respondToMissingCast = BooleanCastNodeFactory.create(context, section, null);

this.fcall = fcall;
this.ignoreVisibility = ignoreVisibility;
}

@Override
@@ -204,7 +204,7 @@ public Object isDefined(VirtualFrame frame) {
}
} else if (method.isUndefined()) {
return NilPlaceholder.INSTANCE;
} else if (!fcall && !method.isVisibleTo(this, self)) {
} else if (!ignoreVisibility && !method.isVisibleTo(this, self)) {
return NilPlaceholder.INSTANCE;
}

Original file line number Diff line number Diff line change
@@ -277,7 +277,7 @@ public RubyNode visitCallNode(CallNode node) {
/**
* See translateDummyAssignment to understand what this is for.
*/
public RubyNode visitCallNodeExtraArgument(CallNode node, RubyNode extraArgument, boolean fcall) {
public RubyNode visitCallNodeExtraArgument(CallNode node, RubyNode extraArgument, boolean ignoreVisibility) {
final SourceSection sourceSection = translate(node.getPosition());

final RubyNode receiverTranslated = node.getReceiverNode().accept(this);
@@ -300,7 +300,7 @@ public RubyNode visitCallNodeExtraArgument(CallNode node, RubyNode extraArgument
new RescueNode[] {new RescueAnyNode(context, sourceSection, new NilLiteralNode(context, sourceSection))},
new NilLiteralNode(context, sourceSection));
} else {
translated = new RubyCallNode(context, sourceSection, node.getName(), receiverTranslated, argumentsAndBlock.getBlock(), argumentsAndBlock.isSplatted(), fcall, false, argumentsAndBlock.getArguments());
translated = new RubyCallNode(context, sourceSection, node.getName(), receiverTranslated, argumentsAndBlock.getBlock(), argumentsAndBlock.isSplatted(), ignoreVisibility, false, argumentsAndBlock.getArguments());
}

// return instrumenter.instrumentAsCall(translated, node.getName());

0 comments on commit 467c5e3

Please sign in to comment.