Changeset 128832 in webkit for trunk/Source/JavaScriptCore/bytecompiler
- Timestamp:
- Sep 17, 2012, 6:15:04 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r128534 r128832 424 424 } 425 425 426 bool capturesAnyArgument = codeBlock->usesArguments() || codeBlock->usesEval() || m_shouldEmitDebugHooks; // May reify arguments object. 427 if (!capturesAnyArgument && functionBody->hasCapturedVariables()) { 426 bool mayReifyArgumentsObject = codeBlock->usesArguments() || codeBlock->usesEval() || m_shouldEmitDebugHooks; 427 bool capturesAnyArgumentByName = false; 428 if (functionBody->hasCapturedVariables()) { 428 429 FunctionParameters& parameters = *functionBody->parameters(); 429 430 for (size_t i = 0; i < parameters.size(); ++i) { 430 431 if (!functionBody->captures(parameters[i])) 431 432 continue; 432 capturesAnyArgument = true;433 capturesAnyArgumentByName = true; 433 434 break; 434 435 } 435 436 } 436 437 437 if ( capturesAnyArgument) {438 if (mayReifyArgumentsObject || capturesAnyArgumentByName) { 438 439 symbolTable->setCaptureMode(SharedSymbolTable::AllOfTheThings); 439 440 symbolTable->setCaptureStart(-CallFrame::offsetFor(symbolTable->parameterCountIncludingThis())); … … 441 442 symbolTable->setCaptureMode(SharedSymbolTable::SomeOfTheThings); 442 443 symbolTable->setCaptureStart(m_codeBlock->m_numVars); 444 } 445 446 if (mayReifyArgumentsObject && capturesAnyArgumentByName) { 447 size_t parameterCount = symbolTable->parameterCount(); 448 OwnArrayPtr<SlowArgument> slowArguments = adoptArrayPtr(new SlowArgument[parameterCount]); 449 for (size_t i = 0; i < parameterCount; ++i) { 450 slowArguments[i].status = SlowArgument::Captured; 451 slowArguments[i].indexIfCaptured = CallFrame::argumentOffset(i); 452 } 453 symbolTable->setSlowArguments(slowArguments.release()); 443 454 } 444 455 … … 682 693 if (entry.isNull()) 683 694 return false; 684 695 685 696 if (m_codeBlock->usesArguments() && m_codeType == FunctionCode) 686 697 return true;
Note:
See TracChangeset
for help on using the changeset viewer.