Changeset 43409 in webkit for trunk/JavaScriptCore/jit/JITCall.cpp
- Timestamp:
- May 8, 2009, 1:51:53 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/jit/JITCall.cpp
r43220 r43409 105 105 } 106 106 107 void JIT::compileOpCallEvalSetupArgs(Instruction* instruction)108 {109 int argCount = instruction[3].u.operand;110 int registerOffset = instruction[4].u.operand;111 112 // ecx holds func113 emitPutJITStubArg(regT2, 1);114 emitPutJITStubArgConstant(registerOffset, 2);115 emitPutJITStubArgConstant(argCount, 3);116 }117 118 107 void JIT::compileOpConstructSetupArgs(Instruction* instruction) 119 108 { … … 143 132 Jump wasEval; 144 133 if (opcodeID == op_call_eval) { 145 emitGetVirtualRegister(callee, regT2); 146 compileOpCallEvalSetupArgs(instruction); 147 148 emitCTICall(JITStubs::cti_op_call_eval); 134 CallEvalJITStub(this, instruction).call(); 149 135 wasEval = branchPtr(NotEqual, regT0, ImmPtr(JSValue::encode(JSValue()))); 150 136 } … … 163 149 // First, in the case of a construct, allocate the new object. 164 150 if (opcodeID == op_construct) { 165 emitCTICall(JITStubs::cti_op_construct_JSConstruct); 166 emitPutVirtualRegister(registerOffset - RegisterFile::CallFrameHeaderSize - argCount); 151 JITStubCall(JITStubs::cti_op_construct_JSConstruct.call(registerOffset - RegisterFile::CallFrameHeaderSize - argCount); 167 152 emitGetVirtualRegister(callee, regT2); 168 153 } … … 190 175 linkSlowCase(iter); 191 176 linkSlowCase(iter); 192 193 // This handles host functions 194 emitCTICall(((opcodeID == op_construct) ? JITStubs::cti_op_construct_NotJSConstruct : JITStubs::cti_op_call_NotJSFunction)); 195 // Put the return value in dst. In the interpreter, op_ret does this. 196 emitPutVirtualRegister(dst); 177 JITStubCall stubCall(opcodeID == op_construct ? JITStubs::cti_op_construct_NotJSConstruct : JITStubs::cti_op_call_NotJSFunction); 178 stubCall.call(dst); // In the interpreter, the callee puts the return value in dst. 197 179 198 180 sampleCodeBlock(m_codeBlock); … … 211 193 Jump wasEval; 212 194 if (opcodeID == op_call_eval) { 213 emitGetVirtualRegister(callee, regT2); 214 compileOpCallEvalSetupArgs(instruction); 215 216 emitCTICall(JITStubs::cti_op_call_eval); 195 CallEvalJITStub(this, instruction).call(); 217 196 wasEval = branchPtr(NotEqual, regT0, ImmPtr(JSValue::encode(JSValue()))); 218 197 } … … 236 215 emitPutJITStubArg(regT2, 1); 237 216 emitPutJITStubArgFromVirtualRegister(proto, 4, regT0); 238 emitCTICall(JITStubs::cti_op_construct_JSConstruct);239 emitPutVirtualRegister(thisRegister);217 JITStubCall stubCall(this, JITStubs::cti_op_construct_JSConstruct); 218 stubCall.call(thisRegister); 240 219 emitGetVirtualRegister(callee, regT2); 241 220 } … … 284 263 // First, in the case of a construct, allocate the new object. 285 264 if (opcodeID == op_construct) { 286 emitCTICall(JITStubs::cti_op_construct_JSConstruct); 287 emitPutVirtualRegister(registerOffset - RegisterFile::CallFrameHeaderSize - argCount); 265 JITStubCall(this, JITStubs::cti_op_construct_JSConstruct).call(registerOffset - RegisterFile::CallFrameHeaderSize - argCount); 288 266 emitGetVirtualRegister(callee, regT2); 289 267 } … … 318 296 callLinkFailNotObject.link(this); 319 297 callLinkFailNotJSFunction.link(this); 320 emitCTICall(((opcodeID == op_construct) ? JITStubs::cti_op_construct_NotJSConstruct : JITStubs::cti_op_call_NotJSFunction)); 298 JITStubCall stubCall(this, opcodeID == op_construct ? JITStubs::cti_op_construct_NotJSConstruct : JITStubs::cti_op_call_NotJSFunction); 299 stubCall.call(); 321 300 Jump wasNotJSFunction = jump(); 322 301 … … 326 305 // First, in the case of a construct, allocate the new object. 327 306 if (opcodeID == op_construct) { 328 emitCTICall(JITStubs::cti_op_construct_JSConstruct);329 emitPutVirtualRegister(registerOffset - RegisterFile::CallFrameHeaderSize - argCount);307 JITStubCall stubCall(this, JITStubs::cti_op_construct_JSConstruct); 308 stubCall.call(registerOffset - RegisterFile::CallFrameHeaderSize - argCount); 330 309 emitGetVirtualRegister(callee, regT2); 331 310 } … … 383 362 linkSlowCase(iter); 384 363 linkSlowCase(iter); 385 386 // This handles host functions 387 emitCTICall(JITStubs::cti_op_call_NotJSFunction); 388 // Put the return value in dst. In the interpreter, op_ret does this. 389 emitPutVirtualRegister(dst); 364 JITStubCall stubCall(this, JITStubs::cti_op_call_NotJSFunction); 365 stubCall.call(dst); // In the interpreter, the callee puts the return value in dst. 390 366 391 367 sampleCodeBlock(m_codeBlock);
Note:
See TracChangeset
for help on using the changeset viewer.