Ignore:
Timestamp:
Jan 8, 2009, 2:51:19 PM (16 years ago)
Author:
[email protected]
Message:

2009-01-08 Sam Weinig <[email protected]>

Reviewed by Oliver Hunt.

Fix for https://bugs.webkit.org/show_bug.cgi?id=23197
Delay creating the PCVector until an exception is thrown
Part of <rdar://problem/6469060>
Don't store exception information for a CodeBlock until first exception is thrown

  • Change the process for re-parsing/re-generating bytecode for exception information to use data from the original CodeBlock (offsets of GlobalResolve instructions) to aid in creating an identical instruction stream on re-parse, instead of padding interchangeable opcodes, which would result in different JITed code.
  • Fix bug where the wrong ScopeChainNode was used when re-parsing/regenerating from within some odd modified scope chains.
  • Lazily create the pcVector by re-JITing the regenerated CodeBlock and stealing the the pcVector from it.

Saves ~2MB on Membuster head.

  • bytecode/CodeBlock.cpp: (JSC::CodeBlock::dump): (JSC::CodeBlock::reparseForExceptionInfoIfNecessary): (JSC::CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset): (JSC::CodeBlock::hasGlobalResolveInfoAtBytecodeOffset):
  • bytecode/CodeBlock.h: (JSC::JITCodeRef::JITCodeRef): (JSC::GlobalResolveInfo::GlobalResolveInfo): (JSC::CodeBlock::getBytecodeIndex): (JSC::CodeBlock::addGlobalResolveInstruction): (JSC::CodeBlock::addGlobalResolveInfo): (JSC::CodeBlock::addFunctionRegisterInfo): (JSC::CodeBlock::hasExceptionInfo): (JSC::CodeBlock::pcVector): (JSC::EvalCodeBlock::EvalCodeBlock): (JSC::EvalCodeBlock::baseScopeDepth):
  • bytecode/Opcode.h:
  • bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::BytecodeGenerator): (JSC::BytecodeGenerator::emitResolve): (JSC::BytecodeGenerator::emitGetScopedVar):
  • bytecompiler/BytecodeGenerator.h: (JSC::BytecodeGenerator::setRegeneratingForExceptionInfo):
  • interpreter/Interpreter.cpp: (JSC::bytecodeOffsetForPC): (JSC::Interpreter::unwindCallFrame): (JSC::Interpreter::privateExecute): (JSC::Interpreter::retrieveLastCaller): (JSC::Interpreter::cti_op_instanceof): (JSC::Interpreter::cti_op_call_NotJSFunction): (JSC::Interpreter::cti_op_resolve): (JSC::Interpreter::cti_op_construct_NotJSConstruct): (JSC::Interpreter::cti_op_resolve_func): (JSC::Interpreter::cti_op_resolve_skip): (JSC::Interpreter::cti_op_resolve_global): (JSC::Interpreter::cti_op_resolve_with_base): (JSC::Interpreter::cti_op_throw): (JSC::Interpreter::cti_op_in): (JSC::Interpreter::cti_vm_throw):
  • jit/JIT.cpp: (JSC::JIT::privateCompile):
  • parser/Nodes.cpp: (JSC::EvalNode::generateBytecode): (JSC::EvalNode::bytecodeForExceptionInfoReparse): (JSC::FunctionBodyNode::bytecodeForExceptionInfoReparse):
  • parser/Nodes.h:
File:
1 edited

Legend:

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

    r39697 r39720  
    330330        CodeType codeType() const { return m_codeType; }
    331331
    332         void setRegeneratingForExceptionInfo() { m_regeneratingForExceptionInfo = true; }
     332        void setRegeneratingForExceptionInfo(CodeBlock* originalCodeBlock)
     333        {
     334            m_regeneratingForExceptionInfo = true;
     335            m_codeBlockBeingRegeneratedFrom = originalCodeBlock;
     336        }
    333337
    334338    private:
     
    422426        bool m_shouldEmitDebugHooks;
    423427        bool m_shouldEmitProfileHooks;
    424 
    425         bool m_regeneratingForExceptionInfo;
    426428
    427429        const ScopeChain* m_scopeChain;
     
    466468        OpcodeID m_lastOpcodeID;
    467469
    468 #ifndef NDEBUG
    469         static bool s_dumpsGeneratedCode;
    470 #endif
    471 
    472470        unsigned m_emitNodeDepth;
     471
     472        bool m_regeneratingForExceptionInfo;
     473        CodeBlock* m_codeBlockBeingRegeneratedFrom;
    473474
    474475        static const unsigned s_maxEmitNodeDepth = 10000;
Note: See TracChangeset for help on using the changeset viewer.