summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/dfg/DFGPredictionInjectionPhase.cpp
diff options
context:
space:
mode:
authorKonstantin Tokarev <annulen@yandex.ru>2016-08-25 19:20:41 +0300
committerKonstantin Tokarev <annulen@yandex.ru>2017-02-02 12:30:55 +0000
commit6882a04fb36642862b11efe514251d32070c3d65 (patch)
treeb7959826000b061fd5ccc7512035c7478742f7b0 /Source/JavaScriptCore/dfg/DFGPredictionInjectionPhase.cpp
parentab6df191029eeeb0b0f16f127d553265659f739e (diff)
downloadqtwebkit-6882a04fb36642862b11efe514251d32070c3d65.tar.gz
Imported QtWebKit TP3 (git b57bc6801f1876c3220d5a4bfea33d620d477443)
Change-Id: I3b1d8a2808782c9f34d50240000e20cb38d3680f Reviewed-by: Konstantin Tokarev <annulen@yandex.ru>
Diffstat (limited to 'Source/JavaScriptCore/dfg/DFGPredictionInjectionPhase.cpp')
-rw-r--r--Source/JavaScriptCore/dfg/DFGPredictionInjectionPhase.cpp37
1 files changed, 18 insertions, 19 deletions
diff --git a/Source/JavaScriptCore/dfg/DFGPredictionInjectionPhase.cpp b/Source/JavaScriptCore/dfg/DFGPredictionInjectionPhase.cpp
index d5a592024..d9a39f90f 100644
--- a/Source/JavaScriptCore/dfg/DFGPredictionInjectionPhase.cpp
+++ b/Source/JavaScriptCore/dfg/DFGPredictionInjectionPhase.cpp
@@ -31,7 +31,7 @@
#include "DFGBasicBlockInlines.h"
#include "DFGGraph.h"
#include "DFGPhase.h"
-#include "Operations.h"
+#include "JSCInlines.h"
namespace JSC { namespace DFG {
@@ -48,36 +48,35 @@ public:
ASSERT(m_graph.m_unificationState == GloballyUnified);
ASSERT(codeBlock()->numParameters() >= 1);
- for (size_t arg = 0; arg < static_cast<size_t>(codeBlock()->numParameters()); ++arg) {
- ValueProfile* profile = profiledBlock()->valueProfileForArgument(arg);
- if (!profile)
- continue;
+ {
+ ConcurrentJITLocker locker(profiledBlock()->m_lock);
- m_graph.m_arguments[arg]->variableAccessData()->predict(profile->computeUpdatedPrediction());
+ for (size_t arg = 0; arg < static_cast<size_t>(codeBlock()->numParameters()); ++arg) {
+ ValueProfile* profile = profiledBlock()->valueProfileForArgument(arg);
+ if (!profile)
+ continue;
-#if DFG_ENABLE(DEBUG_VERBOSE)
- dataLog(
- "Argument [", arg, "] prediction: ",
- SpeculationDump(m_graph.m_arguments[arg]->variableAccessData()->prediction()), "\n");
-#endif
+ m_graph.m_arguments[arg]->variableAccessData()->predict(
+ profile->computeUpdatedPrediction(locker));
+ }
}
- for (BlockIndex blockIndex = 0; blockIndex < m_graph.m_blocks.size(); ++blockIndex) {
- BasicBlock* block = m_graph.m_blocks[blockIndex].get();
+ for (BlockIndex blockIndex = 0; blockIndex < m_graph.numBlocks(); ++blockIndex) {
+ BasicBlock* block = m_graph.block(blockIndex);
if (!block)
continue;
if (!block->isOSRTarget)
continue;
- if (block->bytecodeBegin != m_graph.m_osrEntryBytecodeIndex)
+ if (block->bytecodeBegin != m_graph.m_plan.osrEntryBytecodeIndex)
continue;
- for (size_t i = 0; i < m_graph.m_mustHandleValues.size(); ++i) {
- Node* node = block->variablesAtHead.operand(
- m_graph.m_mustHandleValues.operandForIndex(i));
+ for (size_t i = 0; i < m_graph.m_plan.mustHandleValues.size(); ++i) {
+ int operand = m_graph.m_plan.mustHandleValues.operandForIndex(i);
+ Node* node = block->variablesAtHead.operand(operand);
if (!node)
continue;
- ASSERT(node->hasLocal());
+ ASSERT(node->hasLocal(m_graph));
node->variableAccessData()->predict(
- speculationFromValue(m_graph.m_mustHandleValues[i]));
+ speculationFromValue(m_graph.m_plan.mustHandleValues[i]));
}
}