Changeset 43559 in webkit for trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
- Timestamp:
- May 12, 2009, 1:58:56 AM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r43471 r43559 333 333 emitOpcode(op_enter); 334 334 335 if (usesArguments)336 emitOpcode(op_ create_arguments);335 if (usesArguments) 336 emitOpcode(op_init_arguments); 337 337 338 338 const DeclarationStacks::FunctionStack& functionStack = functionBody->functionStack(); … … 429 429 return 0; 430 430 431 if (ident == propertyNames().arguments) 432 createArgumentsIfNecessary(); 433 434 return ®isterFor(entry.getIndex()); 435 } 436 437 bool BytecodeGenerator::willResolveToArguments(const Identifier& ident) 438 { 439 if (ident != propertyNames().arguments) 440 return false; 441 442 if (!shouldOptimizeLocals()) 443 return false; 444 445 SymbolTableEntry entry = symbolTable().get(ident.ustring().rep()); 446 if (entry.isNull()) 447 return false; 448 449 if (m_codeBlock->usesArguments() && m_codeType == FunctionCode) 450 return true; 451 452 return false; 453 } 454 455 RegisterID* BytecodeGenerator::uncheckedRegisterForArguments() 456 { 457 ASSERT(willResolveToArguments(propertyNames().arguments)); 458 459 SymbolTableEntry entry = symbolTable().get(propertyNames().arguments.ustring().rep()); 460 ASSERT(!entry.isNull()); 431 461 return ®isterFor(entry.getIndex()); 432 462 } … … 1347 1377 } 1348 1378 1379 void BytecodeGenerator::createArgumentsIfNecessary() 1380 { 1381 if (m_codeBlock->usesArguments() && m_codeType == FunctionCode) 1382 emitOpcode(op_create_arguments); 1383 } 1384 1349 1385 RegisterID* BytecodeGenerator::emitCallEval(RegisterID* dst, RegisterID* func, RegisterID* thisRegister, ArgumentsNode* argumentsNode, unsigned divot, unsigned startOffset, unsigned endOffset) 1350 1386 { 1387 createArgumentsIfNecessary(); 1351 1388 return emitCall(op_call_eval, dst, func, thisRegister, argumentsNode, divot, startOffset, endOffset); 1352 1389 } … … 1573 1610 m_scopeContextStack.append(context); 1574 1611 m_dynamicScopeDepth++; 1612 createArgumentsIfNecessary(); 1575 1613 1576 1614 return emitUnaryNoDstOp(op_push_scope, scope);
Note:
See TracChangeset
for help on using the changeset viewer.