Ignore:
Timestamp:
Dec 12, 2008, 2:48:53 PM (16 years ago)
Author:
[email protected]
Message:

2008-12-12 Cameron Zwarich <[email protected]>

Reviewed by Sam Weinig.

Bug 22828: Do not inspect bytecode instruction stream for op_get_by_id exception information
<https://bugs.webkit.org/show_bug.cgi?id=22828>

In order to remove the bytecode instruction stream after generating
native code, all inspection of bytecode instructions at runtime must
be removed. One particular instance of this is the special handling of
exceptions thrown by the op_get_by_id emitted directly before an
op_construct or an op_instanceof. This patch moves that information to
an auxiliary data structure in CodeBlock.

  • bytecode/CodeBlock.cpp: (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
  • bytecode/CodeBlock.h: (JSC::CodeBlock::addGetByIdExceptionInfo):
  • bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::emitConstruct):
  • bytecompiler/BytecodeGenerator.h: (JSC::BytecodeGenerator::emitGetByIdExceptionInfo):
  • parser/Nodes.cpp: (JSC::InstanceOfNode::emitBytecode):
  • runtime/ExceptionHelpers.cpp: (JSC::createNotAnObjectError):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/bytecode/CodeBlock.h

    r39252 r39255  
    7979    };
    8080
     81    // Both op_construct and op_instanceof require a use of op_get_by_id to get
     82    // the prototype property from an object. The exception messages for exceptions
     83    // thrown by these instances op_get_by_id need to reflect this.
     84    struct GetByIdExceptionInfo {
     85        unsigned bytecodeOffset : 31;
     86        bool isOpConstruct : 1;
     87    };
     88
    8189#if ENABLE(JIT)
    8290    struct CallLinkInfo {
     
    228236        int lineNumberForBytecodeOffset(unsigned bytecodeOffset);
    229237        int expressionRangeForBytecodeOffset(unsigned bytecodeOffset, int& divot, int& startOffset, int& endOffset);
     238        bool getByIdExceptionInfoForBytecodeOffset(unsigned bytecodeOffset, OpcodeID&);
    230239
    231240#if ENABLE(JIT)
     
    303312
    304313        void addExpressionInfo(const ExpressionRangeInfo& expressionInfo) { return m_expressionInfo.append(expressionInfo); }
     314        void addGetByIdExceptionInfo(const GetByIdExceptionInfo& info) { m_getByIdExceptionInfo.append(info); }
    305315
    306316        size_t numberOfLineInfos() const { return m_lineInfo.size(); }
     
    427437        Vector<ExpressionRangeInfo> m_expressionInfo;
    428438        Vector<LineInfo> m_lineInfo;
     439        Vector<GetByIdExceptionInfo> m_getByIdExceptionInfo;
    429440
    430441#if ENABLE(JIT)
Note: See TracChangeset for help on using the changeset viewer.