Changeset 39266 in webkit for trunk/JavaScriptCore/jit/JITCall.cpp
- Timestamp:
- Dec 12, 2008, 7:18:10 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JITCall.cpp
r39265 r39266 121 121 #if !ENABLE(JIT_OPTIMIZE_CALL) 122 122 123 void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned i, unsigned)123 void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned) 124 124 { 125 125 int dst = instruction[1].u.operand; … … 131 131 Jump wasEval; 132 132 if (opcodeID == op_call_eval) { 133 emitGetVirtualRegister(callee, X86::ecx , i);133 emitGetVirtualRegister(callee, X86::ecx); 134 134 compileOpCallEvalSetupArgs(instruction); 135 135 136 emitCTICall( i,Interpreter::cti_op_call_eval);136 emitCTICall(Interpreter::cti_op_call_eval); 137 137 wasEval = jnePtr(ImmPtr(JSImmediate::impossibleValue()), X86::eax); 138 138 } 139 139 140 emitGetVirtualRegister(callee, X86::ecx , i);140 emitGetVirtualRegister(callee, X86::ecx); 141 141 // The arguments have been set up on the hot path for op_call_eval 142 142 if (opcodeID == op_call) … … 146 146 147 147 // Check for JSFunctions. 148 emitJumpSlowCaseIfNotJSCell(X86::ecx , i);149 m_slowCases.append(SlowCaseEntry(jnePtr(X86::ecx, ImmPtr(m_interpreter->m_jsFunctionVptr)), i));148 emitJumpSlowCaseIfNotJSCell(X86::ecx); 149 addSlowCase(jnePtr(X86::ecx, ImmPtr(m_interpreter->m_jsFunctionVptr))); 150 150 151 151 // First, in the case of a construct, allocate the new object. 152 152 if (opcodeID == op_construct) { 153 emitCTICall( i,Interpreter::cti_op_construct_JSConstruct);153 emitCTICall(Interpreter::cti_op_construct_JSConstruct); 154 154 emitPutVirtualRegister(registerOffset - RegisterFile::CallFrameHeaderSize - argCount); 155 emitGetVirtualRegister(callee, X86::ecx , i);155 emitGetVirtualRegister(callee, X86::ecx); 156 156 } 157 157 … … 161 161 move(Imm32(argCount), X86::edx); 162 162 163 emitNakedCall( i,m_interpreter->m_ctiVirtualCall);163 emitNakedCall(m_interpreter->m_ctiVirtualCall); 164 164 165 165 if (opcodeID == op_call_eval) … … 174 174 } 175 175 176 void JIT::compileOpCallSlowCase(Instruction* instruction, unsigned i,Vector<SlowCaseEntry>::iterator& iter, unsigned, OpcodeID opcodeID)176 void JIT::compileOpCallSlowCase(Instruction* instruction, Vector<SlowCaseEntry>::iterator& iter, unsigned, OpcodeID opcodeID) 177 177 { 178 178 int dst = instruction[1].u.operand; … … 182 182 183 183 // This handles host functions 184 emitCTICall( i,((opcodeID == op_construct) ? Interpreter::cti_op_construct_NotJSConstruct : Interpreter::cti_op_call_NotJSFunction));184 emitCTICall(((opcodeID == op_construct) ? Interpreter::cti_op_construct_NotJSConstruct : Interpreter::cti_op_call_NotJSFunction)); 185 185 // Put the return value in dst. In the interpreter, op_ret does this. 186 186 emitPutVirtualRegister(dst); … … 199 199 } 200 200 201 void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned i, unsignedcallLinkInfoIndex)201 void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned callLinkInfoIndex) 202 202 { 203 203 int dst = instruction[1].u.operand; … … 209 209 JmpSrc wasEval; 210 210 if (opcodeID == op_call_eval) { 211 emitGetVirtualRegister(callee, X86::ecx , i);211 emitGetVirtualRegister(callee, X86::ecx); 212 212 compileOpCallEvalSetupArgs(instruction); 213 213 214 emitCTICall( i,Interpreter::cti_op_call_eval);214 emitCTICall(Interpreter::cti_op_call_eval); 215 215 __ cmpl_i32r(asInteger(JSImmediate::impossibleValue()), X86::eax); 216 216 wasEval = __ jne(); … … 219 219 // This plants a check for a cached JSFunction value, so we can plant a fast link to the callee. 220 220 // This deliberately leaves the callee in ecx, used when setting up the stack frame below 221 emitGetVirtualRegister(callee, X86::ecx , i);221 emitGetVirtualRegister(callee, X86::ecx); 222 222 __ cmpl_i32r(asInteger(JSImmediate::impossibleValue()), X86::ecx); 223 223 JmpDst addressOfLinkedFunctionCheck = __ label(); 224 m_slowCases.append(SlowCaseEntry(__ jne(), i));224 addSlowCase(__ jne()); 225 225 ASSERT(X86Assembler::getDifferenceBetweenLabels(addressOfLinkedFunctionCheck, __ label()) == repatchOffsetOpCallCall); 226 226 m_callStructureStubCompilationInfo[callLinkInfoIndex].hotPathBegin = addressOfLinkedFunctionCheck; … … 235 235 emitPutCTIArg(X86::ecx, 0); 236 236 emitPutCTIArgFromVirtualRegister(proto, 12, X86::eax); 237 emitCTICall( i,Interpreter::cti_op_construct_JSConstruct);237 emitCTICall(Interpreter::cti_op_construct_JSConstruct); 238 238 emitPutVirtualRegister(thisRegister); 239 emitGetVirtualRegister(callee, X86::ecx , i);239 emitGetVirtualRegister(callee, X86::ecx); 240 240 } 241 241 … … 251 251 252 252 // Call to the callee 253 m_callStructureStubCompilationInfo[callLinkInfoIndex].hotPathOther = emitNakedCall( i,reinterpret_cast<void*>(unreachable));253 m_callStructureStubCompilationInfo[callLinkInfoIndex].hotPathOther = emitNakedCall(reinterpret_cast<void*>(unreachable)); 254 254 255 255 if (opcodeID == op_call_eval) … … 264 264 } 265 265 266 void JIT::compileOpCallSlowCase(Instruction* instruction, unsigned i,Vector<SlowCaseEntry>::iterator& iter, unsigned callLinkInfoIndex, OpcodeID opcodeID)266 void JIT::compileOpCallSlowCase(Instruction* instruction, Vector<SlowCaseEntry>::iterator& iter, unsigned callLinkInfoIndex, OpcodeID opcodeID) 267 267 { 268 268 int dst = instruction[1].u.operand; … … 287 287 // First, in the case of a construct, allocate the new object. 288 288 if (opcodeID == op_construct) { 289 emitCTICall( i,Interpreter::cti_op_construct_JSConstruct);289 emitCTICall(Interpreter::cti_op_construct_JSConstruct); 290 290 emitPutVirtualRegister(registerOffset - RegisterFile::CallFrameHeaderSize - argCount); 291 emitGetVirtualRegister(callee, X86::ecx , i);291 emitGetVirtualRegister(callee, X86::ecx); 292 292 } 293 293 … … 299 299 300 300 m_callStructureStubCompilationInfo[callLinkInfoIndex].callReturnLocation = 301 emitNakedCall( i,m_interpreter->m_ctiVirtualCallPreLink);301 emitNakedCall(m_interpreter->m_ctiVirtualCallPreLink); 302 302 303 303 JmpSrc storeResultForFirstRun = __ jmp(); … … 323 323 __ link(callLinkFailNotObject, notJSFunctionlabel); 324 324 __ link(callLinkFailNotJSFunction, notJSFunctionlabel); 325 emitCTICall( i,((opcodeID == op_construct) ? Interpreter::cti_op_construct_NotJSConstruct : Interpreter::cti_op_call_NotJSFunction));325 emitCTICall(((opcodeID == op_construct) ? Interpreter::cti_op_construct_NotJSConstruct : Interpreter::cti_op_call_NotJSFunction)); 326 326 JmpSrc wasNotJSFunction = __ jmp(); 327 327 … … 331 331 // First, in the case of a construct, allocate the new object. 332 332 if (opcodeID == op_construct) { 333 emitCTICall( i,Interpreter::cti_op_construct_JSConstruct);333 emitCTICall(Interpreter::cti_op_construct_JSConstruct); 334 334 emitPutVirtualRegister(registerOffset - RegisterFile::CallFrameHeaderSize - argCount); 335 emitGetVirtualRegister(callee, X86::ecx , i);335 emitGetVirtualRegister(callee, X86::ecx); 336 336 } 337 337 … … 341 341 __ movl_i32r(argCount, X86::edx); 342 342 343 emitNakedCall( i,m_interpreter->m_ctiVirtualCall);343 emitNakedCall(m_interpreter->m_ctiVirtualCall); 344 344 345 345 // Put the return value in dst. In the interpreter, op_ret does this.
Note:
See TracChangeset
for help on using the changeset viewer.