Ignore:
Timestamp:
Aug 25, 2014, 7:17:58 PM (11 years ago)
Author:
[email protected]
Message:

Return statement TypeSet's might be duplicated
https://bugs.webkit.org/show_bug.cgi?id=136200

Patch by Saam Barati <[email protected]> on 2014-08-25
Reviewed by Filip Pizlo.

Currently, the globalTypeSet that converges the types of all
return statements in a function lives off of CodeBlock. It lives
off CodeBlock because of a faulty assumption that CodeBlock
will have a one to one mapping with a function in the source
text of the program. (Currently, there isn't an actual bug
with this design because TypeLocationCache will hash cons to
the same TypeLocation, but this is still an incorrect design).
In this patch, the globalTypeSet for function return statements
is moved to the FunctionExecutable object which does have a one
to one mapping with functions in the source text of a program.

  • bytecode/CodeBlock.cpp:

(JSC::CodeBlock::CodeBlock):

  • bytecode/CodeBlock.h:

(JSC::CodeBlock::returnStatementTypeSet): Deleted.

  • runtime/Executable.h:

(JSC::FunctionExecutable::returnStatementTypeSet):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp

    r172822 r172949  
    17071707    , m_optimizationDelayCounter(0)
    17081708    , m_reoptimizationRetryCounter(0)
    1709     , m_returnStatementTypeSet(nullptr)
    17101709#if ENABLE(JIT)
    17111710    , m_capabilityLevelState(DFG::CapabilityLevelNotSet)
     
    20442043            }
    20452044            case ProfileTypeBytecodeFunctionReturnStatement: {
    2046                 globalTypeSet = returnStatementTypeSet();
     2045                RELEASE_ASSERT(ownerExecutable->isFunctionExecutable());
     2046                globalTypeSet = jsCast<FunctionExecutable*>(ownerExecutable)->returnStatementTypeSet();
    20472047                globalVariableID = TypeProfilerReturnStatement;
    20482048                if (!shouldAnalyze) {
Note: See TracChangeset for help on using the changeset viewer.