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

Commits on Sep 6, 2016

  1. Copy the full SHA
    89e02da View commit details
  2. Copy the full SHA
    8f59c9c View commit details
  3. Select call site based on receiver operand type at compile time.

    This has worked for the JIT and it runs almost all the same
    tests as the interpreter.
    
    See #4134.
    headius committed Sep 6, 2016
    Copy the full SHA
    e152ed3 View commit details
  4. Merge pull request #4138 from headius/attr_asgn_visibility_fix

    Use a CallSite for invocation of attr writers. Fixes #4134.
    headius authored Sep 6, 2016
    Copy the full SHA
    10fd567 View commit details
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@
import org.jruby.ir.Operation;
import org.jruby.ir.instructions.specialized.OneArgOperandAttrAssignInstr;
import org.jruby.ir.operands.Operand;
import org.jruby.ir.operands.Self;
import org.jruby.ir.persistence.IRReaderDecoder;
import org.jruby.ir.persistence.IRWriterEncoder;
import org.jruby.ir.transformations.inlining.CloneInfo;
@@ -27,7 +28,7 @@ public static AttrAssignInstr create(Operand obj, String attr, Operand[] args, b
}

public AttrAssignInstr(Operand obj, String attr, Operand[] args, boolean isPotentiallyRefined) {
super(Operation.ATTR_ASSIGN, CallType.UNKNOWN, attr, obj, args, null, isPotentiallyRefined);
super(Operation.ATTR_ASSIGN, obj instanceof Self ? CallType.FUNCTIONAL : CallType.NORMAL, attr, obj, args, null, isPotentiallyRefined);
}

@Override
@@ -67,8 +68,8 @@ public Object interpret(ThreadContext context, StaticScope currScope, DynamicSco
IRubyObject object = (IRubyObject) getReceiver().retrieve(context, self, currScope, dynamicScope, temp);
IRubyObject[] values = prepareArguments(context, self, currScope, dynamicScope, temp);

CallType callType = self == object ? CallType.FUNCTIONAL : CallType.NORMAL;
Helpers.invoke(context, object, getName(), values, callType, Block.NULL_BLOCK);
callSite.call(context, self, object, values);

return null;
}

2 changes: 1 addition & 1 deletion core/src/main/java/org/jruby/ir/instructions/CallBase.java
Original file line number Diff line number Diff line change
@@ -143,7 +143,7 @@ public boolean inliningBlocked() {
return dontInline;
}

private static CallSite getCallSiteFor(CallType callType, String name, boolean potentiallyRefined) {
protected static CallSite getCallSiteFor(CallType callType, String name, boolean potentiallyRefined) {
assert callType != null: "Calltype should never be null";

if (potentiallyRefined) return new RefinedCachingCallSite(name, callType);
Original file line number Diff line number Diff line change
@@ -23,8 +23,8 @@ public Object interpret(ThreadContext context, StaticScope currScope, DynamicSco
IRubyObject object = (IRubyObject) getReceiver().retrieve(context, self, currScope, dynamicScope, temp);
IRubyObject value = (IRubyObject) getArg1().retrieve(context, self, currScope, dynamicScope, temp);

CallType callType = self == object ? CallType.FUNCTIONAL : CallType.NORMAL;
Helpers.invoke(context, object, getName(), value, callType, Block.NULL_BLOCK);
callSite.call(context, self, object, value);

return null;
}
}