Value Profiles for arguments should be more easily accessible to the interpreter
https://bugs.webkit.org/show_bug.cgi?id=74984
<rdar://problem/10611364>
Reviewed by Gavin Barraclough.
* bytecode/CodeBlock.cpp:
(JSC::CodeBlock::stronglyVisitStrongReferences):
(JSC::CodeBlock::shouldOptimizeNow):
(JSC::CodeBlock::dumpValueProfiles):
* bytecode/CodeBlock.h:
(JSC::CodeBlock::setArgumentValueProfileSize):
(JSC::CodeBlock::numberOfArgumentValueProfiles):
(JSC::CodeBlock::valueProfileForArgument):
(JSC::CodeBlock::addValueProfile):
(JSC::CodeBlock::valueProfile):
(JSC::CodeBlock::valueProfileForBytecodeOffset):
(JSC::CodeBlock::totalNumberOfValueProfiles):
(JSC::CodeBlock::getFromAllValueProfiles):
* bytecode/ValueProfile.h:
(JSC::ValueProfile::ValueProfile):
* jit/JIT.cpp:
(JSC::JIT::privateCompile):
* jit/JIT.h:
* jit/JITInlineMethods.h:
(JSC::JIT::emitValueProfilingSite):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@103384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/bytecode/ValueProfile.h b/Source/JavaScriptCore/bytecode/ValueProfile.h
index 4c41e6a..02a1d6b 100644
--- a/Source/JavaScriptCore/bytecode/ValueProfile.h
+++ b/Source/JavaScriptCore/bytecode/ValueProfile.h
@@ -44,6 +44,15 @@
static const unsigned bucketIndexMask = numberOfBuckets - 1;
static const unsigned totalNumberOfBuckets = numberOfBuckets + numberOfSpecFailBuckets;
+ ValueProfile()
+ : m_bytecodeOffset(-1)
+ , m_prediction(PredictNone)
+ , m_numberOfSamplesInPrediction(0)
+ {
+ for (unsigned i = 0; i < totalNumberOfBuckets; ++i)
+ m_buckets[i] = JSValue::encode(JSValue());
+ }
+
ValueProfile(int bytecodeOffset)
: m_bytecodeOffset(bytecodeOffset)
, m_prediction(PredictNone)