Changeset 172949 in webkit
- Timestamp:
- Aug 25, 2014, 7:17:58 PM (11 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r172940 r172949 1 2014-08-25 Saam Barati <[email protected]> 2 3 Return statement TypeSet's might be duplicated 4 https://bugs.webkit.org/show_bug.cgi?id=136200 5 6 Reviewed by Filip Pizlo. 7 8 Currently, the globalTypeSet that converges the types of all 9 return statements in a function lives off of CodeBlock. It lives 10 off CodeBlock because of a faulty assumption that CodeBlock 11 will have a one to one mapping with a function in the source 12 text of the program. (Currently, there isn't an actual bug 13 with this design because TypeLocationCache will hash cons to 14 the same TypeLocation, but this is still an incorrect design). 15 In this patch, the globalTypeSet for function return statements 16 is moved to the FunctionExecutable object which does have a one 17 to one mapping with functions in the source text of a program. 18 19 * bytecode/CodeBlock.cpp: 20 (JSC::CodeBlock::CodeBlock): 21 * bytecode/CodeBlock.h: 22 (JSC::CodeBlock::returnStatementTypeSet): Deleted. 23 * runtime/Executable.h: 24 (JSC::FunctionExecutable::returnStatementTypeSet): 25 1 26 2014-08-24 Filip Pizlo <[email protected]> 2 27 -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.cpp
r172822 r172949 1707 1707 , m_optimizationDelayCounter(0) 1708 1708 , m_reoptimizationRetryCounter(0) 1709 , m_returnStatementTypeSet(nullptr)1710 1709 #if ENABLE(JIT) 1711 1710 , m_capabilityLevelState(DFG::CapabilityLevelNotSet) … … 2044 2043 } 2045 2044 case ProfileTypeBytecodeFunctionReturnStatement: { 2046 globalTypeSet = returnStatementTypeSet(); 2045 RELEASE_ASSERT(ownerExecutable->isFunctionExecutable()); 2046 globalTypeSet = jsCast<FunctionExecutable*>(ownerExecutable)->returnStatementTypeSet(); 2047 2047 globalVariableID = TypeProfilerReturnStatement; 2048 2048 if (!shouldAnalyze) { -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r172614 r172949 65 65 #include "RegExpObject.h" 66 66 #include "StructureStubInfo.h" 67 #include "TypeSet.h"68 67 #include "UnconditionalFinalizer.h" 69 68 #include "ValueProfile.h" … … 943 942 944 943 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 }952 944 953 945 … … 1100 1092 std::unique_ptr<BytecodeLivenessAnalysis> m_livenessAnalysis; 1101 1093 1102 RefPtr<TypeSet> m_returnStatementTypeSet;1103 1104 1094 struct RareData { 1105 1095 WTF_MAKE_FAST_ALLOCATED; -
trunk/Source/JavaScriptCore/runtime/Executable.h
r172820 r172949 41 41 #include "SamplingTool.h" 42 42 #include "SourceCode.h" 43 #include "TypeSet.h" 43 44 #include "UnlinkedCodeBlock.h" 44 45 #include <wtf/PassOwnPtr.h> … … 613 614 return baselineCodeBlockFor(kind); 614 615 } 616 617 RefPtr<TypeSet> returnStatementTypeSet() 618 { 619 if (!m_returnStatementTypeSet) 620 m_returnStatementTypeSet = TypeSet::create(); 621 622 return m_returnStatementTypeSet; 623 } 615 624 616 625 FunctionMode functionMode() { return m_unlinkedExecutable->functionMode(); } … … 660 669 bool m_bodyIncludesBraces; 661 670 bool m_didParseForTheFirstTime; 671 RefPtr<TypeSet> m_returnStatementTypeSet; 662 672 }; 663 673
Note:
See TracChangeset
for help on using the changeset viewer.