Changeset 60117 in webkit for trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
- Timestamp:
- May 24, 2010, 8:04:43 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r60105 r60117 365 365 ++m_nextParameterIndex; 366 366 ++m_codeBlock->m_numParameters; 367 368 if (!isConstructor() && (functionBody->usesThis() || m_shouldEmitDebugHooks)) {369 emitOpcode(op_convert_this);370 instructions().append(m_thisRegister.index());371 }372 367 373 368 for (size_t i = 0; i < parameterCount; ++i) … … 375 370 376 371 preserveLastVar(); 372 373 if (isConstructor()) { 374 RefPtr<RegisterID> func = newTemporary(); 375 RefPtr<RegisterID> funcProto = newTemporary(); 376 377 emitOpcode(op_get_callee); 378 instructions().append(func->index()); 379 // Load prototype. 380 emitGetByIdExceptionInfo(op_create_this); 381 emitGetById(funcProto.get(), func.get(), globalData()->propertyNames->prototype); 382 383 emitOpcode(op_create_this); 384 instructions().append(m_thisRegister.index()); 385 instructions().append(funcProto->index()); 386 } else if (functionBody->usesThis() || m_shouldEmitDebugHooks) { 387 emitOpcode(op_convert_this); 388 instructions().append(m_thisRegister.index()); 389 } 377 390 } 378 391 … … 1582 1595 } 1583 1596 1584 RefPtr<RegisterID> funcProto = newTemporary();1585 1586 1597 // Generate code for arguments. 1587 1598 Vector<RefPtr<RegisterID>, 16> argv; … … 1599 1610 } 1600 1611 1601 // Load prototype.1602 emitExpressionInfo(divot, startOffset, endOffset);1603 emitGetByIdExceptionInfo(op_construct);1604 emitGetById(funcProto.get(), func, globalData()->propertyNames->prototype);1605 1606 1612 // Reserve space for call frame. 1607 1613 Vector<RefPtr<RegisterID>, RegisterFile::CallFrameHeaderSize> callFrame; … … 1619 1625 instructions().append(argv.size()); // argCount 1620 1626 instructions().append(argv[0]->index() + argv.size() + RegisterFile::CallFrameHeaderSize); // registerOffset 1621 instructions().append(funcProto->index()); // proto1622 instructions().append(argv[0]->index()); // thisRegister1623 1627 if (dst != ignoredResult()) { 1624 1628 emitOpcode(op_call_put_result);
Note:
See TracChangeset
for help on using the changeset viewer.