[Webkit-unassigned] [Bug 94051] JSC: fast/js/stack-trace.html fails due to erroneous line number for LLint frame

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Aug 20 15:08:39 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=94051





--- Comment #9 from Filip Pizlo <fpizlo at apple.com>  2012-08-20 15:09:16 PST ---
(From update of attachment 159505)
View in context: https://bugs.webkit.org/attachment.cgi?id=159505&action=review

> Source/JavaScriptCore/bytecode/CodeBlock.cpp:2618
> +#if ENABLE(LLINT)
> +Instruction* CodeBlock::adjustPCIfAtCallSite(Instruction* potentialReturnPC)
> +{
> +    ASSERT(potentialReturnPC);
> +
> +    unsigned returnPCOffset = potentialReturnPC - instructions().begin();
> +    Instruction* adjustedPC;
> +    unsigned opcodeLength;
> +
> +    // If we are at a callsite, the LLInt stores the PC after the call
> +    // instruction rather than the PC of the call instruction. This requires
> +    // some correcting. If so, we can rely on the fact that the preceding
> +    // instruction must be one of the call instructions, so either it's a
> +    // call_varargs or it's a call, construct, or eval.
> +    //
> +    // If we are not at a call site, then we need to guard against the
> +    // possibility of peeking past the start of the bytecode range for this
> +    // codeBlock. Hence, we do a bounds check before we peek at the
> +    // potential "preceding" instruction.
> +    //     The bounds check is done by comparing the offset of the potential
> +    // returnPC with the length of the opcode. If there is room for a call
> +    // instruction before the returnPC, then the offset of the returnPC must
> +    // be greater than the size of the call opcode we're looking for.
> +
> +    // The determination of the call instruction present (if we are at a
> +    // callsite) depends on the following assumptions. So, assert that
> +    // they are still true:
> +    ASSERT(OPCODE_LENGTH(op_call_varargs) <= OPCODE_LENGTH(op_call));
> +    ASSERT(OPCODE_LENGTH(op_call) == OPCODE_LENGTH(op_construct));
> +    ASSERT(OPCODE_LENGTH(op_call) == OPCODE_LENGTH(op_call_eval));
> +
> +    // Check for the case of a preceeding op_call_varargs:
> +    opcodeLength = OPCODE_LENGTH(op_call_varargs);
> +    adjustedPC = potentialReturnPC - opcodeLength;
> +    if ((returnPCOffset >= opcodeLength)
> +        && (adjustedPC->u.pointer == bitwise_cast<void*>(llint_op_call_varargs))) {

Does this correctly handle the case where the call site was compiled in something other than llint?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list