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/bytecompiler/BytecodeGenerator.h

    r39070 r39255  
    209209            m_codeBlock->addExpressionInfo(info);
    210210        }
     211
     212        void emitGetByIdExceptionInfo(OpcodeID opcodeID)
     213        {
     214            // Only op_construct and op_instanceof need exception info for
     215            // a preceding op_get_by_id.
     216            ASSERT(opcodeID == op_construct || opcodeID == op_instanceof);
     217            GetByIdExceptionInfo info;
     218            info.bytecodeOffset = instructions().size();
     219            info.isOpConstruct = (opcodeID == op_construct);
     220            m_codeBlock->addGetByIdExceptionInfo(info);
     221        }
    211222       
    212223        ALWAYS_INLINE bool leftHandSideNeedsCopy(bool rightHasAssignments, bool rightIsPure)
Note: See TracChangeset for help on using the changeset viewer.