summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/bytecode/CodeBlock.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@nokia.com>2012-01-11 10:03:25 +0100
committerSimon Hausmann <simon.hausmann@nokia.com>2012-01-11 10:03:25 +0100
commitd11f84f5b5cdc0d92a08af01b13472fdd5f9acb9 (patch)
treeb318cf594dc1da2fa48224005945c9157f35bb41 /Source/JavaScriptCore/bytecode/CodeBlock.cpp
parent6300a96eca9f152b379f1bcf3d9efdc5572d989a (diff)
downloadqtwebkit-d11f84f5b5cdc0d92a08af01b13472fdd5f9acb9.tar.gz
Imported WebKit commit 75bb2fc5882d2e1b3d5572c2961507996cbca5e3 (http://svn.webkit.org/repository/webkit/trunk@104681)
Diffstat (limited to 'Source/JavaScriptCore/bytecode/CodeBlock.cpp')
-rw-r--r--Source/JavaScriptCore/bytecode/CodeBlock.cpp54
1 files changed, 20 insertions, 34 deletions
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
index a14ce64a1..47745268c 100644
--- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp
+++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp
@@ -1413,7 +1413,6 @@ CodeBlock::CodeBlock(CopyParsedBlockTag, CodeBlock& other, SymbolTable* symTab)
, m_numCalleeRegisters(other.m_numCalleeRegisters)
, m_numVars(other.m_numVars)
, m_numCapturedVars(other.m_numCapturedVars)
- , m_numParameters(other.m_numParameters)
, m_isConstructor(other.m_isConstructor)
, m_shouldDiscardBytecode(false)
, m_ownerExecutable(*other.m_globalData, other.m_ownerExecutable.get(), other.m_ownerExecutable.get())
@@ -1448,6 +1447,7 @@ CodeBlock::CodeBlock(CopyParsedBlockTag, CodeBlock& other, SymbolTable* symTab)
, m_optimizationDelayCounter(0)
, m_reoptimizationRetryCounter(0)
{
+ setNumParameters(other.numParameters());
optimizeAfterWarmUp();
if (other.m_rareData) {
@@ -1469,9 +1469,9 @@ CodeBlock::CodeBlock(ScriptExecutable* ownerExecutable, CodeType codeType, JSGlo
, m_heap(&m_globalObject->globalData().heap)
, m_numCalleeRegisters(0)
, m_numVars(0)
- , m_numParameters(0)
, m_isConstructor(isConstructor)
, m_shouldDiscardBytecode(false)
+ , m_numParameters(0)
, m_ownerExecutable(globalObject->globalData(), ownerExecutable, ownerExecutable)
, m_globalData(0)
, m_instructions(adoptRef(new Instructions))
@@ -1538,6 +1538,24 @@ CodeBlock::~CodeBlock()
#endif
}
+void CodeBlock::setNumParameters(int newValue)
+{
+ m_numParameters = newValue;
+
+#if ENABLE(VALUE_PROFILER)
+ m_argumentValueProfiles.resize(newValue);
+#endif
+}
+
+void CodeBlock::addParameter()
+{
+ m_numParameters++;
+
+#if ENABLE(VALUE_PROFILER)
+ m_argumentValueProfiles.append(ValueProfile());
+#endif
+}
+
void CodeBlock::visitStructures(SlotVisitor& visitor, Instruction* vPC) const
{
Interpreter* interpreter = m_globalData->interpreter;
@@ -2038,38 +2056,6 @@ void CodeBlock::createActivation(CallFrame* callFrame)
}
#if ENABLE(JIT)
-void CallLinkInfo::unlink(JSGlobalData& globalData, RepatchBuffer& repatchBuffer)
-{
- ASSERT(isLinked());
-
- if (isDFG) {
-#if ENABLE(DFG_JIT)
- repatchBuffer.relink(CodeLocationCall(callReturnLocation), callType == Construct ? operationLinkConstruct : operationLinkCall);
-#else
- ASSERT_NOT_REACHED();
-#endif
- } else
- repatchBuffer.relink(CodeLocationNearCall(callReturnLocation), callType == Construct ? globalData.jitStubs->ctiVirtualConstructLink() : globalData.jitStubs->ctiVirtualCallLink());
- hasSeenShouldRepatch = false;
- callee.clear();
-
- // It will be on a list if the callee has a code block.
- if (isOnList())
- remove();
-}
-
-void MethodCallLinkInfo::reset(RepatchBuffer& repatchBuffer, JITCode::JITType jitType)
-{
- cachedStructure.clearToMaxUnsigned();
- cachedPrototype.clear();
- cachedPrototypeStructure.clearToMaxUnsigned();
- cachedFunction.clear();
-
- ASSERT_UNUSED(jitType, jitType == JITCode::BaselineJIT);
-
- repatchBuffer.relink(callReturnLocation, cti_op_get_by_id_method_check);
-}
-
void CodeBlock::unlinkCalls()
{
if (!!m_alternative)