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/jit/JITStubs.cpp

    r44838 r44844  
    11921192
    11931193    JSFunction* function = asFunction(stackFrame.args[0].jsValue());
     1194    ASSERT(!function->isHostFunction());
    11941195    FunctionBodyNode* body = function->body();
    11951196    ScopeChainNode* callDataScopeChain = function->scope().node();
     
    12051206    CallFrame* callFrame = stackFrame.callFrame;
    12061207    CodeBlock* newCodeBlock = stackFrame.args[3].codeBlock();
     1208    ASSERT(newCodeBlock->codeType() != NativeCode);
    12071209    int argCount = stackFrame.args[2].int32();
    12081210
     
    12661268    if (!callee->isHostFunction())
    12671269        codeBlock = &callee->body()->bytecode(callee->scope().node());
     1270    else
     1271        codeBlock = &callee->body()->generatedBytecode();
    12681272
    12691273    CallLinkInfo* callLinkInfo = &stackFrame.callFrame->callerFrame()->codeBlock()->getCallLinkInfo(stackFrame.args[1].returnAddress());
Note: See TracChangeset for help on using the changeset viewer.