Changeset 80738 in webkit


Ignore:
Timestamp:
Mar 10, 2011 11:27:49 AM (13 years ago)
Author:
oliver@apple.com
Message:

2011-03-10 Oliver Hunt <oliver@apple.com>

Reviewed by Gavin Barraclough.

jquery/manipulation.html fails after r80598
https://bugs.webkit.org/show_bug.cgi?id=56019

Removed jQuery tests from skiplists

  • platform/gtk/Skipped:
  • platform/qt/Skipped:

2011-03-09 Oliver Hunt <oliver@apple.com>

Reviewed by Gavin Barraclough.

jquery/manipulation.html fails after r80598
https://bugs.webkit.org/show_bug.cgi?id=56019

When linking a call, codeblock now takes ownership of the linked function
This removes the need for unlinking, and thus the incorrectness that was
showing up in these tests.

  • bytecode/CodeBlock.cpp: (JSC::CodeBlock::~CodeBlock): (JSC::CodeBlock::markAggregate):
  • bytecode/CodeBlock.h: (JSC::CallLinkInfo::CallLinkInfo): (JSC::CallLinkInfo::setUnlinked): (JSC::CodeBlock::addCaller):
  • jit/JIT.cpp: (JSC::JIT::privateCompile): (JSC::JIT::linkCall): (JSC::JIT::linkConstruct):
  • jit/JIT.h:
  • runtime/Executable.cpp:
  • runtime/Executable.h:
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r80737 r80738  
     12011-03-10  Oliver Hunt  <oliver@apple.com>
     2
     3        Reviewed by Gavin Barraclough.
     4
     5        jquery/manipulation.html fails after r80598
     6        https://bugs.webkit.org/show_bug.cgi?id=56019
     7
     8        Removed jQuery tests from skiplists
     9
     10        * platform/gtk/Skipped:
     11        * platform/qt/Skipped:
     12
    1132011-03-10  Ryosuke Niwa  <rniwa@webkit.org>
    214
  • trunk/LayoutTests/platform/gtk/Skipped

    r80736 r80738  
    103103# https://bugs.webkit.org/show_bug.cgi?id=55126
    104104media/video-aspect-ratio.html
    105 
    106 # https://bugs.webkit.org/show_bug.cgi?id=56080
    107 jquery/effects.html
    108 
    109 # https://bugs.webkit.org/show_bug.cgi?id=22770
    110 tables/mozilla_expected_failures/marvin/table_overflow_dirty_reflow_tbody.html
    111105
    112106###############################################################################
     
    13221316http/tests/security/xss-DENIED-xsl-document-redirect.xml
    13231317http/tests/security/xss-DENIED-xsl-external-entity-redirect.xml
    1324 
    1325 # This test has failed since the import of the jquery test suite.
    1326 # https://bugs.webkit.org/show_bug.cgi?id=56019
    1327 jquery/manipulation.html
    1328 
    1329 # https://bugs.webkit.org/show_bug.cgi?id=56081
    1330 fast/js/large-expressions.html
  • trunk/LayoutTests/platform/qt/Skipped

    r80703 r80738  
    32003200http/tests/appcache/auth.html
    32013201http/tests/xmlhttprequest/basic-auth.html
    3202 
    3203 # jquery/manipulation.html fails after r80598
    3204 # https://bugs.webkit.org/show_bug.cgi?id=56019
    3205 jquery
  • trunk/Source/JavaScriptCore/ChangeLog

    r80691 r80738  
     12011-03-09  Oliver Hunt  <oliver@apple.com>
     2
     3        Reviewed by Gavin Barraclough.
     4
     5        jquery/manipulation.html fails after r80598
     6        https://bugs.webkit.org/show_bug.cgi?id=56019
     7
     8        When linking a call, codeblock now takes ownership of the linked function
     9        This removes the need for unlinking, and thus the incorrectness that was
     10        showing up in these tests.
     11
     12        * bytecode/CodeBlock.cpp:
     13        (JSC::CodeBlock::~CodeBlock):
     14        (JSC::CodeBlock::markAggregate):
     15        * bytecode/CodeBlock.h:
     16        (JSC::CallLinkInfo::CallLinkInfo):
     17        (JSC::CallLinkInfo::setUnlinked):
     18        (JSC::CodeBlock::addCaller):
     19        * jit/JIT.cpp:
     20        (JSC::JIT::privateCompile):
     21        (JSC::JIT::linkCall):
     22        (JSC::JIT::linkConstruct):
     23        * jit/JIT.h:
     24        * runtime/Executable.cpp:
     25        * runtime/Executable.h:
     26
    1272011-03-09  Daniel Bates  <dbates@rim.com>
    228
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r80598 r80738  
    14071407        m_structureStubInfos[i].deref();
    14081408
    1409     for (size_t size = m_callLinkInfos.size(), i = 0; i < size; ++i) {
    1410         CallLinkInfo* callLinkInfo = &m_callLinkInfos[i];
    1411         if (callLinkInfo->isLinked())
    1412             callLinkInfo->callee->removeCaller(callLinkInfo);
    1413     }
    1414 
    14151409    for (size_t size = m_methodCallLinkInfos.size(), i = 0; i < size; ++i) {
    14161410        if (Structure* structure = m_methodCallLinkInfos[i].cachedStructure) {
     
    14221416    }
    14231417
    1424 #if ENABLE(JIT_OPTIMIZE_CALL)
    1425     unlinkCallers();
    1426 #endif
    1427 
    14281418#endif // ENABLE(JIT)
    14291419
     
    14321422#endif
    14331423}
    1434 
    1435 #if ENABLE(JIT_OPTIMIZE_CALL)
    1436 void CodeBlock::unlinkCallers()
    1437 {
    1438     size_t size = m_linkedCallerList.size();
    1439     for (size_t i = 0; i < size; ++i) {
    1440         CallLinkInfo* currentCaller = m_linkedCallerList[i];
    1441         JIT::unlinkCallOrConstruct(currentCaller);
    1442         currentCaller->setUnlinked();
    1443     }
    1444     m_linkedCallerList.clear();
    1445 }
    1446 #endif
    14471424
    14481425void CodeBlock::derefStructures(Instruction* vPC) const
     
    15461523    for (size_t i = 0; i < m_functionDecls.size(); ++i)
    15471524        markStack.append(&m_functionDecls[i]);
     1525#if ENABLE(JIT_OPTIMIZE_CALL)
     1526    for (unsigned i = 0; i < numberOfCallLinkInfos(); ++i)
     1527        if (callLinkInfo(i).isLinked())
     1528            markStack.append(&callLinkInfo(i).callee);
     1529#endif
    15481530}
    15491531
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.h

    r80684 r80738  
    9797    struct CallLinkInfo {
    9898        CallLinkInfo()
    99             : callee(0)
    100             , position(0)
     99            : position(0)
    101100            , hasSeenShouldRepatch(0)
    102101        {
     
    106105        CodeLocationDataLabelPtr hotPathBegin;
    107106        CodeLocationNearCall hotPathOther;
    108         CodeBlock* ownerCodeBlock;
    109         CodeBlock* callee;
     107        WriteBarrier<JSFunction> callee;
    110108        unsigned position : 31;
    111109        unsigned hasSeenShouldRepatch : 1;
    112110       
    113         void setUnlinked() { callee = 0; }
     111        void setUnlinked() { callee.clear(); }
    114112        bool isLinked() { return callee; }
    115113
     
    258256        void refStructures(Instruction* vPC) const;
    259257        void derefStructures(Instruction* vPC) const;
    260 #if ENABLE(JIT_OPTIMIZE_CALL)
    261         void unlinkCallers();
    262 #endif
    263258
    264259        static void dumpStatistics();
     
    293288
    294289#if ENABLE(JIT)
    295         void addCaller(CallLinkInfo* caller)
    296         {
    297             caller->callee = this;
     290        void addCaller(JSGlobalData& globalData, CallLinkInfo* caller, JSFunction* callee)
     291        {
     292            caller->callee.set(globalData, ownerExecutable(), callee);
    298293            caller->position = m_linkedCallerList.size();
    299294            m_linkedCallerList.append(caller);
    300         }
    301 
    302         void removeCaller(CallLinkInfo* caller)
    303         {
    304             unsigned pos = caller->position;
    305             unsigned lastPos = m_linkedCallerList.size() - 1;
    306 
    307             if (pos != lastPos) {
    308                 m_linkedCallerList[pos] = m_linkedCallerList[lastPos];
    309                 m_linkedCallerList[pos]->position = pos;
    310             }
    311             m_linkedCallerList.shrink(lastPos);
    312295        }
    313296
  • trunk/Source/JavaScriptCore/jit/JIT.cpp

    r78174 r80738  
    568568    for (unsigned i = 0; i < m_codeBlock->numberOfCallLinkInfos(); ++i) {
    569569        CallLinkInfo& info = m_codeBlock->callLinkInfo(i);
    570         info.ownerCodeBlock = m_codeBlock;
    571570        info.callReturnLocation = patchBuffer.locationOfNearCall(m_callStructureStubCompilationInfo[i].callReturnLocation);
    572571        info.hotPathBegin = patchBuffer.locationOf(m_callStructureStubCompilationInfo[i].hotPathBegin);
     
    589588
    590589#if ENABLE(JIT_OPTIMIZE_CALL)
    591 void JIT::unlinkCallOrConstruct(CallLinkInfo* callLinkInfo)
    592 {
    593     // When the JSFunction is deleted the pointer embedded in the instruction stream will no longer be valid
    594     // (and, if a new JSFunction happened to be constructed at the same location, we could get a false positive
    595     // match).  Reset the check so it no longer matches.
    596     RepatchBuffer repatchBuffer(callLinkInfo->ownerCodeBlock);
    597 #if USE(JSVALUE32_64)
    598     repatchBuffer.repatch(callLinkInfo->hotPathBegin, 0);
    599 #else
    600     repatchBuffer.repatch(callLinkInfo->hotPathBegin, JSValue::encode(JSValue()));
    601 #endif
    602 }
    603590
    604591void JIT::linkCall(JSFunction* callee, CodeBlock* callerCodeBlock, CodeBlock* calleeCodeBlock, JIT::CodePtr code, CallLinkInfo* callLinkInfo, int callerArgCount, JSGlobalData* globalData)
     
    612599   
    613600        if (calleeCodeBlock)
    614             calleeCodeBlock->addCaller(callLinkInfo);
     601            calleeCodeBlock->addCaller(*globalData, callLinkInfo, callee);
    615602   
    616603        repatchBuffer.repatch(callLinkInfo->hotPathBegin, callee);
     
    632619   
    633620        if (calleeCodeBlock)
    634             calleeCodeBlock->addCaller(callLinkInfo);
     621            calleeCodeBlock->addCaller(*globalData, callLinkInfo, callee);
    635622   
    636623        repatchBuffer.repatch(callLinkInfo->hotPathBegin, callee);
  • trunk/Source/JavaScriptCore/jit/JIT.h

    r79551 r80738  
    246246        static void linkCall(JSFunction* callee, CodeBlock* callerCodeBlock, CodeBlock* calleeCodeBlock, CodePtr, CallLinkInfo*, int callerArgCount, JSGlobalData*);
    247247        static void linkConstruct(JSFunction* callee, CodeBlock* callerCodeBlock, CodeBlock* calleeCodeBlock, CodePtr, CallLinkInfo*, int callerArgCount, JSGlobalData*);
    248         static void unlinkCallOrConstruct(CallLinkInfo*);
    249248
    250249    private:
  • trunk/Source/JavaScriptCore/runtime/Executable.cpp

    r80598 r80738  
    8686}
    8787
    88 FunctionExecutable::~FunctionExecutable()
    89 {
    90 #if ENABLE(JIT_OPTIMIZE_CALL)
    91     if (isGeneratedForCall())
    92         generatedBytecodeForCall().unlinkCallers();
    93     if (isGeneratedForConstruct())
    94         generatedBytecodeForConstruct().unlinkCallers();
    95 #endif
    96 }
    9788
    9889JSObject* EvalExecutable::compileInternal(ExecState* exec, ScopeChainNode* scopeChainNode)
  • trunk/Source/JavaScriptCore/runtime/Executable.h

    r80598 r80738  
    308308        }
    309309
    310         ~FunctionExecutable();
    311 
    312310        JSFunction* make(ExecState* exec, ScopeChainNode* scopeChain)
    313311        {
Note: See TracChangeset for help on using the changeset viewer.