Changeset 223824 in webkit for trunk/Source/JavaScriptCore/jit/JITArithmetic.cpp
- Timestamp:
- Oct 22, 2017, 11:28:16 AM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/jit/JITArithmetic.cpp
r223823 r223824 248 248 void JIT::emitSlow_op_unsigned(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 249 249 { 250 linkSlowCase(iter); 251 linkSlowCase(iter); 250 linkAllSlowCases(iter); 252 251 253 252 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_unsigned); … … 285 284 int32_t op2imm = getOperandConstantInt(op2); 286 285 addJump(branch32(condition, regT0, Imm32(op2imm)), target); 287 } else if (isOperandConstantInt(op1)) { 286 return; 287 } 288 if (isOperandConstantInt(op1)) { 288 289 emitGetVirtualRegister(op2, regT1); 289 290 emitJumpSlowCaseIfNotInt(regT1); 290 291 int32_t op1imm = getOperandConstantInt(op1); 291 292 addJump(branch32(commute(condition), regT1, Imm32(op1imm)), target); 292 } else { 293 emitGetVirtualRegisters(op1, regT0, op2, regT1); 294 emitJumpSlowCaseIfNotInt(regT0); 295 emitJumpSlowCaseIfNotInt(regT1); 296 297 addJump(branch32(condition, regT0, regT1), target); 293 return; 298 294 } 295 296 emitGetVirtualRegisters(op1, regT0, op2, regT1); 297 emitJumpSlowCaseIfNotInt(regT0); 298 emitJumpSlowCaseIfNotInt(regT1); 299 300 addJump(branch32(condition, regT0, regT1), target); 299 301 } 300 302 … … 348 350 // - floating-point number to floating-point number. 349 351 if (isOperandConstantChar(op1) || isOperandConstantChar(op2)) { 350 linkSlowCase(iter); 351 linkSlowCase(iter); 352 linkSlowCase(iter); 353 linkSlowCase(iter); 352 linkAllSlowCases(iter); 354 353 355 354 emitGetVirtualRegister(op1, argumentGPR0); … … 361 360 362 361 if (isOperandConstantInt(op2)) { 363 link SlowCase(iter);362 linkAllSlowCases(iter); 364 363 365 364 if (supportsFloatingPoint()) { … … 383 382 callOperation(operation, regT0, regT1); 384 383 emitJumpSlowToHot(branchTest32(invert ? Zero : NonZero, returnValueGPR), target); 385 } else if (isOperandConstantInt(op1)) { 386 linkSlowCase(iter); 384 return; 385 } 386 387 if (isOperandConstantInt(op1)) { 388 linkAllSlowCases(iter); 387 389 388 390 if (supportsFloatingPoint()) { … … 406 408 callOperation(operation, regT2, regT1); 407 409 emitJumpSlowToHot(branchTest32(invert ? Zero : NonZero, returnValueGPR), target); 408 } else { 409 linkSlowCase(iter); 410 411 if (supportsFloatingPoint()) { 412 Jump fail1 = emitJumpIfNotNumber(regT0); 413 Jump fail2 = emitJumpIfNotNumber(regT1); 414 Jump fail3 = emitJumpIfInt(regT1); 415 add64(tagTypeNumberRegister, regT0); 416 add64(tagTypeNumberRegister, regT1); 417 move64ToDouble(regT0, fpRegT0); 418 move64ToDouble(regT1, fpRegT1); 419 420 emitJumpSlowToHot(branchDouble(condition, fpRegT0, fpRegT1), target); 421 422 emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_jless)); 423 424 fail1.link(this); 425 fail2.link(this); 426 fail3.link(this); 427 } 428 429 linkSlowCase(iter); 430 callOperation(operation, regT0, regT1); 431 emitJumpSlowToHot(branchTest32(invert ? Zero : NonZero, returnValueGPR), target); 410 return; 432 411 } 412 413 linkSlowCase(iter); // LHS is not Int. 414 415 if (supportsFloatingPoint()) { 416 Jump fail1 = emitJumpIfNotNumber(regT0); 417 Jump fail2 = emitJumpIfNotNumber(regT1); 418 Jump fail3 = emitJumpIfInt(regT1); 419 add64(tagTypeNumberRegister, regT0); 420 add64(tagTypeNumberRegister, regT1); 421 move64ToDouble(regT0, fpRegT0); 422 move64ToDouble(regT1, fpRegT1); 423 424 emitJumpSlowToHot(branchDouble(condition, fpRegT0, fpRegT1), target); 425 426 emitJumpSlowToHot(jump(), OPCODE_LENGTH(op_jless)); 427 428 fail1.link(this); 429 fail2.link(this); 430 fail3.link(this); 431 } 432 433 linkSlowCase(iter); // RHS is not Int. 434 callOperation(operation, regT0, regT1); 435 emitJumpSlowToHot(branchTest32(invert ? Zero : NonZero, returnValueGPR), target); 433 436 } 434 437 … … 446 449 void JIT::emitSlow_op_inc(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 447 450 { 448 link SlowCase(iter);449 linkSlowCase(iter); 451 linkAllSlowCases(iter); 452 450 453 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_inc); 451 454 slowPathCall.call(); … … 465 468 void JIT::emitSlow_op_dec(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 466 469 { 467 link SlowCase(iter);468 linkSlowCase(iter); 470 linkAllSlowCases(iter); 471 469 472 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_dec); 470 473 slowPathCall.call(); … … 508 511 void JIT::emitSlow_op_mod(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 509 512 { 510 linkSlowCase(iter); 511 linkSlowCase(iter); 512 linkSlowCase(iter); 513 linkSlowCase(iter); 514 linkSlowCase(iter); 513 linkAllSlowCases(iter); 514 515 515 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_mod); 516 516 slowPathCall.call(); … … 546 546 void JIT::emitSlow_op_negate(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 547 547 { 548 linkAllSlowCases ForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);548 linkAllSlowCases(iter); 549 549 550 550 JITNegIC* negIC = bitwise_cast<JITNegIC*>(m_instructionToMathIC.get(currentInstruction)); … … 604 604 void JIT::emitSlow_op_bitand(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 605 605 { 606 linkAllSlowCases ForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);606 linkAllSlowCases(iter); 607 607 608 608 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_bitand); … … 617 617 void JIT::emitSlow_op_bitor(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 618 618 { 619 linkAllSlowCases ForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);619 linkAllSlowCases(iter); 620 620 621 621 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_bitor); … … 630 630 void JIT::emitSlow_op_bitxor(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 631 631 { 632 linkAllSlowCases ForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);632 linkAllSlowCases(iter); 633 633 634 634 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_bitxor); … … 643 643 void JIT::emitSlow_op_lshift(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 644 644 { 645 linkAllSlowCases ForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);645 linkAllSlowCases(iter); 646 646 647 647 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_lshift); … … 708 708 void JIT::emitSlow_op_rshift(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 709 709 { 710 linkAllSlowCases ForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);710 linkAllSlowCases(iter); 711 711 712 712 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_rshift); … … 721 721 void JIT::emitSlow_op_urshift(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 722 722 { 723 linkAllSlowCases ForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);723 linkAllSlowCases(iter); 724 724 725 725 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_urshift); … … 742 742 void JIT::emitSlow_op_add(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 743 743 { 744 linkAllSlowCases ForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);744 linkAllSlowCases(iter); 745 745 746 746 JITAddIC* addIC = bitwise_cast<JITAddIC*>(m_instructionToMathIC.get(currentInstruction)); … … 1049 1049 void JIT::emitSlow_op_div(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1050 1050 { 1051 linkAllSlowCases ForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);1051 linkAllSlowCases(iter); 1052 1052 1053 1053 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_div); … … 1065 1065 void JIT::emitSlow_op_mul(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1066 1066 { 1067 linkAllSlowCases ForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);1067 linkAllSlowCases(iter); 1068 1068 1069 1069 JITMulIC* mulIC = bitwise_cast<JITMulIC*>(m_instructionToMathIC.get(currentInstruction)); … … 1081 1081 void JIT::emitSlow_op_sub(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1082 1082 { 1083 linkAllSlowCasesForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset); 1083 linkAllSlowCases(iter); 1084 1084 1085 JITSubIC* subIC = bitwise_cast<JITSubIC*>(m_instructionToMathIC.get(currentInstruction)); 1085 1086 emitMathICSlow(subIC, currentInstruction, operationValueSubProfiledOptimize, operationValueSubProfiled, operationValueSubOptimize);
Note:
See TracChangeset
for help on using the changeset viewer.