Changeset 46618 in webkit for trunk/JavaScriptCore/jit/JITOpcodes.cpp
- Timestamp:
- Jul 30, 2009, 7:20:11 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JITOpcodes.cpp
r46598 r46618 40 40 #if USE(JSVALUE32_64) 41 41 42 void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executablePool, JSGlobalData* globalData, CodePtr* ctiStringLengthTrampoline, CodePtr* ctiVirtualCall PreLink, CodePtr* ctiVirtualCallLink, CodePtr* ctiVirtualCall, CodePtr* ctiNativeCallThunk)42 void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executablePool, JSGlobalData* globalData, CodePtr* ctiStringLengthTrampoline, CodePtr* ctiVirtualCallLink, CodePtr* ctiVirtualCall, CodePtr* ctiNativeCallThunk) 43 43 { 44 44 #if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS) … … 62 62 #endif 63 63 64 // (2) Trampoline sfor the slow cases of op_call / op_call_eval / op_construct.64 // (2) Trampoline for the slow cases of op_call / op_call_eval / op_construct. 65 65 66 66 #if ENABLE(JIT_OPTIMIZE_CALL) 67 /* VirtualCallPreLink Trampoline */68 Label virtualCallPreLinkBegin = align();69 70 // regT0 holds callee, regT1 holds argCount.71 loadPtr(Address(regT0, OBJECT_OFFSETOF(JSFunction, m_body)), regT2);72 loadPtr(Address(regT2, OBJECT_OFFSETOF(FunctionBodyNode, m_code)), regT2);73 Jump hasCodeBlock1 = branchTestPtr(NonZero, regT2);74 75 // Lazily generate a CodeBlock.76 preserveReturnAddressAfterCall(regT3); // return address77 restoreArgumentReference();78 Call callJSFunction1 = call();79 move(regT0, regT2);80 emitGetJITStubArg(1, regT0); // callee81 emitGetJITStubArg(5, regT1); // argCount82 restoreReturnAddressBeforeReturn(regT3); // return address83 hasCodeBlock1.link(this);84 85 // regT2 holds codeBlock.86 Jump isNativeFunc1 = branch32(Equal, Address(regT2, OBJECT_OFFSETOF(CodeBlock, m_codeType)), Imm32(NativeCode));87 88 // Check argCount matches callee arity.89 Jump arityCheckOkay1 = branch32(Equal, Address(regT2, OBJECT_OFFSETOF(CodeBlock, m_numParameters)), regT1);90 preserveReturnAddressAfterCall(regT3);91 emitPutJITStubArg(regT3, 3); // return address92 emitPutJITStubArg(regT2, 7); // codeBlock93 restoreArgumentReference();94 Call callArityCheck1 = call();95 move(regT1, callFrameRegister);96 emitGetJITStubArg(1, regT0); // callee97 emitGetJITStubArg(5, regT1); // argCount98 restoreReturnAddressBeforeReturn(regT3); // return address99 100 arityCheckOkay1.link(this);101 isNativeFunc1.link(this);102 103 compileOpCallInitializeCallFrame();104 105 preserveReturnAddressAfterCall(regT3);106 emitPutJITStubArg(regT3, 3);107 restoreArgumentReference();108 Call callDontLazyLinkCall = call();109 restoreReturnAddressBeforeReturn(regT3);110 jump(regT0);111 112 67 /* VirtualCallLink Trampoline */ 113 68 Label virtualCallLinkBegin = align(); … … 356 311 #endif 357 312 #if ENABLE(JIT_OPTIMIZE_CALL) 358 patchBuffer.link(callArityCheck1, FunctionPtr(cti_op_call_arityCheck));359 patchBuffer.link(callJSFunction1, FunctionPtr(cti_op_call_JSFunction));360 313 patchBuffer.link(callArityCheck2, FunctionPtr(cti_op_call_arityCheck)); 361 314 patchBuffer.link(callJSFunction2, FunctionPtr(cti_op_call_JSFunction)); 362 patchBuffer.link(callDontLazyLinkCall, FunctionPtr(cti_vm_dontLazyLinkCall));363 315 patchBuffer.link(callLazyLinkCall, FunctionPtr(cti_vm_lazyLinkCall)); 364 316 #endif … … 377 329 #endif 378 330 #if ENABLE(JIT_OPTIMIZE_CALL) 379 *ctiVirtualCallPreLink = trampolineAt(finalCode, virtualCallPreLinkBegin);380 331 *ctiVirtualCallLink = trampolineAt(finalCode, virtualCallLinkBegin); 381 332 #else … … 1510 1461 do { m_labels[m_bytecodeIndex + (targetOffset)].used(); } while (false) 1511 1462 1512 void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executablePool, JSGlobalData* globalData, CodePtr* ctiStringLengthTrampoline, CodePtr* ctiVirtualCall PreLink, CodePtr* ctiVirtualCallLink, CodePtr* ctiVirtualCall, CodePtr* ctiNativeCallThunk)1463 void JIT::privateCompileCTIMachineTrampolines(RefPtr<ExecutablePool>* executablePool, JSGlobalData* globalData, CodePtr* ctiStringLengthTrampoline, CodePtr* ctiVirtualCallLink, CodePtr* ctiVirtualCall, CodePtr* ctiNativeCallThunk) 1513 1464 { 1514 1465 #if ENABLE(JIT_OPTIMIZE_PROPERTY_ACCESS) … … 1532 1483 #endif 1533 1484 1534 // (3) Trampoline sfor the slow cases of op_call / op_call_eval / op_construct.1485 // (3) Trampoline for the slow cases of op_call / op_call_eval / op_construct. 1535 1486 COMPILE_ASSERT(sizeof(CodeType) == 4, CodeTypeEnumMustBe32Bit); 1536 1537 Label virtualCallPreLinkBegin = align();1538 1539 // Load the callee CodeBlock* into eax1540 loadPtr(Address(regT2, OBJECT_OFFSETOF(JSFunction, m_body)), regT3);1541 loadPtr(Address(regT3, OBJECT_OFFSETOF(FunctionBodyNode, m_code)), regT0);1542 Jump hasCodeBlock1 = branchTestPtr(NonZero, regT0);1543 preserveReturnAddressAfterCall(regT3);1544 restoreArgumentReference();1545 Call callJSFunction1 = call();1546 emitGetJITStubArg(1, regT2);1547 emitGetJITStubArg(3, regT1);1548 restoreReturnAddressBeforeReturn(regT3);1549 hasCodeBlock1.link(this);1550 1551 Jump isNativeFunc1 = branch32(Equal, Address(regT0, OBJECT_OFFSETOF(CodeBlock, m_codeType)), Imm32(NativeCode));1552 1553 // Check argCount matches callee arity.1554 Jump arityCheckOkay1 = branch32(Equal, Address(regT0, OBJECT_OFFSETOF(CodeBlock, m_numParameters)), regT1);1555 preserveReturnAddressAfterCall(regT3);1556 emitPutJITStubArg(regT3, 2);1557 emitPutJITStubArg(regT0, 4);1558 restoreArgumentReference();1559 Call callArityCheck1 = call();1560 move(regT1, callFrameRegister);1561 emitGetJITStubArg(1, regT2);1562 emitGetJITStubArg(3, regT1);1563 restoreReturnAddressBeforeReturn(regT3);1564 arityCheckOkay1.link(this);1565 isNativeFunc1.link(this);1566 1567 compileOpCallInitializeCallFrame();1568 1569 preserveReturnAddressAfterCall(regT3);1570 emitPutJITStubArg(regT3, 2);1571 restoreArgumentReference();1572 Call callDontLazyLinkCall = call();1573 emitGetJITStubArg(1, regT2);1574 restoreReturnAddressBeforeReturn(regT3);1575 1576 jump(regT0);1577 1487 1578 1488 Label virtualCallLinkBegin = align(); … … 1841 1751 patchBuffer.link(string_failureCases3Call, FunctionPtr(cti_op_get_by_id_string_fail)); 1842 1752 #endif 1843 patchBuffer.link(callArityCheck1, FunctionPtr(cti_op_call_arityCheck));1844 1753 patchBuffer.link(callArityCheck2, FunctionPtr(cti_op_call_arityCheck)); 1845 1754 patchBuffer.link(callArityCheck3, FunctionPtr(cti_op_call_arityCheck)); 1846 patchBuffer.link(callJSFunction1, FunctionPtr(cti_op_call_JSFunction));1847 1755 patchBuffer.link(callJSFunction2, FunctionPtr(cti_op_call_JSFunction)); 1848 1756 patchBuffer.link(callJSFunction3, FunctionPtr(cti_op_call_JSFunction)); 1849 patchBuffer.link(callDontLazyLinkCall, FunctionPtr(cti_vm_dontLazyLinkCall));1850 1757 patchBuffer.link(callLazyLinkCall, FunctionPtr(cti_vm_lazyLinkCall)); 1851 1758 … … 1853 1760 *executablePool = finalCode.m_executablePool; 1854 1761 1855 *ctiVirtualCallPreLink = trampolineAt(finalCode, virtualCallPreLinkBegin);1856 1762 *ctiVirtualCallLink = trampolineAt(finalCode, virtualCallLinkBegin); 1857 1763 *ctiVirtualCall = trampolineAt(finalCode, virtualCallBegin);
Note:
See TracChangeset
for help on using the changeset viewer.