summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/bytecode/ValueProfile.h
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@digia.com>2013-09-13 12:51:20 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-19 20:50:05 +0200
commitd441d6f39bb846989d95bcf5caf387b42414718d (patch)
treee367e64a75991c554930278175d403c072de6bb8 /Source/JavaScriptCore/bytecode/ValueProfile.h
parent0060b2994c07842f4c59de64b5e3e430525c4b90 (diff)
downloadqtwebkit-d441d6f39bb846989d95bcf5caf387b42414718d.tar.gz
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit. Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/JavaScriptCore/bytecode/ValueProfile.h')
-rw-r--r--Source/JavaScriptCore/bytecode/ValueProfile.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/Source/JavaScriptCore/bytecode/ValueProfile.h b/Source/JavaScriptCore/bytecode/ValueProfile.h
index e56e6eb6e..028c1f696 100644
--- a/Source/JavaScriptCore/bytecode/ValueProfile.h
+++ b/Source/JavaScriptCore/bytecode/ValueProfile.h
@@ -39,6 +39,7 @@
#include "Structure.h"
#include "WriteBarrier.h"
#include <wtf/PrintStream.h>
+#include <wtf/StringPrintStream.h>
namespace JSC {
@@ -110,6 +111,20 @@ struct ValueProfileBase {
return false;
}
+ CString briefDescription()
+ {
+ computeUpdatedPrediction();
+
+ StringPrintStream out;
+
+ if (m_singletonValueIsTop)
+ out.print("predicting ", SpeculationDump(m_prediction));
+ else if (m_singletonValue)
+ out.print("predicting ", m_singletonValue);
+
+ return out.toCString();
+ }
+
void dump(PrintStream& out)
{
out.print("samples = ", totalNumberOfSamples(), " prediction = ", SpeculationDump(m_prediction));
@@ -117,7 +132,7 @@ struct ValueProfileBase {
if (m_singletonValueIsTop)
out.printf("TOP");
else
- out.printf("%s", m_singletonValue.description());
+ out.print(m_singletonValue);
bool first = true;
for (unsigned i = 0; i < totalNumberOfBuckets; ++i) {
JSValue value = JSValue::decode(m_buckets[i]);
@@ -127,7 +142,7 @@ struct ValueProfileBase {
first = false;
} else
out.printf(", ");
- out.printf("%s", value.description());
+ out.print(value);
}
}
}