Changeset 223824 in webkit
- Timestamp:
- Oct 22, 2017 11:28:16 AM (7 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r223823 r223824 1 2017-10-22 Yusuke Suzuki <utatane.tea@gmail.com> 2 3 [JSC][Baseline] Use linkAllSlowCasesForBytecodeOffset as much as possible to simplify slow cases handling 4 https://bugs.webkit.org/show_bug.cgi?id=178647 5 6 Reviewed by Saam Barati. 7 8 There is much code counting slow cases in fast paths to call `linkSlowCase` carefully. This is really error-prone 9 since the number of slow cases depends on values of instruction's metadata. We have linkAllSlowCasesForBytecodeOffset, 10 which drains all slow cases for a specified bytecode offset. In typical cases like just calling a slow path function, 11 this is enough. We use linkAllSlowCasesForBytecodeOffset as much as possible. It significantly simplifies the code. 12 13 * jit/JIT.h: 14 (JSC::JIT::linkAllSlowCases): 15 * jit/JITArithmetic.cpp: 16 (JSC::JIT::emitSlow_op_unsigned): 17 (JSC::JIT::emit_compareAndJump): 18 (JSC::JIT::emit_compareAndJumpSlow): 19 (JSC::JIT::emitSlow_op_inc): 20 (JSC::JIT::emitSlow_op_dec): 21 (JSC::JIT::emitSlow_op_mod): 22 (JSC::JIT::emitSlow_op_negate): 23 (JSC::JIT::emitSlow_op_bitand): 24 (JSC::JIT::emitSlow_op_bitor): 25 (JSC::JIT::emitSlow_op_bitxor): 26 (JSC::JIT::emitSlow_op_lshift): 27 (JSC::JIT::emitSlow_op_rshift): 28 (JSC::JIT::emitSlow_op_urshift): 29 (JSC::JIT::emitSlow_op_add): 30 (JSC::JIT::emitSlow_op_div): 31 (JSC::JIT::emitSlow_op_mul): 32 (JSC::JIT::emitSlow_op_sub): 33 * jit/JITArithmetic32_64.cpp: 34 (JSC::JIT::emit_compareAndJumpSlow): 35 (JSC::JIT::emitSlow_op_unsigned): 36 (JSC::JIT::emitSlow_op_inc): 37 (JSC::JIT::emitSlow_op_dec): 38 (JSC::JIT::emitSlow_op_mod): 39 * jit/JITCall.cpp: 40 (JSC::JIT::compileCallEvalSlowCase): 41 (JSC::JIT::compileOpCallSlowCase): 42 * jit/JITCall32_64.cpp: 43 (JSC::JIT::compileCallEvalSlowCase): 44 (JSC::JIT::compileOpCallSlowCase): 45 * jit/JITInlines.h: 46 (JSC::JIT::linkAllSlowCasesForBytecodeOffset): 47 * jit/JITOpcodes.cpp: 48 (JSC::JIT::emitSlow_op_new_object): 49 (JSC::JIT::emitSlow_op_create_this): 50 (JSC::JIT::emitSlow_op_check_tdz): 51 (JSC::JIT::emitSlow_op_to_this): 52 (JSC::JIT::emitSlow_op_to_primitive): 53 (JSC::JIT::emitSlow_op_not): 54 (JSC::JIT::emitSlow_op_eq): 55 (JSC::JIT::emitSlow_op_neq): 56 (JSC::JIT::emitSlow_op_stricteq): 57 (JSC::JIT::emitSlow_op_nstricteq): 58 (JSC::JIT::emitSlow_op_instanceof): 59 (JSC::JIT::emitSlow_op_instanceof_custom): 60 (JSC::JIT::emitSlow_op_to_number): 61 (JSC::JIT::emitSlow_op_to_string): 62 (JSC::JIT::emitSlow_op_loop_hint): 63 (JSC::JIT::emitSlow_op_check_traps): 64 (JSC::JIT::emitSlow_op_has_indexed_property): 65 (JSC::JIT::emitSlow_op_get_direct_pname): 66 (JSC::JIT::emitSlow_op_has_structure_property): 67 * jit/JITOpcodes32_64.cpp: 68 (JSC::JIT::emitSlow_op_new_object): 69 (JSC::JIT::emitSlow_op_instanceof): 70 (JSC::JIT::emitSlow_op_instanceof_custom): 71 (JSC::JIT::emitSlow_op_to_primitive): 72 (JSC::JIT::emitSlow_op_not): 73 (JSC::JIT::emitSlow_op_stricteq): 74 (JSC::JIT::emitSlow_op_nstricteq): 75 (JSC::JIT::emitSlow_op_to_number): 76 (JSC::JIT::emitSlow_op_to_string): 77 (JSC::JIT::emitSlow_op_create_this): 78 (JSC::JIT::emitSlow_op_to_this): 79 (JSC::JIT::emitSlow_op_check_tdz): 80 (JSC::JIT::emitSlow_op_has_indexed_property): 81 (JSC::JIT::emitSlow_op_get_direct_pname): 82 * jit/JITPropertyAccess.cpp: 83 (JSC::JIT::emitSlow_op_try_get_by_id): 84 (JSC::JIT::emitSlow_op_get_by_id): 85 (JSC::JIT::emitSlow_op_get_by_id_with_this): 86 (JSC::JIT::emitSlow_op_put_by_id): 87 (JSC::JIT::emitSlow_op_resolve_scope): 88 (JSC::JIT::emitSlow_op_get_from_scope): 89 (JSC::JIT::emitSlow_op_put_to_scope): 90 * jit/JITPropertyAccess32_64.cpp: 91 (JSC::JIT::emitSlow_op_try_get_by_id): 92 (JSC::JIT::emitSlow_op_get_by_id): 93 (JSC::JIT::emitSlow_op_get_by_id_with_this): 94 (JSC::JIT::emitSlow_op_put_by_id): 95 (JSC::JIT::emitSlow_op_resolve_scope): 96 (JSC::JIT::emitSlow_op_get_from_scope): 97 (JSC::JIT::emitSlow_op_put_to_scope): 98 1 99 2017-10-22 Yusuke Suzuki <utatane.tea@gmail.com> 2 100 -
trunk/Source/JavaScriptCore/jit/JIT.h
r223823 r223824 717 717 Vector<SlowCaseEntry>::iterator&, unsigned bytecodeOffset); 718 718 719 void linkAllSlowCases(Vector<SlowCaseEntry>::iterator& iter) 720 { 721 linkAllSlowCasesForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset); 722 } 723 719 724 MacroAssembler::Call appendCallWithExceptionCheck(const FunctionPtr&); 720 725 #if OS(WINDOWS) && CPU(X86_64) -
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); -
trunk/Source/JavaScriptCore/jit/JITArithmetic32_64.cpp
r223823 r223824 125 125 void JIT::emit_compareAndJumpSlow(int op1, int op2, unsigned target, DoubleCondition, size_t (JIT_OPERATION *operation)(ExecState*, EncodedJSValue, EncodedJSValue), bool invert, Vector<SlowCaseEntry>::iterator& iter) 126 126 { 127 if (isOperandConstantChar(op1) || isOperandConstantChar(op2)) { 128 linkSlowCase(iter); 129 linkSlowCase(iter); 130 linkSlowCase(iter); 131 linkSlowCase(iter); 132 } else { 133 if (!supportsFloatingPoint()) { 134 if (!isOperandConstantInt(op1) && !isOperandConstantInt(op2)) 135 linkSlowCase(iter); // int32 check 136 linkSlowCase(iter); // int32 check 137 } else { 138 if (!isOperandConstantInt(op1)) { 139 linkSlowCase(iter); // double check 140 linkSlowCase(iter); // int32 check 141 } 142 if (isOperandConstantInt(op1) || !isOperandConstantInt(op2)) 143 linkSlowCase(iter); // double check 144 } 145 } 127 linkAllSlowCases(iter); 128 146 129 emitLoad(op1, regT1, regT0); 147 130 emitLoad(op2, regT3, regT2); … … 164 147 void JIT::emitSlow_op_unsigned(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 165 148 { 166 linkSlowCase(iter); 167 linkSlowCase(iter); 149 linkAllSlowCases(iter); 168 150 169 151 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_unsigned); … … 184 166 void JIT::emitSlow_op_inc(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 185 167 { 186 linkSlowCase(iter); // int32 check 187 linkSlowCase(iter); // overflow check 168 linkAllSlowCases(iter); 188 169 189 170 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_inc); … … 204 185 void JIT::emitSlow_op_dec(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 205 186 { 206 linkSlowCase(iter); // int32 check 207 linkSlowCase(iter); // overflow check 187 linkAllSlowCases(iter); 208 188 209 189 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_dec); … … 381 361 { 382 362 #if CPU(X86) 383 linkSlowCase(iter); 384 linkSlowCase(iter); 385 linkSlowCase(iter); 386 linkSlowCase(iter); 387 linkSlowCase(iter); 363 linkAllSlowCases(iter); 364 388 365 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_mod); 389 366 slowPathCall.call(); -
trunk/Source/JavaScriptCore/jit/JITCall.cpp
r214571 r223824 113 113 void JIT::compileCallEvalSlowCase(Instruction* instruction, Vector<SlowCaseEntry>::iterator& iter) 114 114 { 115 linkAllSlowCases(iter); 116 115 117 CallLinkInfo* info = m_codeBlock->addCallLinkInfo(); 116 118 info->setUpCall(CallLinkInfo::Call, CodeOrigin(m_bytecodeOffset), regT0); 117 119 118 linkSlowCase(iter);119 120 int registerOffset = -instruction[4].u.operand; 120 121 … … 243 244 } 244 245 245 link SlowCase(iter);246 linkAllSlowCases(iter); 246 247 247 248 if (opcodeID == op_tail_call || opcodeID == op_tail_call_varargs || opcodeID == op_tail_call_forward_arguments) -
trunk/Source/JavaScriptCore/jit/JITCall32_64.cpp
r218794 r223824 203 203 void JIT::compileCallEvalSlowCase(Instruction* instruction, Vector<SlowCaseEntry>::iterator& iter) 204 204 { 205 linkAllSlowCases(iter); 206 205 207 CallLinkInfo* info = m_codeBlock->addCallLinkInfo(); 206 208 info->setUpCall(CallLinkInfo::Call, CodeOrigin(m_bytecodeOffset), regT0); 207 208 linkSlowCase(iter);209 209 210 210 int registerOffset = -instruction[4].u.operand; … … 316 316 } 317 317 318 linkSlowCase(iter); 319 linkSlowCase(iter); 318 linkAllSlowCases(iter); 320 319 321 320 move(TrustedImmPtr(m_callCompilationInfo[callLinkInfoIndex].callLinkInfo), regT2); -
trunk/Source/JavaScriptCore/jit/JITInlines.h
r221196 r223824 865 865 ALWAYS_INLINE void JIT::linkAllSlowCasesForBytecodeOffset(Vector<SlowCaseEntry>& slowCases, Vector<SlowCaseEntry>::iterator& iter, unsigned bytecodeOffset) 866 866 { 867 while (iter != slowCases.end() && iter->to == bytecodeOffset) { 868 iter->from.link(this); 869 ++iter; 870 } 867 while (iter != slowCases.end() && iter->to == bytecodeOffset) 868 linkSlowCase(iter); 871 869 } 872 870 -
trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp
r223823 r223824 99 99 void JIT::emitSlow_op_new_object(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 100 100 { 101 link SlowCase(iter);102 linkSlowCase(iter); 101 linkAllSlowCases(iter); 102 103 103 int dst = currentInstruction[1].u.operand; 104 104 Structure* structure = currentInstruction[3].u.objectAllocationProfile->structure(); … … 771 771 void JIT::emitSlow_op_create_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 772 772 { 773 linkSlowCase(iter); // Callee::m_type != JSFunctionType. 774 linkSlowCase(iter); // doesn't have rare data 775 linkSlowCase(iter); // doesn't have an allocation profile 776 linkSlowCase(iter); // allocation failed (no allocator) 777 linkSlowCase(iter); // allocation failed (allocator empty) 778 linkSlowCase(iter); // cached function didn't match 773 linkAllSlowCases(iter); 779 774 780 775 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_create_this); … … 790 785 void JIT::emitSlow_op_check_tdz(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 791 786 { 792 linkSlowCase(iter); 787 linkAllSlowCases(iter); 788 793 789 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_throw_tdz_error); 794 790 slowPathCall.call(); … … 800 796 void JIT::emitSlow_op_to_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 801 797 { 802 linkSlowCase(iter); 803 linkSlowCase(iter); 804 linkSlowCase(iter); 805 linkSlowCase(iter); 798 linkAllSlowCases(iter); 806 799 807 800 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_this); … … 811 804 void JIT::emitSlow_op_to_primitive(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 812 805 { 813 link SlowCase(iter);806 linkAllSlowCases(iter); 814 807 815 808 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_primitive); … … 819 812 void JIT::emitSlow_op_not(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 820 813 { 821 link SlowCase(iter);814 linkAllSlowCases(iter); 822 815 823 816 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_not); … … 827 820 void JIT::emitSlow_op_eq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 828 821 { 829 linkSlowCase(iter); 822 linkAllSlowCases(iter); 823 830 824 callOperation(operationCompareEq, regT0, regT1); 831 825 emitTagBool(returnValueGPR); … … 835 829 void JIT::emitSlow_op_neq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 836 830 { 837 linkSlowCase(iter); 831 linkAllSlowCases(iter); 832 838 833 callOperation(operationCompareEq, regT0, regT1); 839 834 xor32(TrustedImm32(0x1), regT0); … … 844 839 void JIT::emitSlow_op_stricteq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 845 840 { 846 linkSlowCase(iter); 847 linkSlowCase(iter); 848 linkSlowCase(iter); 841 linkAllSlowCases(iter); 842 849 843 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_stricteq); 850 844 slowPathCall.call(); … … 853 847 void JIT::emitSlow_op_nstricteq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 854 848 { 855 linkSlowCase(iter); 856 linkSlowCase(iter); 857 linkSlowCase(iter); 849 linkAllSlowCases(iter); 850 858 851 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_nstricteq); 859 852 slowPathCall.call(); … … 862 855 void JIT::emitSlow_op_instanceof(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 863 856 { 857 linkAllSlowCases(iter); 858 864 859 auto& bytecode = *reinterpret_cast<OpInstanceof*>(currentInstruction); 865 860 int dst = bytecode.dst(); … … 867 862 int proto = bytecode.prototype(); 868 863 869 linkSlowCaseIfNotJSCell(iter, value);870 linkSlowCaseIfNotJSCell(iter, proto);871 linkSlowCase(iter);872 linkSlowCase(iter);873 864 emitGetVirtualRegister(value, regT0); 874 865 emitGetVirtualRegister(proto, regT1); … … 878 869 void JIT::emitSlow_op_instanceof_custom(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 879 870 { 871 linkAllSlowCases(iter); 872 880 873 auto& bytecode = *reinterpret_cast<OpInstanceofCustom*>(currentInstruction); 881 874 int dst = bytecode.dst(); … … 884 877 int hasInstanceValue = bytecode.hasInstanceValue(); 885 878 886 linkSlowCase(iter);887 879 emitGetVirtualRegister(value, regT0); 888 880 emitGetVirtualRegister(constructor, regT1); … … 895 887 void JIT::emitSlow_op_to_number(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 896 888 { 897 link SlowCase(iter);889 linkAllSlowCases(iter); 898 890 899 891 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_number); … … 903 895 void JIT::emitSlow_op_to_string(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 904 896 { 905 linkSlowCase(iter); // Not JSCell. 906 linkSlowCase(iter); // Not JSString. 897 linkAllSlowCases(iter); 907 898 908 899 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_string); … … 926 917 // Emit the slow path for the JIT optimization check: 927 918 if (canBeOptimized()) { 928 link SlowCase(iter);919 linkAllSlowCases(iter); 929 920 930 921 copyCalleeSavesFromFrameOrRegisterToEntryFrameCalleeSavesBuffer(vm()->topEntryFrame); … … 958 949 void JIT::emitSlow_op_check_traps(Instruction*, Vector<SlowCaseEntry>::iterator& iter) 959 950 { 960 linkSlowCase(iter); 951 linkAllSlowCases(iter); 952 961 953 callOperation(operationHandleTraps); 962 954 } … … 1189 1181 void JIT::emitSlow_op_has_indexed_property(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1190 1182 { 1183 linkAllSlowCases(iter); 1184 1191 1185 int dst = currentInstruction[1].u.operand; 1192 1186 int base = currentInstruction[2].u.operand; 1193 1187 int property = currentInstruction[3].u.operand; 1194 1188 ByValInfo* byValInfo = m_byValCompilationInfo[m_byValInstructionIndex].byValInfo; 1195 1196 linkSlowCaseIfNotJSCell(iter, base); // base cell check 1197 linkSlowCase(iter); // base array check 1198 linkSlowCase(iter); // vector length check 1199 linkSlowCase(iter); // empty value 1200 1189 1201 1190 Label slowPath = label(); 1202 1191 … … 1252 1241 void JIT::emitSlow_op_get_direct_pname(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1253 1242 { 1254 int base = currentInstruction[2].u.operand; 1255 linkSlowCaseIfNotJSCell(iter, base); 1256 linkSlowCase(iter); 1243 linkAllSlowCases(iter); 1257 1244 1258 1245 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_get_direct_pname); … … 1399 1386 void JIT::emitSlow_op_has_structure_property(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1400 1387 { 1401 linkSlowCase(iter); 1402 linkSlowCase(iter); 1388 linkAllSlowCases(iter); 1403 1389 1404 1390 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_has_structure_property); -
trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
r223823 r223824 98 98 void JIT::emitSlow_op_new_object(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 99 99 { 100 link SlowCase(iter);101 linkSlowCase(iter); 100 linkAllSlowCases(iter); 101 102 102 int dst = currentInstruction[1].u.operand; 103 103 Structure* structure = currentInstruction[3].u.objectAllocationProfile->structure(); … … 189 189 void JIT::emitSlow_op_instanceof(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 190 190 { 191 linkAllSlowCases(iter); 192 191 193 auto& bytecode = *reinterpret_cast<OpInstanceof*>(currentInstruction); 192 194 int dst = bytecode.dst(); … … 194 196 int proto = bytecode.prototype(); 195 197 196 linkSlowCaseIfNotJSCell(iter, value);197 linkSlowCaseIfNotJSCell(iter, proto);198 linkSlowCase(iter);199 linkSlowCase(iter);200 201 198 emitLoad(value, regT1, regT0); 202 199 emitLoad(proto, regT3, regT2); … … 206 203 void JIT::emitSlow_op_instanceof_custom(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 207 204 { 205 linkAllSlowCases(iter); 206 208 207 auto& bytecode = *reinterpret_cast<OpInstanceofCustom*>(currentInstruction); 209 208 int dst = bytecode.dst(); … … 212 211 int hasInstanceValue = bytecode.hasInstanceValue(); 213 212 214 linkSlowCase(iter);215 216 213 emitLoad(value, regT1, regT0); 217 214 emitLoadPayload(constructor, regT2); … … 334 331 void JIT::emitSlow_op_to_primitive(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 335 332 { 336 link SlowCase(iter);333 linkAllSlowCases(iter); 337 334 338 335 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_primitive); … … 365 362 void JIT::emitSlow_op_not(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 366 363 { 367 link SlowCase(iter);364 linkAllSlowCases(iter); 368 365 369 366 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_not); … … 591 588 void JIT::emitSlow_op_stricteq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 592 589 { 593 linkSlowCase(iter); 594 linkSlowCase(iter); 595 linkSlowCase(iter); 590 linkAllSlowCases(iter); 596 591 597 592 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_stricteq); … … 606 601 void JIT::emitSlow_op_nstricteq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 607 602 { 608 linkSlowCase(iter); 609 linkSlowCase(iter); 610 linkSlowCase(iter); 603 linkAllSlowCases(iter); 611 604 612 605 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_nstricteq); … … 703 696 void JIT::emitSlow_op_to_number(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 704 697 { 705 link SlowCase(iter);698 linkAllSlowCases(iter); 706 699 707 700 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_number); … … 725 718 void JIT::emitSlow_op_to_string(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 726 719 { 727 linkSlowCase(iter); // Not JSCell. 728 linkSlowCase(iter); // Not JSString. 720 linkAllSlowCases(iter); 729 721 730 722 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_string); … … 913 905 void JIT::emitSlow_op_create_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 914 906 { 915 linkSlowCase(iter); // Callee::m_type != JSFunctionType. 916 linkSlowCase(iter); // doesn't have rare data 917 linkSlowCase(iter); // doesn't have an allocation profile 918 linkSlowCase(iter); // allocation failed (no allocator) 919 linkSlowCase(iter); // allocation failed (allocator empty) 920 linkSlowCase(iter); // cached function didn't match 907 linkAllSlowCases(iter); 921 908 922 909 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_create_this); … … 940 927 void JIT::emitSlow_op_to_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 941 928 { 942 linkSlowCase(iter); 943 linkSlowCase(iter); 944 linkSlowCase(iter); 929 linkAllSlowCases(iter); 930 945 931 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_this); 946 932 slowPathCall.call(); … … 955 941 void JIT::emitSlow_op_check_tdz(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 956 942 { 957 linkSlowCase(iter); 943 linkAllSlowCases(iter); 944 958 945 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_throw_tdz_error); 959 946 slowPathCall.call(); … … 1051 1038 void JIT::emitSlow_op_has_indexed_property(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1052 1039 { 1040 linkAllSlowCases(iter); 1041 1053 1042 int dst = currentInstruction[1].u.operand; 1054 1043 int base = currentInstruction[2].u.operand; 1055 1044 int property = currentInstruction[3].u.operand; 1056 1045 ByValInfo* byValInfo = m_byValCompilationInfo[m_byValInstructionIndex].byValInfo; 1057 1058 linkSlowCaseIfNotJSCell(iter, base); // base cell check1059 linkSlowCase(iter); // base array check1060 linkSlowCase(iter); // vector length check1061 linkSlowCase(iter); // empty value1062 1046 1063 1047 Label slowPath = label(); … … 1114 1098 void JIT::emitSlow_op_get_direct_pname(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1115 1099 { 1116 int base = currentInstruction[2].u.operand; 1117 linkSlowCaseIfNotJSCell(iter, base); 1118 linkSlowCase(iter); 1100 linkAllSlowCases(iter); 1119 1101 1120 1102 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_get_direct_pname); -
trunk/Source/JavaScriptCore/jit/JITPropertyAccess.cpp
r223823 r223824 590 590 void JIT::emitSlow_op_try_get_by_id(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 591 591 { 592 linkAllSlowCases(iter); 593 592 594 int resultVReg = currentInstruction[1].u.operand; 593 int baseVReg = currentInstruction[2].u.operand;594 595 const Identifier* ident = &(m_codeBlock->identifier(currentInstruction[3].u.operand)); 595 596 linkSlowCaseIfNotJSCell(iter, baseVReg);597 linkSlowCase(iter);598 596 599 597 JITGetByIdGenerator& gen = m_getByIds[m_getByIdIndex++]; … … 655 653 void JIT::emitSlow_op_get_by_id(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 656 654 { 655 linkAllSlowCases(iter); 656 657 657 int resultVReg = currentInstruction[1].u.operand; 658 int baseVReg = currentInstruction[2].u.operand;659 658 const Identifier* ident = &(m_codeBlock->identifier(currentInstruction[3].u.operand)); 660 659 661 linkSlowCaseIfNotJSCell(iter, baseVReg);662 linkSlowCase(iter);663 664 660 JITGetByIdGenerator& gen = m_getByIds[m_getByIdIndex++]; 665 661 … … 673 669 void JIT::emitSlow_op_get_by_id_with_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 674 670 { 671 linkAllSlowCases(iter); 672 675 673 int resultVReg = currentInstruction[1].u.operand; 676 int baseVReg = currentInstruction[2].u.operand;677 int thisVReg = currentInstruction[3].u.operand;678 674 const Identifier* ident = &(m_codeBlock->identifier(currentInstruction[4].u.operand)); 679 680 linkSlowCaseIfNotJSCell(iter, baseVReg);681 linkSlowCaseIfNotJSCell(iter, thisVReg);682 linkSlowCase(iter);683 675 684 676 JITGetByIdWithThisGenerator& gen = m_getByIdsWithThis[m_getByIdWithThisIndex++]; … … 720 712 void JIT::emitSlow_op_put_by_id(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 721 713 { 722 int baseVReg = currentInstruction[1].u.operand; 714 linkAllSlowCases(iter); 715 723 716 const Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand)); 724 725 linkSlowCaseIfNotJSCell(iter, baseVReg);726 linkSlowCase(iter);727 717 728 718 Label coldPathBegin(this); … … 831 821 void JIT::emitSlow_op_resolve_scope(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 832 822 { 833 ResolveType resolveType = static_cast<ResolveType>(copiedInstruction(currentInstruction)[4].u.operand); 834 if (resolveType == GlobalProperty || resolveType == GlobalVar || resolveType == ClosureVar || resolveType == GlobalLexicalVar || resolveType == ModuleVar) 835 return; 836 837 if (resolveType == UnresolvedProperty || resolveType == UnresolvedPropertyWithVarInjectionChecks) { 838 linkSlowCase(iter); // var injections check for GlobalPropertyWithVarInjectionChecks. 839 linkSlowCase(iter); // var injections check for GlobalLexicalVarWithVarInjectionChecks. 840 } 841 842 linkSlowCase(iter); 823 linkAllSlowCases(iter); 824 843 825 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_resolve_scope); 844 826 slowPathCall.call(); … … 970 952 void JIT::emitSlow_op_get_from_scope(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 971 953 { 954 linkAllSlowCases(iter); 955 972 956 int dst = currentInstruction[1].u.operand; 973 ResolveType resolveType = GetPutInfo(copiedInstruction(currentInstruction)[4].u.operand).resolveType();974 975 if (resolveType == GlobalVar || resolveType == ClosureVar)976 return;977 978 if (resolveType == GlobalProperty || resolveType == GlobalPropertyWithVarInjectionChecks)979 linkSlowCase(iter); // bad structure980 981 if (resolveType == GlobalLexicalVarWithVarInjectionChecks) // Var injections check.982 linkSlowCase(iter);983 984 if (resolveType == UnresolvedProperty || resolveType == UnresolvedPropertyWithVarInjectionChecks) {985 // GlobalProperty/GlobalPropertyWithVarInjectionChecks986 linkSlowCase(iter); // emitLoadWithStructureCheck987 linkSlowCase(iter); // emitLoadWithStructureCheck988 // GlobalLexicalVar989 linkSlowCase(iter); // TDZ check.990 // GlobalLexicalVarWithVarInjectionChecks.991 linkSlowCase(iter); // var injection check.992 linkSlowCase(iter); // TDZ check.993 }994 995 linkSlowCase(iter);996 997 957 callOperation(WithProfile, operationGetFromScope, dst, currentInstruction); 998 958 } … … 1123 1083 void JIT::emitSlow_op_put_to_scope(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1124 1084 { 1085 linkAllSlowCases(iter); 1086 1125 1087 GetPutInfo getPutInfo = GetPutInfo(copiedInstruction(currentInstruction)[4].u.operand); 1126 1088 ResolveType resolveType = getPutInfo.resolveType(); 1127 unsigned linkCount = 0;1128 if (resolveType != GlobalVar && resolveType != ClosureVar && resolveType != LocalClosureVar && resolveType != GlobalLexicalVar)1129 linkCount++;1130 if (resolveType == GlobalVar || resolveType == GlobalVarWithVarInjectionChecks1131 || resolveType == GlobalLexicalVar || resolveType == GlobalLexicalVarWithVarInjectionChecks1132 || resolveType == ClosureVar || resolveType == ClosureVarWithVarInjectionChecks1133 || resolveType == LocalClosureVar)1134 linkCount++;1135 if (resolveType == GlobalProperty || resolveType == GlobalPropertyWithVarInjectionChecks)1136 linkCount++; // bad structure1137 if (!isInitialization(getPutInfo.initializationMode()) && (resolveType == GlobalLexicalVar || resolveType == GlobalLexicalVarWithVarInjectionChecks)) // TDZ check.1138 linkCount++;1139 if (resolveType == UnresolvedProperty || resolveType == UnresolvedPropertyWithVarInjectionChecks) {1140 // GlobalProperty/GlobalPropertyWithVarInjectionsCheck1141 linkCount++; // emitLoadWithStructureCheck1142 linkCount++; // emitLoadWithStructureCheck1143 1144 // GlobalLexicalVar1145 bool needsTDZCheck = !isInitialization(getPutInfo.initializationMode());1146 if (needsTDZCheck)1147 linkCount++;1148 linkCount++; // Notify write check.1149 1150 // GlobalLexicalVarWithVarInjectionsCheck1151 linkCount++; // var injection check.1152 if (needsTDZCheck)1153 linkCount++;1154 linkCount++; // Notify write check.1155 }1156 if (!linkCount)1157 return;1158 while (linkCount--)1159 linkSlowCase(iter);1160 1161 1089 if (resolveType == ModuleVar) { 1162 1090 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_throw_strict_mode_readonly_property_write_error); -
trunk/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
r223823 r223824 606 606 void JIT::emitSlow_op_try_get_by_id(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 607 607 { 608 linkAllSlowCases(iter); 609 608 610 int resultVReg = currentInstruction[1].u.operand; 609 int baseVReg = currentInstruction[2].u.operand;610 611 const Identifier* ident = &(m_codeBlock->identifier(currentInstruction[3].u.operand)); 611 612 linkSlowCaseIfNotJSCell(iter, baseVReg);613 linkSlowCase(iter);614 612 615 613 JITGetByIdGenerator& gen = m_getByIds[m_getByIdIndex++]; … … 648 646 void JIT::emitSlow_op_get_by_id(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 649 647 { 648 linkAllSlowCases(iter); 649 650 650 int resultVReg = currentInstruction[1].u.operand; 651 int baseVReg = currentInstruction[2].u.operand;652 651 const Identifier* ident = &(m_codeBlock->identifier(currentInstruction[3].u.operand)); 653 654 linkSlowCaseIfNotJSCell(iter, baseVReg);655 linkSlowCase(iter);656 652 657 653 JITGetByIdGenerator& gen = m_getByIds[m_getByIdIndex++]; … … 689 685 void JIT::emitSlow_op_get_by_id_with_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 690 686 { 687 linkAllSlowCases(iter); 688 691 689 int resultVReg = currentInstruction[1].u.operand; 692 int baseVReg = currentInstruction[2].u.operand;693 int thisVReg = currentInstruction[3].u.operand;694 690 const Identifier* ident = &(m_codeBlock->identifier(currentInstruction[4].u.operand)); 695 696 linkSlowCaseIfNotJSCell(iter, baseVReg);697 linkSlowCaseIfNotJSCell(iter, thisVReg);698 linkSlowCase(iter);699 691 700 692 JITGetByIdWithThisGenerator& gen = m_getByIdsWithThis[m_getByIdWithThisIndex++]; … … 736 728 void JIT::emitSlow_op_put_by_id(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 737 729 { 730 linkAllSlowCases(iter); 731 738 732 int base = currentInstruction[1].u.operand; 739 733 const Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand)); 740 734 741 linkSlowCaseIfNotJSCell(iter, base);742 linkSlowCase(iter);743 744 735 Label coldPathBegin(this); 745 736 … … 851 842 void JIT::emitSlow_op_resolve_scope(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 852 843 { 853 ResolveType resolveType = static_cast<ResolveType>(currentInstruction[4].u.operand); 854 855 if (resolveType == GlobalProperty || resolveType == GlobalVar || resolveType == ClosureVar || resolveType == GlobalLexicalVar || resolveType == ModuleVar) 856 return; 857 if (resolveType == UnresolvedProperty || resolveType == UnresolvedPropertyWithVarInjectionChecks) { 858 linkSlowCase(iter); // Var injections check for GlobalPropertyWithVarInjectionChecks. 859 linkSlowCase(iter); // Var injections check for GlobalLexicalVarWithVarInjectionChecks. 860 } 861 862 linkSlowCase(iter); 844 linkAllSlowCases(iter); 845 863 846 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_resolve_scope); 864 847 slowPathCall.call(); … … 991 974 void JIT::emitSlow_op_get_from_scope(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 992 975 { 976 linkAllSlowCases(iter); 977 993 978 int dst = currentInstruction[1].u.operand; 994 ResolveType resolveType = GetPutInfo(currentInstruction[4].u.operand).resolveType();995 996 if (resolveType == GlobalVar || resolveType == ClosureVar)997 return;998 999 if (resolveType == GlobalLexicalVarWithVarInjectionChecks) // Var Injections check.1000 linkSlowCase(iter);1001 1002 if (resolveType == UnresolvedProperty || resolveType == UnresolvedPropertyWithVarInjectionChecks) {1003 // GlobalProperty/GlobalPropertyWithVarInjectionChecks1004 linkSlowCase(iter); // emitLoadWithStructureCheck1005 // GlobalLexicalVar1006 linkSlowCase(iter); // TDZ check.1007 // GlobalLexicalVarWithVarInjectionChecks.1008 linkSlowCase(iter); // var injection check.1009 linkSlowCase(iter); // TDZ check.1010 }1011 1012 linkSlowCase(iter);1013 979 callOperation(WithProfile, operationGetFromScope, dst, currentInstruction); 1014 980 } … … 1143 1109 void JIT::emitSlow_op_put_to_scope(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter) 1144 1110 { 1111 linkAllSlowCases(iter); 1112 1145 1113 GetPutInfo getPutInfo = GetPutInfo(currentInstruction[4].u.operand); 1146 1114 ResolveType resolveType = getPutInfo.resolveType(); 1147 unsigned linkCount = 0;1148 if (resolveType != GlobalVar && resolveType != ClosureVar && resolveType != LocalClosureVar && resolveType != GlobalLexicalVar)1149 linkCount++;1150 if (resolveType == GlobalVar || resolveType == GlobalVarWithVarInjectionChecks1151 || resolveType == GlobalLexicalVar || resolveType == GlobalLexicalVarWithVarInjectionChecks1152 || resolveType == ClosureVar || resolveType == ClosureVarWithVarInjectionChecks1153 || resolveType == LocalClosureVar)1154 linkCount++;1155 if (!isInitialization(getPutInfo.initializationMode()) && (resolveType == GlobalLexicalVar || resolveType == GlobalLexicalVarWithVarInjectionChecks)) // TDZ check.1156 linkCount++;1157 if (resolveType == UnresolvedProperty || resolveType == UnresolvedPropertyWithVarInjectionChecks) {1158 // GlobalProperty/GlobalPropertyWithVarInjectionsCheck1159 linkCount++; // emitLoadWithStructureCheck1160 1161 // GlobalLexicalVar1162 bool needsTDZCheck = !isInitialization(getPutInfo.initializationMode());1163 if (needsTDZCheck)1164 linkCount++;1165 linkCount++; // Notify write check.1166 1167 // GlobalLexicalVarWithVarInjectionsCheck1168 linkCount++; // var injection check.1169 if (needsTDZCheck)1170 linkCount++;1171 linkCount++; // Notify write check.1172 }1173 if (!linkCount)1174 return;1175 while (linkCount--)1176 linkSlowCase(iter);1177 1178 1115 if (resolveType == ModuleVar) { 1179 1116 JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_throw_strict_mode_readonly_property_write_error);
Note: See TracChangeset
for help on using the changeset viewer.