]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - bytecode/Opcode.cpp
JavaScriptCore-903.tar.gz
[apple/javascriptcore.git] / bytecode / Opcode.cpp
index bb7696dd8d6df5e84815c41184bddb9d485ff13d..0bb714bca2d14ed884574fb73c9cac8947faca4f 100644 (file)
 #include "config.h"
 #include "Opcode.h"
 
 #include "config.h"
 #include "Opcode.h"
 
+#if ENABLE(OPCODE_STATS)
+#include <stdio.h>
+#include <wtf/FixedArray.h>
+#endif
+
 using namespace std;
 
 namespace JSC {
 using namespace std;
 
 namespace JSC {
@@ -101,10 +106,10 @@ OpcodeStats::~OpcodeStats()
         for (int j = 0; j < numOpcodeIDs; ++j)
             totalInstructionPairs += opcodePairCounts[i][j];
 
         for (int j = 0; j < numOpcodeIDs; ++j)
             totalInstructionPairs += opcodePairCounts[i][j];
 
-    int sortedIndices[numOpcodeIDs];    
+    FixedArray<int, numOpcodeIDs> sortedIndices;
     for (int i = 0; i < numOpcodeIDs; ++i)
         sortedIndices[i] = i;
     for (int i = 0; i < numOpcodeIDs; ++i)
         sortedIndices[i] = i;
-    qsort(sortedIndices, numOpcodeIDs, sizeof(int), compareOpcodeIndices);
+    qsort(sortedIndices.data(), numOpcodeIDs, sizeof(int), compareOpcodeIndices);
     
     pair<int, int> sortedPairIndices[numOpcodeIDs * numOpcodeIDs];
     pair<int, int>* currentPairIndex = sortedPairIndices;
     
     pair<int, int> sortedPairIndices[numOpcodeIDs * numOpcodeIDs];
     pair<int, int>* currentPairIndex = sortedPairIndices;