Changeset 45969 in webkit


Ignore:
Timestamp:
Jul 16, 2009 4:16:14 AM (15 years ago)
Author:
oliver@apple.com
Message:

2009-07-16 Zoltan Herczeg <zherczeg@inf.u-szeged.hu>

Reviewed by Oliver Hunt.

Workers + garbage collector: weird crashes
https://bugs.webkit.org/show_bug.cgi?id=27077

We need to unlink cached method call sites when a function is destroyed.

  • JavaScriptCore.xcodeproj/project.pbxproj:
  • bytecode/CodeBlock.cpp: (JSC::CodeBlock::~CodeBlock): (JSC::CodeBlock::unlinkCallers):
  • jit/JIT.cpp: (JSC::JIT::unlinkMethodCall):
  • jit/JIT.h:
Location:
trunk/JavaScriptCore
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r45949 r45969  
     12009-07-16  Zoltan Herczeg  <zherczeg@inf.u-szeged.hu>
     2
     3        Reviewed by Oliver Hunt.
     4
     5        Workers + garbage collector: weird crashes
     6        https://bugs.webkit.org/show_bug.cgi?id=27077
     7
     8        We need to unlink cached method call sites when a function is destroyed.
     9
     10        * JavaScriptCore.xcodeproj/project.pbxproj:
     11        * bytecode/CodeBlock.cpp:
     12        (JSC::CodeBlock::~CodeBlock):
     13        (JSC::CodeBlock::unlinkCallers):
     14        * jit/JIT.cpp:
     15        (JSC::JIT::unlinkMethodCall):
     16        * jit/JIT.h:
     17
    1182009-07-15  Steve Falkenburg  <sfalken@apple.com>
    219
  • trunk/JavaScriptCore/bytecode/CodeBlock.cpp

    r45609 r45969  
    13191319    }
    13201320
    1321     for (size_t size = m_methodCallLinkInfos.size(), i = 0; i < size; ++i) {
    1322         if (Structure* structure = m_methodCallLinkInfos[i].cachedStructure)
    1323             structure->deref();
    1324     }
    1325 
    13261321    unlinkCallers();
    13271322#endif
     
    13421337    }
    13431338    m_linkedCallerList.clear();
     1339
     1340    for (size_t size = m_methodCallLinkInfos.size(), i = 0; i < size; ++i) {
     1341        if (m_methodCallLinkInfos[i].cachedStructure) {
     1342            m_methodCallLinkInfos[i].cachedStructure->deref();
     1343            m_methodCallLinkInfos[i].cachedStructure = 0;
     1344            JIT::unlinkMethodCall(&m_methodCallLinkInfos[i]);
     1345        }
     1346    }
    13441347}
    13451348#endif
  • trunk/JavaScriptCore/jit/JIT.cpp

    r45609 r45969  
    908908}
    909909
     910void JIT::unlinkMethodCall(MethodCallLinkInfo* methodCallLinkInfo)
     911{
     912    // see the comment above.
     913    RepatchBuffer repatchBuffer;
     914    repatchBuffer.repatch(methodCallLinkInfo->structureLabel, reinterpret_cast<void*>(patchGetByIdDefaultStructure));
     915}
     916
    910917void JIT::linkCall(JSFunction* callee, CodeBlock* calleeCodeBlock, JITCode& code, CallLinkInfo* callLinkInfo, int callerArgCount, JSGlobalData* globalData)
    911918{
  • trunk/JavaScriptCore/jit/JIT.h

    r45138 r45969  
    392392        static void linkCall(JSFunction* callee, CodeBlock* calleeCodeBlock, JITCode&, CallLinkInfo*, int callerArgCount, JSGlobalData*);
    393393        static void unlinkCall(CallLinkInfo*);
     394        static void unlinkMethodCall(MethodCallLinkInfo*);
    394395
    395396    private:
Note: See TracChangeset for help on using the changeset viewer.