Changeset 60105 in webkit for trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
- Timestamp:
- May 24, 2010, 5:44:17 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
r60075 r60105 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 } 367 372 368 373 for (size_t i = 0; i < parameterCount; ++i) … … 370 375 371 376 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 }390 377 } 391 378 … … 1595 1582 } 1596 1583 1584 RefPtr<RegisterID> funcProto = newTemporary(); 1585 1597 1586 // Generate code for arguments. 1598 1587 Vector<RefPtr<RegisterID>, 16> argv; … … 1610 1599 } 1611 1600 1601 // Load prototype. 1602 emitExpressionInfo(divot, startOffset, endOffset); 1603 emitGetByIdExceptionInfo(op_construct); 1604 emitGetById(funcProto.get(), func, globalData()->propertyNames->prototype); 1605 1612 1606 // Reserve space for call frame. 1613 1607 Vector<RefPtr<RegisterID>, RegisterFile::CallFrameHeaderSize> callFrame; … … 1625 1619 instructions().append(argv.size()); // argCount 1626 1620 instructions().append(argv[0]->index() + argv.size() + RegisterFile::CallFrameHeaderSize); // registerOffset 1621 instructions().append(funcProto->index()); // proto 1622 instructions().append(argv[0]->index()); // thisRegister 1627 1623 if (dst != ignoredResult()) { 1628 1624 emitOpcode(op_call_put_result);
Note:
See TracChangeset
for help on using the changeset viewer.