Ignore:
Timestamp:
Jun 18, 2012, 11:07:28 PM (13 years ago)
Author:
[email protected]
Message:

Source/JavaScriptCore: Changed JSC to always record line number information so that error.stack
and window.onerror() can report proper line numbers.
https://bugs.webkit.org/show_bug.cgi?id=89410

Patch by Mark Lam <[email protected]> on 2012-06-18
Reviewed by Geoffrey Garen.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::CodeBlock):
(JSC::CodeBlock::lineNumberForBytecodeOffset):
(JSC::CodeBlock::shrinkToFit): m_lineInfo is now available unconditionally.

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::addLineInfo):
(JSC::CodeBlock::hasLineInfo): Unused. Now removed.
(JSC::CodeBlock::needsCallReturnIndices):
(CodeBlock):
(RareData): Hoisted m_lineInfo out of m_rareData. m_lineInfo is now
filled in unconditionally.

  • bytecompiler/BytecodeGenerator.h:

(JSC::BytecodeGenerator::addLineInfo):

LayoutTests: Ensure that error.stack and window.onerror always have the appropriate
line numbers of the exception being thrown.
https://bugs.webkit.org/show_bug.cgi?id=89410

Patch by Mark Lam <[email protected]> on 2012-06-18
Reviewed by Geoffrey Garen.

  • fast/js/exception-line-number-expected.txt: Added.
  • fast/js/exception-line-number.html: Added.
  • fast/js/script-tests/exception-line-number.js: Added.

(foo):
(window.onerror):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.h

    r120244 r120676  
    617617        void addLineInfo(unsigned lineNo)
    618618        {
    619 #if !ENABLE(OPCODE_SAMPLING)
    620             if (m_shouldEmitRichSourceInfo)
    621 #endif
    622                 m_codeBlock->addLineInfo(instructions().size(), lineNo);
     619            m_codeBlock->addLineInfo(instructions().size(), lineNo);
    623620        }
    624621
Note: See TracChangeset for help on using the changeset viewer.