Ignore:
Timestamp:
Jun 19, 2009, 12:10:49 AM (16 years ago)
Author:
[email protected]
Message:

Bug 26532: Native functions do not correctly unlink from optimised callsites when they're collected
<https://bugs.webkit.org/show_bug.cgi?id=26532> <rdar://problem/6625385>

Reviewed by Gavin "Viceroy of Venezuela" Barraclough.

We need to make sure that each native function instance correctly unlinks any references to it
when it is collected. Allowing this to happen required a few changes:

  • Every native function needs a codeblock to track the link information
  • To have this codeblock, every function now also needs its own functionbodynode so we no longer get to have a single shared instance.
  • Identifying a host function is now done by looking for CodeBlock::codeType() == NativeCode
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/parser/Nodes.cpp

    r44224 r44844  
    20382038    RefPtr<FunctionBodyNode> body = new FunctionBodyNode(globalData);
    20392039    globalData->parser->arena().reset();
     2040    body->m_code.set(new CodeBlock(body.get()));
    20402041    body->m_jitCode = JITCode(JITCode::HostFunction(globalData->jitStubs.ctiNativeCallThunk()));
    20412042    return body.release();
    20422043}
    20432044#endif
     2045
     2046bool FunctionBodyNode::isHostFunction() const
     2047{
     2048    return m_code && m_code->codeType() == NativeCode;
     2049}
    20442050
    20452051FunctionBodyNode* FunctionBodyNode::create(JSGlobalData* globalData)
Note: See TracChangeset for help on using the changeset viewer.