Value profling and execution count profiling is performed even for
code that cannot be optimized
https://bugs.webkit.org/show_bug.cgi?id=67694
Reviewed by Gavin Barraclough.
This is a 2% speed-up on V8 when tiered compilation is enabled.
* JavaScriptCore.xcodeproj/project.pbxproj:
* bytecode/CodeBlock.cpp:
(JSC::ProgramCodeBlock::canCompileWithDFG):
(JSC::EvalCodeBlock::canCompileWithDFG):
(JSC::FunctionCodeBlock::canCompileWithDFG):
* bytecode/CodeBlock.h:
* dfg/DFGCapabilities.cpp: Added.
(JSC::DFG::canCompileOpcodes):
* dfg/DFGCapabilities.h: Added.
(JSC::DFG::mightCompileEval):
(JSC::DFG::mightCompileProgram):
(JSC::DFG::mightCompileFunctionForCall):
(JSC::DFG::mightCompileFunctionForConstruct):
(JSC::DFG::canCompileOpcode):
(JSC::DFG::canCompileEval):
(JSC::DFG::canCompileProgram):
(JSC::DFG::canCompileFunctionForCall):
(JSC::DFG::canCompileFunctionForConstruct):
* jit/JIT.cpp:
(JSC::JIT::emitOptimizationCheck):
(JSC::JIT::privateCompile):
* jit/JIT.h:
(JSC::JIT::shouldEmitProfiling):
* jit/JITInlineMethods.h:
(JSC::JIT::emitValueProfilingSite):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@94802 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/jit/JITInlineMethods.h b/Source/JavaScriptCore/jit/JITInlineMethods.h
index 8fe1c7a..965d984 100644
--- a/Source/JavaScriptCore/jit/JITInlineMethods.h
+++ b/Source/JavaScriptCore/jit/JITInlineMethods.h
@@ -435,6 +435,9 @@
#if ENABLE(VALUE_PROFILER)
inline void JIT::emitValueProfilingSite(ValueProfilingSiteKind siteKind)
{
+ if (!shouldEmitProfiling())
+ return;
+
const RegisterID value = regT0;
const RegisterID scratch = regT3;