diff options
author | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-18 14:03:11 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@nokia.com> | 2012-05-18 14:03:11 +0200 |
commit | 8d473cf9743f1d30a16a27114e93bd5af5648d23 (patch) | |
tree | cdca40d0353886b3ca52f33a2d7b8f1c0011aafc /Source/JavaScriptCore/bytecode | |
parent | 1b914638db989aaa98631a1c1e02c7b2d44805d8 (diff) | |
download | qtwebkit-8d473cf9743f1d30a16a27114e93bd5af5648d23.tar.gz |
Imported WebKit commit 1350e72f7345ced9da2bd9980deeeb5a8d62fab4 (http://svn.webkit.org/repository/webkit/trunk@117578)
Weekly snapshot
Diffstat (limited to 'Source/JavaScriptCore/bytecode')
-rw-r--r-- | Source/JavaScriptCore/bytecode/CodeBlock.cpp | 42 | ||||
-rw-r--r-- | Source/JavaScriptCore/bytecode/CodeBlock.h | 25 |
2 files changed, 45 insertions, 22 deletions
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp index 6a4d073bf..fa663504c 100644 --- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp +++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp @@ -2092,22 +2092,33 @@ bool CodeBlock::hasGlobalResolveInfoAtBytecodeOffset(unsigned bytecodeOffset) } #endif -void CodeBlock::shrinkToFit() +void CodeBlock::shrinkToFit(ShrinkMode shrinkMode) { -#if ENABLE(CLASSIC_INTERPRETER) m_propertyAccessInstructions.shrinkToFit(); m_globalResolveInstructions.shrinkToFit(); +#if ENABLE(LLINT) + m_llintCallLinkInfos.shrinkToFit(); #endif #if ENABLE(JIT) m_structureStubInfos.shrinkToFit(); m_globalResolveInfos.shrinkToFit(); m_callLinkInfos.shrinkToFit(); + m_methodCallLinkInfos.shrinkToFit(); #endif - - m_identifiers.shrinkToFit(); - m_functionDecls.shrinkToFit(); - m_functionExprs.shrinkToFit(); - m_constantRegisters.shrinkToFit(); +#if ENABLE(VALUE_PROFILER) + if (shrinkMode == EarlyShrink) + m_argumentValueProfiles.shrinkToFit(); + m_valueProfiles.shrinkToFit(); + m_rareCaseProfiles.shrinkToFit(); + m_specialFastCaseProfiles.shrinkToFit(); +#endif + + if (shrinkMode == EarlyShrink) { + m_identifiers.shrinkToFit(); + m_functionDecls.shrinkToFit(); + m_functionExprs.shrinkToFit(); + m_constantRegisters.shrinkToFit(); + } // else don't shrink these, because we would have already pointed pointers into these tables. if (m_rareData) { m_rareData->m_exceptionHandlers.shrinkToFit(); @@ -2117,7 +2128,24 @@ void CodeBlock::shrinkToFit() m_rareData->m_stringSwitchJumpTables.shrinkToFit(); m_rareData->m_expressionInfo.shrinkToFit(); m_rareData->m_lineInfo.shrinkToFit(); +#if ENABLE(JIT) + m_rareData->m_callReturnIndexVector.shrinkToFit(); +#endif +#if ENABLE(DFG_JIT) + m_rareData->m_inlineCallFrames.shrinkToFit(); + m_rareData->m_codeOrigins.shrinkToFit(); +#endif } + +#if ENABLE(DFG_JIT) + if (m_dfgData) { + m_dfgData->osrEntry.shrinkToFit(); + m_dfgData->osrExit.shrinkToFit(); + m_dfgData->speculationRecovery.shrinkToFit(); + m_dfgData->weakReferences.shrinkToFit(); + m_dfgData->transitions.shrinkToFit(); + } +#endif } void CodeBlock::createActivation(CallFrame* callFrame) diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.h b/Source/JavaScriptCore/bytecode/CodeBlock.h index 778376f94..fe69ec673 100644 --- a/Source/JavaScriptCore/bytecode/CodeBlock.h +++ b/Source/JavaScriptCore/bytecode/CodeBlock.h @@ -309,26 +309,12 @@ namespace JSC { m_dfgData->weakReferences.append(WriteBarrier<JSCell>(*globalData(), ownerExecutable(), target)); } - void shrinkWeakReferencesToFit() - { - if (!m_dfgData) - return; - m_dfgData->weakReferences.shrinkToFit(); - } - void appendWeakReferenceTransition(JSCell* codeOrigin, JSCell* from, JSCell* to) { createDFGDataIfNecessary(); m_dfgData->transitions.append( WeakReferenceTransition(*globalData(), ownerExecutable(), codeOrigin, from, to)); } - - void shrinkWeakReferenceTransitionsToFit() - { - if (!m_dfgData) - return; - m_dfgData->transitions.shrinkToFit(); - } #endif unsigned bytecodeOffset(Instruction* returnAddress) @@ -826,7 +812,16 @@ namespace JSC { EvalCodeCache& evalCodeCache() { createRareDataIfNecessary(); return m_rareData->m_evalCodeCache; } - void shrinkToFit(); + enum ShrinkMode { + // Shrink prior to generating machine code that may point directly into vectors. + EarlyShrink, + + // Shrink after generating machine code, and after possibly creating new vectors + // and appending to others. At this time it is not safe to shrink certain vectors + // because we would have generated machine code that references them directly. + LateShrink + }; + void shrinkToFit(ShrinkMode); void copyPostParseDataFrom(CodeBlock* alternative); void copyPostParseDataFromAlternative(); |