diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-09-10 13:08:05 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-09-11 09:25:42 +0200 |
commit | 5909e6d0d10de3e1370b3ea0bc596f580101e3b4 (patch) | |
tree | 6acc39b8ea0165562d480f1c54608c6c4ae9f865 /Source/JavaScriptCore/bytecode/Opcode.cpp | |
parent | beaeeb99881184fd368c121fcbb1a31c78b794a3 (diff) | |
parent | 81cbb264cb9446c4408124d50aeff50164ad0ab4 (diff) | |
download | qtwebkit-5909e6d0d10de3e1370b3ea0bc596f580101e3b4.tar.gz |
Merge "Merge remote-tracking branch 'origin/5.212' into dev"
Diffstat (limited to 'Source/JavaScriptCore/bytecode/Opcode.cpp')
-rw-r--r-- | Source/JavaScriptCore/bytecode/Opcode.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/Source/JavaScriptCore/bytecode/Opcode.cpp b/Source/JavaScriptCore/bytecode/Opcode.cpp index 0d16dfc2f..25e857d76 100644 --- a/Source/JavaScriptCore/bytecode/Opcode.cpp +++ b/Source/JavaScriptCore/bytecode/Opcode.cpp @@ -49,6 +49,18 @@ const char* const opcodeNames[] = { #if ENABLE(OPCODE_STATS) +inline const char* padOpcodeName(OpcodeID op, unsigned width) +{ + auto padding = " "; + auto paddingLength = strlen(padding); + auto opcodeNameLength = strlen(opcodeNames[op]); + if (opcodeNameLength >= width) + return ""; + if (paddingLength + opcodeNameLength < width) + return padding; + return &padding[paddingLength + opcodeNameLength - width]; +} + long long OpcodeStats::opcodeCounts[numOpcodeIDs]; long long OpcodeStats::opcodePairCounts[numOpcodeIDs][numOpcodeIDs]; int OpcodeStats::lastOpcode = -1; @@ -80,9 +92,9 @@ static int compareOpcodeIndices(const void* left, const void* right) static int compareOpcodePairIndices(const void* left, const void* right) { - std::pair<int, int> leftPair = *(pair<int, int>*) left; + std::pair<int, int> leftPair = *(std::pair<int, int>*) left; long long leftValue = OpcodeStats::opcodePairCounts[leftPair.first][leftPair.second]; - std::pair<int, int> rightPair = *(pair<int, int>*) right; + std::pair<int, int> rightPair = *(std::pair<int, int>*) right; long long rightValue = OpcodeStats::opcodePairCounts[rightPair.first][rightPair.second]; if (leftValue < rightValue) |