Changeset 36544 in webkit for trunk/JavaScriptCore/VM/CTI.cpp
- Timestamp:
- Sep 17, 2008, 12:29:19 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/CTI.cpp
r36518 r36544 469 469 // This handles JSFunctions 470 470 emitCall(i, ((type == OpConstruct) ? Machine::cti_op_construct_JSConstruct : Machine::cti_op_call_JSFunction)); 471 // Check the ctiCode has been generated - if not, this is handled in a slow case. 472 m_jit.testl_rr(X86::eax, X86::eax); 473 m_slowCases.append(SlowCaseEntry(m_jit.emitUnlinkedJe(), i)); 471 474 m_jit.call_r(X86::eax); 472 475 … … 1942 1945 } 1943 1946 CTI_COMPILE_BINARY_OP_SLOW_CASE(op_mul); 1947 1948 case op_call: 1949 case op_call_eval: 1950 case op_construct: { 1951 m_jit.link(iter->from, m_jit.label()); 1952 1953 // We jump to this slow case if the ctiCode for the codeBlock has not yet been generated; compile it now. 1954 emitCall(i, Machine::cti_vm_compile); 1955 m_jit.call_r(X86::eax); 1956 1957 // Instead of checking for 0 we could initialize the CodeBlock::ctiCode to point to a trampoline that would trigger the translation. 1958 1959 // In the interpreter the following actions are performed by op_ret: 1960 1961 // Store the scope chain - returned by op_ret in %edx (see below) - to ExecState::m_scopeChain and CTI_ARGS_scopeChain on the stack. 1962 emitGetCTIParam(CTI_ARGS_exec, X86::ecx); 1963 emitPutCTIParam(X86::edx, CTI_ARGS_scopeChain); 1964 m_jit.movl_rm(X86::edx, OBJECT_OFFSET(ExecState, m_scopeChain), X86::ecx); 1965 // Restore ExecState::m_callFrame. 1966 m_jit.leal_mr(-(m_codeBlock->numLocals + RegisterFile::CallFrameHeaderSize) * sizeof(Register), X86::edi, X86::edx); 1967 m_jit.movl_rm(X86::edx, OBJECT_OFFSET(ExecState, m_callFrame), X86::ecx); 1968 // Restore CTI_ARGS_codeBlock. 1969 emitPutCTIParam(m_codeBlock, CTI_ARGS_codeBlock); 1970 1971 emitPutResult(instruction[i + 1].u.operand); 1972 i += 6; 1973 break; 1974 } 1975 1944 1976 default: 1945 1977 ASSERT_NOT_REACHED(); … … 1959 1991 emitGetCTIParam(CTI_ARGS_r, X86::edi); // edi := r 1960 1992 emitPutToCallFrameHeader(X86::ecx, RegisterFile::CTIReturnEIP); 1993 1994 // Lazy copy of the scopeChain 1995 X86Assembler::JmpSrc callToUpdateScopeChain; 1996 if ((m_codeBlock->codeType == FunctionCode) && m_codeBlock->needsFullScopeChain) 1997 callToUpdateScopeChain = m_jit.emitCall(); 1961 1998 1962 1999 privateCompileMainPass(); … … 2008 2045 } 2009 2046 2047 if ((m_codeBlock->codeType == FunctionCode) && m_codeBlock->needsFullScopeChain) 2048 X86Assembler::link(code, callToUpdateScopeChain, (void*)Machine::cti_vm_updateScopeChain); 2049 2010 2050 // Link absolute addresses for jsr 2011 2051 for (Vector<JSRInfo>::iterator iter = m_jsrSites.begin(); iter != m_jsrSites.end(); ++iter) … … 2017 2057 info.hotPathBegin = X86Assembler::getRelocatedAddress(code, m_structureStubCompilationInfo[i].hotPathBegin); 2018 2058 } 2019 2020 2059 2021 2060 m_codeBlock->ctiCode = code;
Note:
See TracChangeset
for help on using the changeset viewer.