Index: src/org/jruby/evaluator/EvaluationState.java =================================================================== --- src/org/jruby/evaluator/EvaluationState.java (revision 3692) +++ src/org/jruby/evaluator/EvaluationState.java (working copy) @@ -266,6 +266,11 @@ return hashNode(runtime, context, node, self, aBlock); case NodeTypes.IFNODE: { IfNode iVisited = (IfNode) node; + + if (isTrace(runtime)) { + callTraceFunction(runtime, context, "line", self); + } + IRubyObject result = evalInternal(runtime,context, iVisited.getCondition(), self, aBlock); if (result.isTrue()) { @@ -799,7 +804,7 @@ } DefaultMethod newMethod = new DefaultMethod(containingClass, iVisited.getScope(), - iVisited.getBodyNode(), (ArgsNode) iVisited.getArgsNode(), visibility, context.peekCRef()); + iVisited.getBodyNode(), (ArgsNode) iVisited.getArgsNode(), visibility, context.peekCRef(), iVisited.getPosition()); containingClass.addMethod(name, newMethod); @@ -858,7 +863,7 @@ DefaultMethod newMethod = new DefaultMethod(rubyClass, iVisited.getScope(), iVisited.getBodyNode(), (ArgsNode) iVisited.getArgsNode(), - Visibility.PUBLIC, context.peekCRef()); + Visibility.PUBLIC, context.peekCRef(), iVisited.getPosition()); rubyClass.addMethod(iVisited.getName(), newMethod); receiver.callMethod(context, "singleton_method_added", runtime.newSymbol(iVisited.getName())); Index: src/org/jruby/internal/runtime/methods/DefaultMethod.java =================================================================== --- src/org/jruby/internal/runtime/methods/DefaultMethod.java (revision 3689) +++ src/org/jruby/internal/runtime/methods/DefaultMethod.java (working copy) @@ -72,6 +72,7 @@ private SinglyLinkedList cref; private int callCount = 0; private Script jitCompiledScript; + private ISourcePosition methodPosition; private static final boolean JIT_ENABLED; private static final boolean JIT_LOGGING; @@ -94,17 +95,18 @@ JIT_THRESHOLD = threshold == null ? 20 : Integer.parseInt(threshold); } } - public DefaultMethod(RubyModule implementationClass, StaticScope staticScope, Node body, - ArgsNode argsNode, Visibility visibility, SinglyLinkedList cref) { + public DefaultMethod(RubyModule implementationClass, StaticScope staticScope, Node body, + ArgsNode argsNode, Visibility visibility, SinglyLinkedList cref, ISourcePosition methodPosition) { super(implementationClass, visibility); this.body = body; this.staticScope = staticScope; this.argsNode = argsNode; - this.cref = cref; - - assert argsNode != null; + this.cref = cref; + this.methodPosition = methodPosition; + + assert argsNode != null; } - + public void preMethod(ThreadContext context, RubyModule clazz, IRubyObject self, String name, IRubyObject[] args, boolean noSuper, Block block) { context.preDefMethodInternalCall(clazz, name, self, args, getArity().required(), block, noSuper, cref, staticScope, this); @@ -351,16 +353,13 @@ return; } - ISourcePosition position = context.getPreviousFramePosition(); - runtime.callTraceFunction(context, "return", position, binding, name, getImplementationClass()); + runtime.callTraceFunction(context, "return", methodPosition, binding, name, getImplementationClass()); } private void traceCall(ThreadContext context, Ruby runtime, RubyBinding binding, String name) { if (runtime.getTraceFunction() == null) return; - ISourcePosition position = body != null ? body.getPosition() : context.getPosition(); - - runtime.callTraceFunction(context, "call", position, binding, name, getImplementationClass()); + runtime.callTraceFunction(context, "call", methodPosition, binding, name, getImplementationClass()); } public Arity getArity() { @@ -368,6 +367,6 @@ } public DynamicMethod dup() { - return new DefaultMethod(getImplementationClass(), staticScope, body, argsNode, getVisibility(), cref); + return new DefaultMethod(getImplementationClass(), staticScope, body, argsNode, getVisibility(), cref, methodPosition); } } Index: src/org/jruby/RubyObject.java =================================================================== --- src/org/jruby/RubyObject.java (revision 3692) +++ src/org/jruby/RubyObject.java (working copy) @@ -952,7 +952,7 @@ * */ public IRubyObject equal(IRubyObject other) { - if(this == other || callMethod(getRuntime().getCurrentContext(), MethodIndex.EQUALEQUAL, "==",other).isTrue()){ + if(callMethod(getRuntime().getCurrentContext(), MethodIndex.EQUALEQUAL, "==", other).isTrue()){ return getRuntime().getTrue(); } Index: src/org/jruby/RubyFixnum.java =================================================================== --- src/org/jruby/RubyFixnum.java (revision 3689) +++ src/org/jruby/RubyFixnum.java (working copy) @@ -522,7 +522,7 @@ return RubyBoolean.newBoolean(getRuntime(), value == ((RubyFixnum) other).value); } return super.equal(other); - } + } /** fix_cmp *