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.h

    r172614 r172949  
    6565#include "RegExpObject.h"
    6666#include "StructureStubInfo.h"
    67 #include "TypeSet.h"
    6867#include "UnconditionalFinalizer.h"
    6968#include "ValueProfile.h"
     
    943942
    944943    bool isKnownToBeLiveDuringGC(); // Will only return valid results when called during GC. Assumes that you've already established that the owner executable is live.
    945     RefPtr<TypeSet> returnStatementTypeSet()
    946     {
    947         if (!m_returnStatementTypeSet)
    948             m_returnStatementTypeSet = TypeSet::create();
    949 
    950         return m_returnStatementTypeSet;
    951     }
    952944
    953945
     
    11001092    std::unique_ptr<BytecodeLivenessAnalysis> m_livenessAnalysis;
    11011093
    1102     RefPtr<TypeSet> m_returnStatementTypeSet;
    1103 
    11041094    struct RareData {
    11051095        WTF_MAKE_FAST_ALLOCATED;
Note: See TracChangeset for help on using the changeset viewer.