Changeset 153200 in webkit for trunk/Source/JavaScriptCore/jit/JITCall.cpp
- Timestamp:
- Jul 24, 2013, 9:01:45 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jit/JITCall.cpp
r148696 r153200 52 52 namespace JSC { 53 53 54 void JIT::emit _op_call_put_result(Instruction* instruction)54 void JIT::emitPutCallResult(Instruction* instruction) 55 55 { 56 56 int dst = instruction[1].u.operand; 57 57 emitValueProfilingSite(); 58 58 emitPutVirtualRegister(dst); 59 if (canBeOptimizedOrInlined()) 60 killLastResultRegister(); // Make lastResultRegister tracking simpler in the DFG. 59 if (canBeOptimizedOrInlined()) { 60 // Make lastResultRegister tracking simpler in the DFG. This is needed because 61 // the DFG may have the SetLocal corresponding to this Call's return value in 62 // a different basic block, if inlining happened. The DFG isn't smart enough to 63 // track the baseline JIT's last result register across basic blocks. 64 killLastResultRegister(); 65 } 61 66 } 62 67 63 68 void JIT::compileLoadVarargs(Instruction* instruction) 64 69 { 65 int thisValue = instruction[ 2].u.operand;66 int arguments = instruction[ 3].u.operand;67 int firstFreeRegister = instruction[ 4].u.operand;70 int thisValue = instruction[3].u.operand; 71 int arguments = instruction[4].u.operand; 72 int firstFreeRegister = instruction[5].u.operand; 68 73 69 74 killLastResultRegister(); … … 125 130 } 126 131 127 void JIT::compileCallEval( )132 void JIT::compileCallEval(Instruction* instruction) 128 133 { 129 134 JITStubCall stubCall(this, cti_op_call_eval); // Initializes ScopeChain; ReturnPC; CodeBlock. … … 133 138 134 139 sampleCodeBlock(m_codeBlock); 135 } 136 137 void JIT::compileCallEvalSlowCase(Vector<SlowCaseEntry>::iterator& iter) 140 141 emitPutCallResult(instruction); 142 } 143 144 void JIT::compileCallEvalSlowCase(Instruction* instruction, Vector<SlowCaseEntry>::iterator& iter) 138 145 { 139 146 linkSlowCase(iter); … … 143 150 144 151 sampleCodeBlock(m_codeBlock); 152 153 emitPutCallResult(instruction); 145 154 } 146 155 147 156 void JIT::compileOpCall(OpcodeID opcodeID, Instruction* instruction, unsigned callLinkInfoIndex) 148 157 { 149 int callee = instruction[ 1].u.operand;158 int callee = instruction[2].u.operand; 150 159 151 160 /* Caller always: … … 166 175 compileLoadVarargs(instruction); 167 176 else { 168 int argCount = instruction[ 2].u.operand;169 int registerOffset = instruction[ 3].u.operand;177 int argCount = instruction[3].u.operand; 178 int registerOffset = instruction[4].u.operand; 170 179 171 180 if (opcodeID == op_call && shouldEmitProfiling()) { … … 173 182 Jump done = emitJumpIfNotJSCell(regT0); 174 183 loadPtr(Address(regT0, JSCell::structureOffset()), regT0); 175 storePtr(regT0, instruction[ 5].u.arrayProfile->addressOfLastSeenStructure());184 storePtr(regT0, instruction[6].u.arrayProfile->addressOfLastSeenStructure()); 176 185 done.link(this); 177 186 } … … 189 198 190 199 if (opcodeID == op_call_eval) { 191 compileCallEval( );200 compileCallEval(instruction); 192 201 return; 193 202 } … … 210 219 211 220 sampleCodeBlock(m_codeBlock); 212 } 213 214 void JIT::compileOpCallSlowCase(OpcodeID opcodeID, Instruction*, Vector<SlowCaseEntry>::iterator& iter, unsigned callLinkInfoIndex) 221 222 emitPutCallResult(instruction); 223 } 224 225 void JIT::compileOpCallSlowCase(OpcodeID opcodeID, Instruction* instruction, Vector<SlowCaseEntry>::iterator& iter, unsigned callLinkInfoIndex) 215 226 { 216 227 if (opcodeID == op_call_eval) { 217 compileCallEvalSlowCase(i ter);228 compileCallEvalSlowCase(instruction, iter); 218 229 return; 219 230 } … … 224 235 225 236 sampleCodeBlock(m_codeBlock); 237 238 emitPutCallResult(instruction); 226 239 } 227 240 … … 272 285 } 273 286 287 void JIT::emit_op_call(Instruction* currentInstruction) 288 { 289 compileOpCall(op_call, currentInstruction, m_callLinkInfoIndex++); 290 } 291 292 void JIT::emit_op_call_eval(Instruction* currentInstruction) 293 { 294 compileOpCall(op_call_eval, currentInstruction, m_callLinkInfoIndex); 295 } 296 297 void JIT::emit_op_call_varargs(Instruction* currentInstruction) 298 { 299 compileOpCall(op_call_varargs, currentInstruction, m_callLinkInfoIndex++); 300 } 301 302 void JIT::emit_op_construct(Instruction* currentInstruction) 303 { 304 compileOpCall(op_construct, currentInstruction, m_callLinkInfoIndex++); 305 } 306 307 void JIT::emitSlow_op_call(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 308 { 309 compileOpCallSlowCase(op_call, currentInstruction, iter, m_callLinkInfoIndex++); 310 } 311 312 void JIT::emitSlow_op_call_eval(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 313 { 314 compileOpCallSlowCase(op_call_eval, currentInstruction, iter, m_callLinkInfoIndex); 315 } 316 317 void JIT::emitSlow_op_call_varargs(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 318 { 319 compileOpCallSlowCase(op_call_varargs, currentInstruction, iter, m_callLinkInfoIndex++); 320 } 321 322 void JIT::emitSlow_op_construct(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 323 { 324 compileOpCallSlowCase(op_construct, currentInstruction, iter, m_callLinkInfoIndex++); 325 } 326 274 327 } // namespace JSC 275 328
Note:
See TracChangeset
for help on using the changeset viewer.