Changeset 39697 in webkit for trunk/JavaScriptCore/interpreter/Interpreter.cpp
- Timestamp:
- Jan 7, 2009, 5:46:14 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/interpreter/Interpreter.cpp
r39670 r39697 1 1 /* 2 * Copyright (C) 2008 Apple Inc. All rights reserved.2 * Copyright (C) 2008, 2009 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2008 Cameron Zwarich <[email protected]> 4 4 * … … 798 798 int endOffset = 0; 799 799 int divotPoint = 0; 800 int line = codeBlock->expressionRangeForBytecodeOffset( bytecodeOffset, divotPoint, startOffset, endOffset);800 int line = codeBlock->expressionRangeForBytecodeOffset(callFrame, bytecodeOffset, divotPoint, startOffset, endOffset); 801 801 exception->putWithAttributes(callFrame, Identifier(callFrame, "line"), jsNumber(callFrame, line), ReadOnly | DontDelete); 802 802 … … 806 806 exception->putWithAttributes(callFrame, Identifier(callFrame, expressionEndOffsetPropertyName), jsNumber(callFrame, divotPoint + endOffset), ReadOnly | DontDelete); 807 807 } else 808 exception->putWithAttributes(callFrame, Identifier(callFrame, "line"), jsNumber(callFrame, codeBlock->lineNumberForBytecodeOffset( bytecodeOffset)), ReadOnly | DontDelete);808 exception->putWithAttributes(callFrame, Identifier(callFrame, "line"), jsNumber(callFrame, codeBlock->lineNumberForBytecodeOffset(callFrame, bytecodeOffset)), ReadOnly | DontDelete); 809 809 exception->putWithAttributes(callFrame, Identifier(callFrame, "sourceId"), jsNumber(callFrame, codeBlock->ownerNode()->sourceID()), ReadOnly | DontDelete); 810 810 exception->putWithAttributes(callFrame, Identifier(callFrame, "sourceURL"), jsOwnedString(callFrame, codeBlock->ownerNode()->sourceURL()), ReadOnly | DontDelete); … … 822 822 if (Debugger* debugger = callFrame->dynamicGlobalObject()->debugger()) { 823 823 DebuggerCallFrame debuggerCallFrame(callFrame, exceptionValue); 824 debugger->exception(debuggerCallFrame, codeBlock->ownerNode()->sourceID(), codeBlock->lineNumberForBytecodeOffset( bytecodeOffset));824 debugger->exception(debuggerCallFrame, codeBlock->ownerNode()->sourceID(), codeBlock->lineNumberForBytecodeOffset(callFrame, bytecodeOffset)); 825 825 } 826 826 … … 2349 2349 } 2350 2350 DEFINE_OPCODE(op_get_global_var) { 2351 /* get_global_var dst(r) globalObject(c) index(n) 2351 /* get_global_var dst(r) globalObject(c) index(n) nop(n) nop(n) 2352 2352 2353 2353 Gets the global var at global slot index and places it in register dst. 2354 2354 */ 2355 int dst = (++vPC)->u.operand;2356 JSGlobalObject* scope = static_cast<JSGlobalObject*>( (++vPC)->u.jsCell);2355 int dst = vPC[1].u.operand; 2356 JSGlobalObject* scope = static_cast<JSGlobalObject*>(vPC[2].u.jsCell); 2357 2357 ASSERT(scope->isGlobalObject()); 2358 int index = (++vPC)->u.operand;2358 int index = vPC[3].u.operand; 2359 2359 2360 2360 callFrame[dst] = scope->registerAt(index); 2361 ++vPC; 2361 2362 vPC += OPCODE_LENGTH(op_resolve_global); 2362 2363 NEXT_INSTRUCTION(); 2363 2364 } … … 3816 3817 3817 3818 CodeBlock* codeBlock = callFrame->codeBlock(); 3818 callFrame[dst] = JSValuePtr(Error::create(callFrame, (ErrorType)type, codeBlock->unexpectedConstant(message)->toString(callFrame), codeBlock->lineNumberForBytecodeOffset( vPC - codeBlock->instructions().begin()), codeBlock->ownerNode()->sourceID(), codeBlock->ownerNode()->sourceURL()));3819 callFrame[dst] = JSValuePtr(Error::create(callFrame, (ErrorType)type, codeBlock->unexpectedConstant(message)->toString(callFrame), codeBlock->lineNumberForBytecodeOffset(callFrame, vPC - codeBlock->instructions().begin()), codeBlock->ownerNode()->sourceID(), codeBlock->ownerNode()->sourceURL())); 3819 3820 3820 3821 ++vPC; … … 4033 4034 4034 4035 unsigned bytecodeOffset = bytecodeOffsetForPC(callerCodeBlock, callFrame->returnPC()); 4035 lineNumber = callerCodeBlock->lineNumberForBytecodeOffset( bytecodeOffset - 1);4036 lineNumber = callerCodeBlock->lineNumberForBytecodeOffset(callerFrame, bytecodeOffset - 1); 4036 4037 sourceID = callerCodeBlock->ownerNode()->sourceID(); 4037 4038 sourceURL = callerCodeBlock->ownerNode()->sourceURL(); … … 6046 6047 unsigned type = ARG_int1; 6047 6048 JSValuePtr message = ARG_src2; 6048 unsigned lineNumber = ARG_int3; 6049 6049 unsigned bytecodeOffset = ARG_int3; 6050 6051 unsigned lineNumber = codeBlock->lineNumberForBytecodeOffset(callFrame, bytecodeOffset); 6050 6052 return Error::create(callFrame, static_cast<ErrorType>(type), message->toString(callFrame), lineNumber, codeBlock->ownerNode()->sourceID(), codeBlock->ownerNode()->sourceURL()); 6051 6053 }
Note:
See TracChangeset
for help on using the changeset viewer.