summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/JavaScriptCore/bytecode/CodeBlock.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/JavaScriptCore/bytecode/CodeBlock.cpp')
-rw-r--r--src/3rdparty/webkit/JavaScriptCore/bytecode/CodeBlock.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/3rdparty/webkit/JavaScriptCore/bytecode/CodeBlock.cpp b/src/3rdparty/webkit/JavaScriptCore/bytecode/CodeBlock.cpp
index d2b122a..d777f73 100644
--- a/src/3rdparty/webkit/JavaScriptCore/bytecode/CodeBlock.cpp
+++ b/src/3rdparty/webkit/JavaScriptCore/bytecode/CodeBlock.cpp
@@ -1265,6 +1265,28 @@ void CodeBlock::dumpStatistics()
#endif
}
+CodeBlock::CodeBlock(ScopeNode* ownerNode)
+ : m_numCalleeRegisters(0)
+ , m_numConstants(0)
+ , m_numVars(0)
+ , m_numParameters(0)
+ , m_ownerNode(ownerNode)
+ , m_globalData(0)
+#ifndef NDEBUG
+ , m_instructionCount(0)
+#endif
+ , m_needsFullScopeChain(false)
+ , m_usesEval(false)
+ , m_isNumericCompareFunction(false)
+ , m_codeType(NativeCode)
+ , m_source(0)
+ , m_sourceOffset(0)
+ , m_exceptionInfo(0)
+{
+#if DUMP_CODE_BLOCK_STATISTICS
+ liveCodeBlockSet.add(this);
+#endif
+}
CodeBlock::CodeBlock(ScopeNode* ownerNode, CodeType codeType, PassRefPtr<SourceProvider> sourceProvider, unsigned sourceOffset)
: m_numCalleeRegisters(0)
@@ -1342,6 +1364,7 @@ void CodeBlock::unlinkCallers()
void CodeBlock::derefStructures(Instruction* vPC) const
{
+ ASSERT(m_codeType != NativeCode);
Interpreter* interpreter = m_globalData->interpreter;
if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self)) {
@@ -1387,6 +1410,7 @@ void CodeBlock::derefStructures(Instruction* vPC) const
void CodeBlock::refStructures(Instruction* vPC) const
{
+ ASSERT(m_codeType != NativeCode);
Interpreter* interpreter = m_globalData->interpreter;
if (vPC[0].u.opcode == interpreter->getOpcode(op_get_by_id_self)) {
@@ -1441,6 +1465,7 @@ void CodeBlock::mark()
void CodeBlock::reparseForExceptionInfoIfNecessary(CallFrame* callFrame)
{
+ ASSERT(m_codeType != NativeCode);
if (m_exceptionInfo)
return;
@@ -1511,6 +1536,7 @@ void CodeBlock::reparseForExceptionInfoIfNecessary(CallFrame* callFrame)
HandlerInfo* CodeBlock::handlerForBytecodeOffset(unsigned bytecodeOffset)
{
+ ASSERT(m_codeType != NativeCode);
ASSERT(bytecodeOffset < m_instructionCount);
if (!m_rareData)
@@ -1529,6 +1555,7 @@ HandlerInfo* CodeBlock::handlerForBytecodeOffset(unsigned bytecodeOffset)
int CodeBlock::lineNumberForBytecodeOffset(CallFrame* callFrame, unsigned bytecodeOffset)
{
+ ASSERT(m_codeType != NativeCode);
ASSERT(bytecodeOffset < m_instructionCount);
reparseForExceptionInfoIfNecessary(callFrame);
@@ -1554,6 +1581,7 @@ int CodeBlock::lineNumberForBytecodeOffset(CallFrame* callFrame, unsigned byteco
int CodeBlock::expressionRangeForBytecodeOffset(CallFrame* callFrame, unsigned bytecodeOffset, int& divot, int& startOffset, int& endOffset)
{
+ ASSERT(m_codeType != NativeCode);
ASSERT(bytecodeOffset < m_instructionCount);
reparseForExceptionInfoIfNecessary(callFrame);
@@ -1593,6 +1621,7 @@ int CodeBlock::expressionRangeForBytecodeOffset(CallFrame* callFrame, unsigned b
bool CodeBlock::getByIdExceptionInfoForBytecodeOffset(CallFrame* callFrame, unsigned bytecodeOffset, OpcodeID& opcodeID)
{
+ ASSERT(m_codeType != NativeCode);
ASSERT(bytecodeOffset < m_instructionCount);
reparseForExceptionInfoIfNecessary(callFrame);
@@ -1621,6 +1650,7 @@ bool CodeBlock::getByIdExceptionInfoForBytecodeOffset(CallFrame* callFrame, unsi
#if ENABLE(JIT)
bool CodeBlock::functionRegisterForBytecodeOffset(unsigned bytecodeOffset, int& functionRegisterIndex)
{
+ ASSERT(m_codeType != NativeCode);
ASSERT(bytecodeOffset < m_instructionCount);
if (!m_rareData || !m_rareData->m_functionRegisterInfos.size())
@@ -1647,6 +1677,7 @@ bool CodeBlock::functionRegisterForBytecodeOffset(unsigned bytecodeOffset, int&
#if !ENABLE(JIT)
bool CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset(unsigned bytecodeOffset)
{
+ ASSERT(m_codeType != NativeCode);
if (m_globalResolveInstructions.isEmpty())
return false;
@@ -1667,6 +1698,7 @@ bool CodeBlock::hasGlobalResolveInstructionAtBytecodeOffset(unsigned bytecodeOff
#else
bool CodeBlock::hasGlobalResolveInfoAtBytecodeOffset(unsigned bytecodeOffset)
{
+ ASSERT(m_codeType != NativeCode);
if (m_globalResolveInfos.isEmpty())
return false;
@@ -1689,6 +1721,7 @@ bool CodeBlock::hasGlobalResolveInfoAtBytecodeOffset(unsigned bytecodeOffset)
#if ENABLE(JIT)
void CodeBlock::setJITCode(JITCode jitCode)
{
+ ASSERT(m_codeType != NativeCode);
ownerNode()->setJITCode(jitCode);
#if !ENABLE(OPCODE_SAMPLING)
if (!BytecodeGenerator::dumpsGeneratedCode())