diff options
Diffstat (limited to 'Source/JavaScriptCore/bytecode')
-rw-r--r-- | Source/JavaScriptCore/bytecode/CodeBlock.cpp | 25 | ||||
-rw-r--r-- | Source/JavaScriptCore/bytecode/CodeBlock.h | 4 | ||||
-rw-r--r-- | Source/JavaScriptCore/bytecode/Watchpoint.cpp | 1 |
3 files changed, 29 insertions, 1 deletions
diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.cpp b/Source/JavaScriptCore/bytecode/CodeBlock.cpp index d417a5fbd..363efa28a 100644 --- a/Source/JavaScriptCore/bytecode/CodeBlock.cpp +++ b/Source/JavaScriptCore/bytecode/CodeBlock.cpp @@ -2942,4 +2942,29 @@ bool CodeBlock::usesOpcode(OpcodeID opcodeID) return false; } +UString CodeBlock::nameForRegister(int registerNumber) +{ + SymbolTable::iterator end = m_symbolTable->end(); + for (SymbolTable::iterator ptr = m_symbolTable->begin(); ptr != end; ++ptr) { + if (ptr->second.getIndex() == registerNumber) + return UString(ptr->first); + } + if (needsActivation() && registerNumber == activationRegister()) + return "activation"; + if (registerNumber == thisRegister()) + return "this"; + if (usesArguments()) { + if (registerNumber == argumentsRegister()) + return "arguments"; + if (unmodifiedArgumentsRegister(argumentsRegister()) == registerNumber) + return "real arguments"; + } + if (registerNumber < 0) { + int argumentPosition = -registerNumber; + argumentPosition -= RegisterFile::CallFrameHeaderSize + 1; + return String::format("arguments[%3d]", argumentPosition - 1).impl(); + } + return ""; +} + } // namespace JSC diff --git a/Source/JavaScriptCore/bytecode/CodeBlock.h b/Source/JavaScriptCore/bytecode/CodeBlock.h index 56ede595a..2a7d2120a 100644 --- a/Source/JavaScriptCore/bytecode/CodeBlock.h +++ b/Source/JavaScriptCore/bytecode/CodeBlock.h @@ -578,7 +578,9 @@ namespace JSC { void createActivation(CallFrame*); void clearEvalCache(); - + + UString nameForRegister(int registerNumber); + void addPropertyAccessInstruction(unsigned propertyAccessInstruction) { m_propertyAccessInstructions.append(propertyAccessInstruction); diff --git a/Source/JavaScriptCore/bytecode/Watchpoint.cpp b/Source/JavaScriptCore/bytecode/Watchpoint.cpp index 6f80dfa5e..75dfe8a76 100644 --- a/Source/JavaScriptCore/bytecode/Watchpoint.cpp +++ b/Source/JavaScriptCore/bytecode/Watchpoint.cpp @@ -27,6 +27,7 @@ #include "Watchpoint.h" #include "LinkBuffer.h" +#include <wtf/PassRefPtr.h> namespace JSC { |