Ignore:
Timestamp:
Jun 21, 2010, 4:17:48 PM (15 years ago)
Author:
[email protected]
Message:

2010-06-21 Oliver Hunt <[email protected]>

Reviewed by Geoffrey Garen.

Make JSC more resilient in the face of parse failures
https://bugs.webkit.org/show_bug.cgi?id=40951

A number of recent bugs have occurred due to issues like miscounting
BOMs, etc which lead to interesting crashes later on. Adding this
logic hardens JSC in the face of these errors, and has no impact on
performance (32bit jit actually gets 0.7% faster but I put that down
to cache effects).

  • bytecode/CodeBlock.cpp: (JSC::CodeBlock::reparseForExceptionInfoIfNecessary): (JSC::CodeBlock::lineNumberForBytecodeOffset): (JSC::CodeBlock::expressionRangeForBytecodeOffset): (JSC::CodeBlock::getByIdExceptionInfoForBytecodeOffset):
  • bytecode/CodeBlock.h: (JSC::CodeBlock::bytecodeOffset):
  • interpreter/Interpreter.cpp: (JSC::Interpreter::execute): (JSC::Interpreter::executeCall): (JSC::Interpreter::executeConstruct): (JSC::Interpreter::prepareForRepeatCall): (JSC::Interpreter::privateExecute):
  • jit/JITOpcodes.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines):
  • jit/JITOpcodes32_64.cpp: (JSC::JIT::privateCompileCTIMachineTrampolines):
  • jit/JITStubs.cpp: (JSC::DEFINE_STUB_FUNCTION):
  • runtime/ArrayPrototype.cpp: (JSC::isNumericCompareFunction):
  • runtime/Executable.cpp: (JSC::FunctionExecutable::compileForCall): (JSC::FunctionExecutable::compileForConstruct): (JSC::FunctionExecutable::generateJITCodeForCall): (JSC::FunctionExecutable::generateJITCodeForConstruct): (JSC::FunctionExecutable::reparseExceptionInfo): (JSC::EvalExecutable::reparseExceptionInfo):
  • runtime/Executable.h: (JSC::FunctionExecutable::bytecodeForCall): (JSC::FunctionExecutable::bytecodeForConstruct):
  • runtime/JSGlobalData.cpp: (JSC::JSGlobalData::numericCompareFunction):
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/runtime/Executable.h

    r60376 r61588  
    306306        }
    307307
    308         FunctionCodeBlock& bytecodeForCall(ExecState* exec, ScopeChainNode* scopeChainNode)
     308        FunctionCodeBlock* bytecodeForCall(ExecState* exec, ScopeChainNode* scopeChainNode)
    309309        {
    310310            ASSERT(scopeChainNode);
    311311            if (!m_codeBlockForCall)
    312312                compileForCall(exec, scopeChainNode);
    313             return *m_codeBlockForCall;
     313            return m_codeBlockForCall;
    314314        }
    315315
     
    325325        }
    326326
    327         FunctionCodeBlock& bytecodeForConstruct(ExecState* exec, ScopeChainNode* scopeChainNode)
     327        FunctionCodeBlock* bytecodeForConstruct(ExecState* exec, ScopeChainNode* scopeChainNode)
    328328        {
    329329            ASSERT(scopeChainNode);
    330330            if (!m_codeBlockForConstruct)
    331331                compileForConstruct(exec, scopeChainNode);
    332             return *m_codeBlockForConstruct;
     332            return m_codeBlockForConstruct;
    333333        }
    334334
     
    384384        }
    385385
    386         void compileForCall(ExecState*, ScopeChainNode*);
    387         void compileForConstruct(ExecState*, ScopeChainNode*);
     386        bool compileForCall(ExecState*, ScopeChainNode*);
     387        bool compileForConstruct(ExecState*, ScopeChainNode*);
    388388
    389389        unsigned m_numVariables : 31;
Note: See TracChangeset for help on using the changeset viewer.