Changeset 37086 in webkit for trunk/JavaScriptCore/VM/CTI.cpp
- Timestamp:
- Sep 29, 2008, 5:46:25 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/VM/CTI.cpp
r37050 r37086 101 101 { 102 102 103 __declspec(naked) JSValue* ctiTrampoline(void* code, ExecState* exec, RegisterFile* registerFile, Register* r, ScopeChainNode* scopeChain,JSValue** exception, Profiler**)103 __declspec(naked) JSValue* ctiTrampoline(void* code, ExecState* exec, RegisterFile* registerFile, Register* r, JSValue** exception, Profiler**) 104 104 { 105 105 __asm { … … 145 145 146 146 // get arg puts an arg from the SF register array into a h/w register 147 ALWAYS_INLINE void CTI::emitGetArg( unsignedsrc, X86Assembler::RegisterID dst)147 ALWAYS_INLINE void CTI::emitGetArg(int src, X86Assembler::RegisterID dst) 148 148 { 149 149 // TODO: we want to reuse values that are already in registers if we can - add a register allocator! … … 1163 1163 int skip = instruction[i + 3].u.operand + m_codeBlock->needsFullScopeChain; 1164 1164 1165 emitGet CTIParam(CTI_ARGS_scopeChain, X86::eax);1165 emitGetArg(RegisterFile::ScopeChain, X86::eax); 1166 1166 while (skip--) 1167 1167 m_jit.movl_mr(OBJECT_OFFSET(ScopeChainNode, next), X86::eax, X86::eax); … … 1176 1176 int skip = instruction[i + 2].u.operand + m_codeBlock->needsFullScopeChain; 1177 1177 1178 emitGet CTIParam(CTI_ARGS_scopeChain, X86::edx);1178 emitGetArg(RegisterFile::ScopeChain, X86::edx); 1179 1179 emitGetArg(instruction[i + 3].u.operand, X86::eax); 1180 1180 while (skip--) … … 1205 1205 emitGetArg(instruction[i + 1].u.operand, X86::eax); 1206 1206 1207 // Restore the scope chain. 1208 m_jit.movl_mr(RegisterFile::CallerScopeChain * static_cast<int>(sizeof(Register)), X86::edi, X86::edx); 1207 // Grab the return address. 1208 emitGetArg(RegisterFile::ReturnPC, X86::edx); 1209 1210 // Restore our caller's "r". 1209 1211 emitGetCTIParam(CTI_ARGS_exec, X86::ecx); 1210 emitPutCTIParam(X86::edx, CTI_ARGS_scopeChain); 1211 m_jit.movl_rm(X86::edx, OBJECT_OFFSET(ExecState, m_scopeChain), X86::ecx); 1212 1213 // Restore ExecState::m_callFrame. 1212 emitGetArg(RegisterFile::CallerRegisters, X86::edi); 1213 emitPutCTIParam(X86::edi, CTI_ARGS_r); 1214 1214 m_jit.movl_rm(X86::edi, OBJECT_OFFSET(ExecState, m_callFrame), X86::ecx); 1215 1215 1216 // Grab the return address. 1217 m_jit.movl_mr(RegisterFile::ReturnPC * static_cast<int>(sizeof(Register)), X86::edi, X86::ecx); 1218 1219 // Restore the machine return addess from the callframe, roll the callframe back to the caller callframe, 1220 // and preserve a copy of r on the stack at CTI_ARGS_r. 1221 m_jit.movl_mr(RegisterFile::CallerRegisters * static_cast<int>(sizeof(Register)), X86::edi, X86::edi); 1222 emitPutCTIParam(X86::edi, CTI_ARGS_r); 1223 1224 m_jit.pushl_r(X86::ecx); 1216 // Return. 1217 m_jit.pushl_r(X86::edx); 1225 1218 m_jit.ret(); 1226 1219
Note:
See TracChangeset
for help on using the changeset viewer.