Changeset 155711 in webkit for trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp
- Timestamp:
- Sep 13, 2013, 11:03:55 AM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/interpreter/Interpreter.cpp
r155622 r155711 153 153 if (!arguments) { // f.apply(x, arguments), with arguments unmodified. 154 154 unsigned argumentCountIncludingThis = callFrame->argumentCountIncludingThis(); 155 CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + firstFreeRegister + argumentCountIncludingThis +JSStack::CallFrameHeaderSize);155 CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + firstFreeRegister - argumentCountIncludingThis - JSStack::CallFrameHeaderSize); 156 156 if (argumentCountIncludingThis > Arguments::MaxArguments + 1 || !stack->grow(newCallFrame->registers())) { 157 157 callFrame->vm().throwException(callFrame, createStackOverflowError(callFrame)); … … 167 167 168 168 if (arguments.isUndefinedOrNull()) { 169 CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + firstFreeRegister + 1 +JSStack::CallFrameHeaderSize);169 CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + firstFreeRegister - 1 - JSStack::CallFrameHeaderSize); 170 170 if (!stack->grow(newCallFrame->registers())) { 171 171 callFrame->vm().throwException(callFrame, createStackOverflowError(callFrame)); … … 185 185 Arguments* argsObject = asArguments(arguments); 186 186 unsigned argCount = argsObject->length(callFrame); 187 CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + firstFreeRegister +CallFrame::offsetFor(argCount + 1));187 CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + firstFreeRegister - CallFrame::offsetFor(argCount + 1)); 188 188 if (argCount > Arguments::MaxArguments || !stack->grow(newCallFrame->registers())) { 189 189 callFrame->vm().throwException(callFrame, createStackOverflowError(callFrame)); … … 199 199 JSArray* array = asArray(arguments); 200 200 unsigned argCount = array->length(); 201 CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + firstFreeRegister +CallFrame::offsetFor(argCount + 1));201 CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + firstFreeRegister - CallFrame::offsetFor(argCount + 1)); 202 202 if (argCount > Arguments::MaxArguments || !stack->grow(newCallFrame->registers())) { 203 203 callFrame->vm().throwException(callFrame, createStackOverflowError(callFrame)); … … 212 212 JSObject* argObject = asObject(arguments); 213 213 unsigned argCount = argObject->get(callFrame, callFrame->propertyNames().length).toUInt32(callFrame); 214 CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + firstFreeRegister +CallFrame::offsetFor(argCount + 1));214 CallFrame* newCallFrame = CallFrame::create(callFrame->registers() + firstFreeRegister - CallFrame::offsetFor(argCount + 1)); 215 215 if (argCount > Arguments::MaxArguments || !stack->grow(newCallFrame->registers())) { 216 216 callFrame->vm().throwException(callFrame, createStackOverflowError(callFrame)); … … 314 314 const Register* end; 315 315 316 it = callFrame->registers() - JSStack::CallFrameHeaderSize -callFrame->argumentCountIncludingThis();317 end = callFrame->registers() -JSStack::CallFrameHeaderSize;318 while (it <end) {316 it = callFrame->registers() + JSStack::CallFrameHeaderSize + callFrame->argumentCountIncludingThis(); 317 end = callFrame->registers() + JSStack::CallFrameHeaderSize; 318 while (it > end) { 319 319 JSValue v = it->jsValue(); 320 320 int registerNumber = it - callFrame->registers(); … … 326 326 dataLogF("-----------------------------------------------------------------------------\n"); 327 327 dataLogF("[ArgumentCount] | %10p | %lu \n", it, (unsigned long) callFrame->argumentCount()); 328 ++it;328 --it; 329 329 dataLogF("[CallerFrame] | %10p | %p \n", it, callFrame->callerFrame()); 330 ++it;330 --it; 331 331 dataLogF("[Callee] | %10p | %p \n", it, callFrame->callee()); 332 ++it;332 --it; 333 333 dataLogF("[ScopeChain] | %10p | %p \n", it, callFrame->scope()); 334 ++it;334 --it; 335 335 #if ENABLE(JIT) 336 336 AbstractPC pc = callFrame->abstractReturnPC(callFrame->vm()); … … 343 343 344 344 dataLogF("[CodeBlock] | %10p | %p \n", it, callFrame->codeBlock()); 345 ++it;345 --it; 346 346 dataLogF("-----------------------------------------------------------------------------\n"); 347 347 348 348 int registerCount = 0; 349 349 350 end = it +codeBlock->m_numVars;350 end = it - codeBlock->m_numVars; 351 351 if (it != end) { 352 352 do { … … 355 355 String name = codeBlock->nameForRegister(registerNumber); 356 356 dataLogF("[r% 3d %14s] | %10p | %-16s 0x%lld \n", registerNumber, name.ascii().data(), it, toCString(v).data(), (long long)JSValue::encode(v)); 357 ++it;358 ++registerCount;357 --it; 358 --registerCount; 359 359 } while (it != end); 360 360 }
Note:
See TracChangeset
for help on using the changeset viewer.