summaryrefslogtreecommitdiff
path: root/Source/JavaScriptCore/bytecode/ArrayProfile.cpp
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@digia.com>2012-10-22 15:40:17 +0200
committerSimon Hausmann <simon.hausmann@digia.com>2012-10-22 15:40:17 +0200
commit43a42f108af6bcbd91f2672731c3047c26213af1 (patch)
tree7fa092e5f5d873c72f2486a70e26be26f7a38bec /Source/JavaScriptCore/bytecode/ArrayProfile.cpp
parentd9cf437c840c6eb7417bdd97e6c40979255d3158 (diff)
downloadqtwebkit-43a42f108af6bcbd91f2672731c3047c26213af1.tar.gz
Imported WebKit commit 302e7806bff028bd1167a1ec7c86a1ee00ecfb49 (http://svn.webkit.org/repository/webkit/trunk@132067)
New snapshot that fixes build without QtWidgets
Diffstat (limited to 'Source/JavaScriptCore/bytecode/ArrayProfile.cpp')
-rw-r--r--Source/JavaScriptCore/bytecode/ArrayProfile.cpp36
1 files changed, 36 insertions, 0 deletions
diff --git a/Source/JavaScriptCore/bytecode/ArrayProfile.cpp b/Source/JavaScriptCore/bytecode/ArrayProfile.cpp
index 3ba974d74..de7f67887 100644
--- a/Source/JavaScriptCore/bytecode/ArrayProfile.cpp
+++ b/Source/JavaScriptCore/bytecode/ArrayProfile.cpp
@@ -26,8 +26,44 @@
#include "config.h"
#include "ArrayProfile.h"
+#include <wtf/StringExtras.h>
+
namespace JSC {
+const char* arrayModesToString(ArrayModes arrayModes)
+{
+ if (!arrayModes)
+ return "0:<empty>";
+
+ if (arrayModes == ALL_ARRAY_MODES)
+ return "TOP";
+
+ bool isNonArray = !!(arrayModes & NonArray);
+ bool isNonArrayWithContiguous = !!(arrayModes & NonArrayWithContiguous);
+ bool isNonArrayWithArrayStorage = !!(arrayModes & NonArrayWithArrayStorage);
+ bool isNonArrayWithSlowPutArrayStorage = !!(arrayModes & NonArrayWithSlowPutArrayStorage);
+ bool isArray = !!(arrayModes & ArrayClass);
+ bool isArrayWithContiguous = !!(arrayModes & ArrayWithContiguous);
+ bool isArrayWithArrayStorage = !!(arrayModes & ArrayWithArrayStorage);
+ bool isArrayWithSlowPutArrayStorage = !!(arrayModes & ArrayWithSlowPutArrayStorage);
+
+ static char result[256];
+ snprintf(
+ result, sizeof(result),
+ "%u:%s%s%s%s%s%s%s%s",
+ arrayModes,
+ isNonArray ? "NonArray" : "",
+ isNonArrayWithContiguous ? "NonArrayWithContiguous" : "",
+ isNonArrayWithArrayStorage ? " NonArrayWithArrayStorage" : "",
+ isNonArrayWithSlowPutArrayStorage ? "NonArrayWithSlowPutArrayStorage" : "",
+ isArray ? "ArrayClass" : "",
+ isArrayWithContiguous ? "ArrayWithContiguous" : "",
+ isArrayWithArrayStorage ? " ArrayWithArrayStorage" : "",
+ isArrayWithSlowPutArrayStorage ? "ArrayWithSlowPutArrayStorage" : "");
+
+ return result;
+}
+
void ArrayProfile::computeUpdatedPrediction(OperationInProgress operation)
{
if (m_lastSeenStructure) {