diff options
| author | Russell Brenner <russellbrenner@google.com> | 2010-11-18 17:33:13 -0800 |
|---|---|---|
| committer | Russell Brenner <russellbrenner@google.com> | 2010-12-02 13:47:21 -0800 |
| commit | 6b70adc33054f8aee8c54d0f460458a9df11b8a5 (patch) | |
| tree | 103a13998c33944d6ab3b8318c509a037e639460 /JavaScriptCore/bytecode | |
| parent | bdf4ebc8e70b2d221b6ee7a65660918ecb1d33aa (diff) | |
| download | external_webkit-6b70adc33054f8aee8c54d0f460458a9df11b8a5.zip external_webkit-6b70adc33054f8aee8c54d0f460458a9df11b8a5.tar.gz external_webkit-6b70adc33054f8aee8c54d0f460458a9df11b8a5.tar.bz2 | |
Merge WebKit at r72274: Initial merge by git.
Change-Id: Ie51f0b4a16da82942bd516dce59cfb79ebbe25fb
Diffstat (limited to 'JavaScriptCore/bytecode')
| -rw-r--r-- | JavaScriptCore/bytecode/CodeBlock.cpp | 51 | ||||
| -rw-r--r-- | JavaScriptCore/bytecode/CodeBlock.h | 13 | ||||
| -rw-r--r-- | JavaScriptCore/bytecode/Opcode.h | 4 |
3 files changed, 21 insertions, 47 deletions
diff --git a/JavaScriptCore/bytecode/CodeBlock.cpp b/JavaScriptCore/bytecode/CodeBlock.cpp index 55101d4..bcd2af3 100644 --- a/JavaScriptCore/bytecode/CodeBlock.cpp +++ b/JavaScriptCore/bytecode/CodeBlock.cpp @@ -663,6 +663,11 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator& printUnaryOp(exec, location, it, "bitnot"); break; } + case op_check_has_instance: { + int base = (++it)->u.operand; + printf("[%4d] check_has_instance\t\t %s\n", location, registerName(exec, base).data()); + break; + } case op_instanceof: { int r0 = (++it)->u.operand; int r1 = (++it)->u.operand; @@ -1187,11 +1192,14 @@ void CodeBlock::dump(ExecState* exec, const Vector<Instruction>::const_iterator& printf("[%4d] throw\t\t %s\n", location, registerName(exec, r0).data()); break; } - case op_new_error: { - int r0 = (++it)->u.operand; - int errorType = (++it)->u.operand; + case op_throw_reference_error: { int k0 = (++it)->u.operand; - printf("[%4d] new_error\t %s, %d, %s\n", location, registerName(exec, r0).data(), errorType, constantName(exec, k0, getConstant(k0)).data()); + printf("[%4d] throw_reference_error\t %s\n", location, constantName(exec, k0, getConstant(k0)).data()); + break; + } + case op_throw_syntax_error: { + int k0 = (++it)->u.operand; + printf("[%4d] throw_syntax_error\t %s\n", location, constantName(exec, k0, getConstant(k0)).data()); break; } case op_jsr: { @@ -1617,7 +1625,7 @@ int CodeBlock::lineNumberForBytecodeOffset(CallFrame* callFrame, unsigned byteco return m_exceptionInfo->m_lineInfo[low - 1].lineNumber; } -int CodeBlock::expressionRangeForBytecodeOffset(CallFrame* callFrame, unsigned bytecodeOffset, int& divot, int& startOffset, int& endOffset) +void CodeBlock::expressionRangeForBytecodeOffset(CallFrame* callFrame, unsigned bytecodeOffset, int& divot, int& startOffset, int& endOffset) { ASSERT(bytecodeOffset < m_instructionCount); @@ -1627,7 +1635,7 @@ int CodeBlock::expressionRangeForBytecodeOffset(CallFrame* callFrame, unsigned b startOffset = 0; endOffset = 0; divot = 0; - return lineNumberForBytecodeOffset(callFrame, bytecodeOffset); + return; } int low = 0; @@ -1639,43 +1647,19 @@ int CodeBlock::expressionRangeForBytecodeOffset(CallFrame* callFrame, unsigned b else high = mid; } - + ASSERT(low); if (!low) { startOffset = 0; endOffset = 0; divot = 0; - return lineNumberForBytecodeOffset(callFrame, bytecodeOffset); + return; } startOffset = m_exceptionInfo->m_expressionInfo[low - 1].startOffset; endOffset = m_exceptionInfo->m_expressionInfo[low - 1].endOffset; divot = m_exceptionInfo->m_expressionInfo[low - 1].divotPoint + m_sourceOffset; - return lineNumberForBytecodeOffset(callFrame, bytecodeOffset); -} - -bool CodeBlock::getByIdExceptionInfoForBytecodeOffset(CallFrame* callFrame, unsigned bytecodeOffset, OpcodeID& opcodeID) -{ - ASSERT(bytecodeOffset < m_instructionCount); - - if (!reparseForExceptionInfoIfNecessary(callFrame) || !m_exceptionInfo->m_getByIdExceptionInfo.size()) - return false; - - int low = 0; - int high = m_exceptionInfo->m_getByIdExceptionInfo.size(); - while (low < high) { - int mid = low + (high - low) / 2; - if (m_exceptionInfo->m_getByIdExceptionInfo[mid].bytecodeOffset <= bytecodeOffset) - low = mid + 1; - else - high = mid; - } - - if (!low || m_exceptionInfo->m_getByIdExceptionInfo[low - 1].bytecodeOffset != bytecodeOffset) - return false; - - opcodeID = m_exceptionInfo->m_getByIdExceptionInfo[low - 1].isOpCreateThis ? op_create_this : op_instanceof; - return true; + return; } #if ENABLE(JIT) @@ -1770,7 +1754,6 @@ void CodeBlock::shrinkToFit() if (m_exceptionInfo) { m_exceptionInfo->m_expressionInfo.shrinkToFit(); m_exceptionInfo->m_lineInfo.shrinkToFit(); - m_exceptionInfo->m_getByIdExceptionInfo.shrinkToFit(); } if (m_rareData) { diff --git a/JavaScriptCore/bytecode/CodeBlock.h b/JavaScriptCore/bytecode/CodeBlock.h index 68acae4..54acd50 100644 --- a/JavaScriptCore/bytecode/CodeBlock.h +++ b/JavaScriptCore/bytecode/CodeBlock.h @@ -93,14 +93,6 @@ namespace JSC { int32_t lineNumber; }; - // Both op_construct and op_instanceof require a use of op_get_by_id to get - // the prototype property from an object. The exception messages for exceptions - // thrown by these instances op_get_by_id need to reflect this. - struct GetByIdExceptionInfo { - unsigned bytecodeOffset : 31; - bool isOpCreateThis : 1; - }; - #if ENABLE(JIT) struct CallLinkInfo { CallLinkInfo() @@ -265,7 +257,6 @@ namespace JSC { struct ExceptionInfo : FastAllocBase { Vector<ExpressionRangeInfo> m_expressionInfo; Vector<LineInfo> m_lineInfo; - Vector<GetByIdExceptionInfo> m_getByIdExceptionInfo; #if ENABLE(JIT) Vector<CallReturnOffsetToBytecodeOffset> m_callReturnIndexVector; @@ -317,8 +308,7 @@ namespace JSC { HandlerInfo* handlerForBytecodeOffset(unsigned bytecodeOffset); int lineNumberForBytecodeOffset(CallFrame*, unsigned bytecodeOffset); - int expressionRangeForBytecodeOffset(CallFrame*, unsigned bytecodeOffset, int& divot, int& startOffset, int& endOffset); - bool getByIdExceptionInfoForBytecodeOffset(CallFrame*, unsigned bytecodeOffset, OpcodeID&); + void expressionRangeForBytecodeOffset(CallFrame*, unsigned bytecodeOffset, int& divot, int& startOffset, int& endOffset); #if ENABLE(JIT) void addCaller(CallLinkInfo* caller) @@ -468,7 +458,6 @@ namespace JSC { PassOwnPtr<ExceptionInfo> extractExceptionInfo(); void addExpressionInfo(const ExpressionRangeInfo& expressionInfo) { ASSERT(m_exceptionInfo); m_exceptionInfo->m_expressionInfo.append(expressionInfo); } - void addGetByIdExceptionInfo(const GetByIdExceptionInfo& info) { ASSERT(m_exceptionInfo); m_exceptionInfo->m_getByIdExceptionInfo.append(info); } size_t numberOfLineInfos() const { ASSERT(m_exceptionInfo); return m_exceptionInfo->m_lineInfo.size(); } void addLineInfo(const LineInfo& lineInfo) { ASSERT(m_exceptionInfo); m_exceptionInfo->m_lineInfo.append(lineInfo); } diff --git a/JavaScriptCore/bytecode/Opcode.h b/JavaScriptCore/bytecode/Opcode.h index 8ee82e7..6c1c6b2 100644 --- a/JavaScriptCore/bytecode/Opcode.h +++ b/JavaScriptCore/bytecode/Opcode.h @@ -82,6 +82,7 @@ namespace JSC { macro(op_bitor, 5) \ macro(op_bitnot, 3) \ \ + macro(op_check_has_instance, 2) \ macro(op_instanceof, 5) \ macro(op_typeof, 3) \ macro(op_is_undefined, 3) \ @@ -183,7 +184,8 @@ namespace JSC { \ macro(op_catch, 2) \ macro(op_throw, 2) \ - macro(op_new_error, 4) \ + macro(op_throw_reference_error, 2) \ + macro(op_throw_syntax_error, 2) \ \ macro(op_jsr, 3) \ macro(op_sret, 2) \ |
