Changeset 223824 in webkit


Ignore:
Timestamp:
Oct 22, 2017 11:28:16 AM (7 years ago)
Author:
Yusuke Suzuki
Message:

[JSC][Baseline] Use linkAllSlowCasesForBytecodeOffset as much as possible to simplify slow cases handling
https://bugs.webkit.org/show_bug.cgi?id=178647

Reviewed by Saam Barati.

There is much code counting slow cases in fast paths to call linkSlowCase carefully. This is really error-prone
since the number of slow cases depends on values of instruction's metadata. We have linkAllSlowCasesForBytecodeOffset,
which drains all slow cases for a specified bytecode offset. In typical cases like just calling a slow path function,
this is enough. We use linkAllSlowCasesForBytecodeOffset as much as possible. It significantly simplifies the code.

  • jit/JIT.h:

(JSC::JIT::linkAllSlowCases):

  • jit/JITArithmetic.cpp:

(JSC::JIT::emitSlow_op_unsigned):
(JSC::JIT::emit_compareAndJump):
(JSC::JIT::emit_compareAndJumpSlow):
(JSC::JIT::emitSlow_op_inc):
(JSC::JIT::emitSlow_op_dec):
(JSC::JIT::emitSlow_op_mod):
(JSC::JIT::emitSlow_op_negate):
(JSC::JIT::emitSlow_op_bitand):
(JSC::JIT::emitSlow_op_bitor):
(JSC::JIT::emitSlow_op_bitxor):
(JSC::JIT::emitSlow_op_lshift):
(JSC::JIT::emitSlow_op_rshift):
(JSC::JIT::emitSlow_op_urshift):
(JSC::JIT::emitSlow_op_add):
(JSC::JIT::emitSlow_op_div):
(JSC::JIT::emitSlow_op_mul):
(JSC::JIT::emitSlow_op_sub):

  • jit/JITArithmetic32_64.cpp:

(JSC::JIT::emit_compareAndJumpSlow):
(JSC::JIT::emitSlow_op_unsigned):
(JSC::JIT::emitSlow_op_inc):
(JSC::JIT::emitSlow_op_dec):
(JSC::JIT::emitSlow_op_mod):

  • jit/JITCall.cpp:

(JSC::JIT::compileCallEvalSlowCase):
(JSC::JIT::compileOpCallSlowCase):

  • jit/JITCall32_64.cpp:

(JSC::JIT::compileCallEvalSlowCase):
(JSC::JIT::compileOpCallSlowCase):

  • jit/JITInlines.h:

(JSC::JIT::linkAllSlowCasesForBytecodeOffset):

  • jit/JITOpcodes.cpp:

(JSC::JIT::emitSlow_op_new_object):
(JSC::JIT::emitSlow_op_create_this):
(JSC::JIT::emitSlow_op_check_tdz):
(JSC::JIT::emitSlow_op_to_this):
(JSC::JIT::emitSlow_op_to_primitive):
(JSC::JIT::emitSlow_op_not):
(JSC::JIT::emitSlow_op_eq):
(JSC::JIT::emitSlow_op_neq):
(JSC::JIT::emitSlow_op_stricteq):
(JSC::JIT::emitSlow_op_nstricteq):
(JSC::JIT::emitSlow_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof_custom):
(JSC::JIT::emitSlow_op_to_number):
(JSC::JIT::emitSlow_op_to_string):
(JSC::JIT::emitSlow_op_loop_hint):
(JSC::JIT::emitSlow_op_check_traps):
(JSC::JIT::emitSlow_op_has_indexed_property):
(JSC::JIT::emitSlow_op_get_direct_pname):
(JSC::JIT::emitSlow_op_has_structure_property):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::emitSlow_op_new_object):
(JSC::JIT::emitSlow_op_instanceof):
(JSC::JIT::emitSlow_op_instanceof_custom):
(JSC::JIT::emitSlow_op_to_primitive):
(JSC::JIT::emitSlow_op_not):
(JSC::JIT::emitSlow_op_stricteq):
(JSC::JIT::emitSlow_op_nstricteq):
(JSC::JIT::emitSlow_op_to_number):
(JSC::JIT::emitSlow_op_to_string):
(JSC::JIT::emitSlow_op_create_this):
(JSC::JIT::emitSlow_op_to_this):
(JSC::JIT::emitSlow_op_check_tdz):
(JSC::JIT::emitSlow_op_has_indexed_property):
(JSC::JIT::emitSlow_op_get_direct_pname):

  • jit/JITPropertyAccess.cpp:

(JSC::JIT::emitSlow_op_try_get_by_id):
(JSC::JIT::emitSlow_op_get_by_id):
(JSC::JIT::emitSlow_op_get_by_id_with_this):
(JSC::JIT::emitSlow_op_put_by_id):
(JSC::JIT::emitSlow_op_resolve_scope):
(JSC::JIT::emitSlow_op_get_from_scope):
(JSC::JIT::emitSlow_op_put_to_scope):

  • jit/JITPropertyAccess32_64.cpp:

(JSC::JIT::emitSlow_op_try_get_by_id):
(JSC::JIT::emitSlow_op_get_by_id):
(JSC::JIT::emitSlow_op_get_by_id_with_this):
(JSC::JIT::emitSlow_op_put_by_id):
(JSC::JIT::emitSlow_op_resolve_scope):
(JSC::JIT::emitSlow_op_get_from_scope):
(JSC::JIT::emitSlow_op_put_to_scope):

Location:
trunk/Source/JavaScriptCore
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r223823 r223824  
     12017-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
    1992017-10-22  Yusuke Suzuki  <utatane.tea@gmail.com>
    2100
  • trunk/Source/JavaScriptCore/jit/JIT.h

    r223823 r223824  
    717717            Vector<SlowCaseEntry>::iterator&, unsigned bytecodeOffset);
    718718
     719        void linkAllSlowCases(Vector<SlowCaseEntry>::iterator& iter)
     720        {
     721            linkAllSlowCasesForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);
     722        }
     723
    719724        MacroAssembler::Call appendCallWithExceptionCheck(const FunctionPtr&);
    720725#if OS(WINDOWS) && CPU(X86_64)
  • trunk/Source/JavaScriptCore/jit/JITArithmetic.cpp

    r223823 r223824  
    248248void JIT::emitSlow_op_unsigned(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    249249{
    250     linkSlowCase(iter);
    251     linkSlowCase(iter);
     250    linkAllSlowCases(iter);
    252251   
    253252    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_unsigned);
     
    285284        int32_t op2imm = getOperandConstantInt(op2);
    286285        addJump(branch32(condition, regT0, Imm32(op2imm)), target);
    287     } else if (isOperandConstantInt(op1)) {
     286        return;
     287    }
     288    if (isOperandConstantInt(op1)) {
    288289        emitGetVirtualRegister(op2, regT1);
    289290        emitJumpSlowCaseIfNotInt(regT1);
    290291        int32_t op1imm = getOperandConstantInt(op1);
    291292        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;
    298294    }
     295
     296    emitGetVirtualRegisters(op1, regT0, op2, regT1);
     297    emitJumpSlowCaseIfNotInt(regT0);
     298    emitJumpSlowCaseIfNotInt(regT1);
     299
     300    addJump(branch32(condition, regT0, regT1), target);
    299301}
    300302
     
    348350    // - floating-point number to floating-point number.
    349351    if (isOperandConstantChar(op1) || isOperandConstantChar(op2)) {
    350         linkSlowCase(iter);
    351         linkSlowCase(iter);
    352         linkSlowCase(iter);
    353         linkSlowCase(iter);
     352        linkAllSlowCases(iter);
    354353
    355354        emitGetVirtualRegister(op1, argumentGPR0);
     
    361360
    362361    if (isOperandConstantInt(op2)) {
    363         linkSlowCase(iter);
     362        linkAllSlowCases(iter);
    364363
    365364        if (supportsFloatingPoint()) {
     
    383382        callOperation(operation, regT0, regT1);
    384383        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);
    387389
    388390        if (supportsFloatingPoint()) {
     
    406408        callOperation(operation, regT2, regT1);
    407409        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;
    432411    }
     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);
    433436}
    434437
     
    446449void JIT::emitSlow_op_inc(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    447450{
    448     linkSlowCase(iter);
    449     linkSlowCase(iter);
     451    linkAllSlowCases(iter);
     452
    450453    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_inc);
    451454    slowPathCall.call();
     
    465468void JIT::emitSlow_op_dec(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    466469{
    467     linkSlowCase(iter);
    468     linkSlowCase(iter);
     470    linkAllSlowCases(iter);
     471
    469472    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_dec);
    470473    slowPathCall.call();
     
    508511void JIT::emitSlow_op_mod(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    509512{
    510     linkSlowCase(iter);
    511     linkSlowCase(iter);
    512     linkSlowCase(iter);
    513     linkSlowCase(iter);
    514     linkSlowCase(iter);
     513    linkAllSlowCases(iter);
     514
    515515    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_mod);
    516516    slowPathCall.call();
     
    546546void JIT::emitSlow_op_negate(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    547547{
    548     linkAllSlowCasesForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);
     548    linkAllSlowCases(iter);
    549549
    550550    JITNegIC* negIC = bitwise_cast<JITNegIC*>(m_instructionToMathIC.get(currentInstruction));
     
    604604void JIT::emitSlow_op_bitand(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    605605{
    606     linkAllSlowCasesForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);
     606    linkAllSlowCases(iter);
    607607
    608608    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_bitand);
     
    617617void JIT::emitSlow_op_bitor(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    618618{
    619     linkAllSlowCasesForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);
     619    linkAllSlowCases(iter);
    620620
    621621    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_bitor);
     
    630630void JIT::emitSlow_op_bitxor(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    631631{
    632     linkAllSlowCasesForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);
     632    linkAllSlowCases(iter);
    633633
    634634    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_bitxor);
     
    643643void JIT::emitSlow_op_lshift(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    644644{
    645     linkAllSlowCasesForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);
     645    linkAllSlowCases(iter);
    646646
    647647    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_lshift);
     
    708708void JIT::emitSlow_op_rshift(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    709709{
    710     linkAllSlowCasesForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);
     710    linkAllSlowCases(iter);
    711711
    712712    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_rshift);
     
    721721void JIT::emitSlow_op_urshift(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    722722{
    723     linkAllSlowCasesForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);
     723    linkAllSlowCases(iter);
    724724
    725725    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_urshift);
     
    742742void JIT::emitSlow_op_add(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    743743{
    744     linkAllSlowCasesForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);
     744    linkAllSlowCases(iter);
    745745
    746746    JITAddIC* addIC = bitwise_cast<JITAddIC*>(m_instructionToMathIC.get(currentInstruction));
     
    10491049void JIT::emitSlow_op_div(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    10501050{
    1051     linkAllSlowCasesForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);
     1051    linkAllSlowCases(iter);
    10521052
    10531053    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_div);
     
    10651065void JIT::emitSlow_op_mul(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    10661066{
    1067     linkAllSlowCasesForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);
     1067    linkAllSlowCases(iter);
    10681068
    10691069    JITMulIC* mulIC = bitwise_cast<JITMulIC*>(m_instructionToMathIC.get(currentInstruction));
     
    10811081void JIT::emitSlow_op_sub(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    10821082{
    1083     linkAllSlowCasesForBytecodeOffset(m_slowCases, iter, m_bytecodeOffset);
     1083    linkAllSlowCases(iter);
     1084
    10841085    JITSubIC* subIC = bitwise_cast<JITSubIC*>(m_instructionToMathIC.get(currentInstruction));
    10851086    emitMathICSlow(subIC, currentInstruction, operationValueSubProfiledOptimize, operationValueSubProfiled, operationValueSubOptimize);
  • trunk/Source/JavaScriptCore/jit/JITArithmetic32_64.cpp

    r223823 r223824  
    125125void JIT::emit_compareAndJumpSlow(int op1, int op2, unsigned target, DoubleCondition, size_t (JIT_OPERATION *operation)(ExecState*, EncodedJSValue, EncodedJSValue), bool invert, Vector<SlowCaseEntry>::iterator& iter)
    126126{
    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
    146129    emitLoad(op1, regT1, regT0);
    147130    emitLoad(op2, regT3, regT2);
     
    164147void JIT::emitSlow_op_unsigned(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    165148{
    166     linkSlowCase(iter);
    167     linkSlowCase(iter);
     149    linkAllSlowCases(iter);
    168150   
    169151    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_unsigned);
     
    184166void JIT::emitSlow_op_inc(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    185167{
    186     linkSlowCase(iter); // int32 check
    187     linkSlowCase(iter); // overflow check
     168    linkAllSlowCases(iter);
    188169
    189170    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_inc);
     
    204185void JIT::emitSlow_op_dec(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    205186{
    206     linkSlowCase(iter); // int32 check
    207     linkSlowCase(iter); // overflow check
     187    linkAllSlowCases(iter);
    208188
    209189    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_dec);
     
    381361{
    382362#if CPU(X86)
    383     linkSlowCase(iter);
    384     linkSlowCase(iter);
    385     linkSlowCase(iter);
    386     linkSlowCase(iter);
    387     linkSlowCase(iter);
     363    linkAllSlowCases(iter);
     364
    388365    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_mod);
    389366    slowPathCall.call();
  • trunk/Source/JavaScriptCore/jit/JITCall.cpp

    r214571 r223824  
    113113void JIT::compileCallEvalSlowCase(Instruction* instruction, Vector<SlowCaseEntry>::iterator& iter)
    114114{
     115    linkAllSlowCases(iter);
     116
    115117    CallLinkInfo* info = m_codeBlock->addCallLinkInfo();
    116118    info->setUpCall(CallLinkInfo::Call, CodeOrigin(m_bytecodeOffset), regT0);
    117119
    118     linkSlowCase(iter);
    119120    int registerOffset = -instruction[4].u.operand;
    120121
     
    243244    }
    244245
    245     linkSlowCase(iter);
     246    linkAllSlowCases(iter);
    246247
    247248    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  
    203203void JIT::compileCallEvalSlowCase(Instruction* instruction, Vector<SlowCaseEntry>::iterator& iter)
    204204{
     205    linkAllSlowCases(iter);
     206
    205207    CallLinkInfo* info = m_codeBlock->addCallLinkInfo();
    206208    info->setUpCall(CallLinkInfo::Call, CodeOrigin(m_bytecodeOffset), regT0);
    207 
    208     linkSlowCase(iter);
    209209
    210210    int registerOffset = -instruction[4].u.operand;
     
    316316    }
    317317
    318     linkSlowCase(iter);
    319     linkSlowCase(iter);
     318    linkAllSlowCases(iter);
    320319
    321320    move(TrustedImmPtr(m_callCompilationInfo[callLinkInfoIndex].callLinkInfo), regT2);
  • trunk/Source/JavaScriptCore/jit/JITInlines.h

    r221196 r223824  
    865865ALWAYS_INLINE void JIT::linkAllSlowCasesForBytecodeOffset(Vector<SlowCaseEntry>& slowCases, Vector<SlowCaseEntry>::iterator& iter, unsigned bytecodeOffset)
    866866{
    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);
    871869}
    872870
  • trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp

    r223823 r223824  
    9999void JIT::emitSlow_op_new_object(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    100100{
    101     linkSlowCase(iter);
    102     linkSlowCase(iter);
     101    linkAllSlowCases(iter);
     102
    103103    int dst = currentInstruction[1].u.operand;
    104104    Structure* structure = currentInstruction[3].u.objectAllocationProfile->structure();
     
    771771void JIT::emitSlow_op_create_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    772772{
    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);
    779774
    780775    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_create_this);
     
    790785void JIT::emitSlow_op_check_tdz(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    791786{
    792     linkSlowCase(iter);
     787    linkAllSlowCases(iter);
     788
    793789    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_throw_tdz_error);
    794790    slowPathCall.call();
     
    800796void JIT::emitSlow_op_to_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    801797{
    802     linkSlowCase(iter);
    803     linkSlowCase(iter);
    804     linkSlowCase(iter);
    805     linkSlowCase(iter);
     798    linkAllSlowCases(iter);
    806799
    807800    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_this);
     
    811804void JIT::emitSlow_op_to_primitive(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    812805{
    813     linkSlowCase(iter);
     806    linkAllSlowCases(iter);
    814807
    815808    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_primitive);
     
    819812void JIT::emitSlow_op_not(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    820813{
    821     linkSlowCase(iter);
     814    linkAllSlowCases(iter);
    822815   
    823816    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_not);
     
    827820void JIT::emitSlow_op_eq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    828821{
    829     linkSlowCase(iter);
     822    linkAllSlowCases(iter);
     823
    830824    callOperation(operationCompareEq, regT0, regT1);
    831825    emitTagBool(returnValueGPR);
     
    835829void JIT::emitSlow_op_neq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    836830{
    837     linkSlowCase(iter);
     831    linkAllSlowCases(iter);
     832
    838833    callOperation(operationCompareEq, regT0, regT1);
    839834    xor32(TrustedImm32(0x1), regT0);
     
    844839void JIT::emitSlow_op_stricteq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    845840{
    846     linkSlowCase(iter);
    847     linkSlowCase(iter);
    848     linkSlowCase(iter);
     841    linkAllSlowCases(iter);
     842
    849843    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_stricteq);
    850844    slowPathCall.call();
     
    853847void JIT::emitSlow_op_nstricteq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    854848{
    855     linkSlowCase(iter);
    856     linkSlowCase(iter);
    857     linkSlowCase(iter);
     849    linkAllSlowCases(iter);
     850
    858851    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_nstricteq);
    859852    slowPathCall.call();
     
    862855void JIT::emitSlow_op_instanceof(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    863856{
     857    linkAllSlowCases(iter);
     858
    864859    auto& bytecode = *reinterpret_cast<OpInstanceof*>(currentInstruction);
    865860    int dst = bytecode.dst();
     
    867862    int proto = bytecode.prototype();
    868863
    869     linkSlowCaseIfNotJSCell(iter, value);
    870     linkSlowCaseIfNotJSCell(iter, proto);
    871     linkSlowCase(iter);
    872     linkSlowCase(iter);
    873864    emitGetVirtualRegister(value, regT0);
    874865    emitGetVirtualRegister(proto, regT1);
     
    878869void JIT::emitSlow_op_instanceof_custom(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    879870{
     871    linkAllSlowCases(iter);
     872
    880873    auto& bytecode = *reinterpret_cast<OpInstanceofCustom*>(currentInstruction);
    881874    int dst = bytecode.dst();
     
    884877    int hasInstanceValue = bytecode.hasInstanceValue();
    885878
    886     linkSlowCase(iter);
    887879    emitGetVirtualRegister(value, regT0);
    888880    emitGetVirtualRegister(constructor, regT1);
     
    895887void JIT::emitSlow_op_to_number(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    896888{
    897     linkSlowCase(iter);
     889    linkAllSlowCases(iter);
    898890
    899891    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_number);
     
    903895void JIT::emitSlow_op_to_string(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    904896{
    905     linkSlowCase(iter); // Not JSCell.
    906     linkSlowCase(iter); // Not JSString.
     897    linkAllSlowCases(iter);
    907898
    908899    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_string);
     
    926917    // Emit the slow path for the JIT optimization check:
    927918    if (canBeOptimized()) {
    928         linkSlowCase(iter);
     919        linkAllSlowCases(iter);
    929920
    930921        copyCalleeSavesFromFrameOrRegisterToEntryFrameCalleeSavesBuffer(vm()->topEntryFrame);
     
    958949void JIT::emitSlow_op_check_traps(Instruction*, Vector<SlowCaseEntry>::iterator& iter)
    959950{
    960     linkSlowCase(iter);
     951    linkAllSlowCases(iter);
     952
    961953    callOperation(operationHandleTraps);
    962954}
     
    11891181void JIT::emitSlow_op_has_indexed_property(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    11901182{
     1183    linkAllSlowCases(iter);
     1184
    11911185    int dst = currentInstruction[1].u.operand;
    11921186    int base = currentInstruction[2].u.operand;
    11931187    int property = currentInstruction[3].u.operand;
    11941188    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
    12011190    Label slowPath = label();
    12021191   
     
    12521241void JIT::emitSlow_op_get_direct_pname(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    12531242{
    1254     int base = currentInstruction[2].u.operand;
    1255     linkSlowCaseIfNotJSCell(iter, base);
    1256     linkSlowCase(iter);
     1243    linkAllSlowCases(iter);
    12571244
    12581245    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_get_direct_pname);
     
    13991386void JIT::emitSlow_op_has_structure_property(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    14001387{
    1401     linkSlowCase(iter);
    1402     linkSlowCase(iter);
     1388    linkAllSlowCases(iter);
    14031389
    14041390    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_has_structure_property);
  • trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp

    r223823 r223824  
    9898void JIT::emitSlow_op_new_object(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    9999{
    100     linkSlowCase(iter);
    101     linkSlowCase(iter);
     100    linkAllSlowCases(iter);
     101
    102102    int dst = currentInstruction[1].u.operand;
    103103    Structure* structure = currentInstruction[3].u.objectAllocationProfile->structure();
     
    189189void JIT::emitSlow_op_instanceof(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    190190{
     191    linkAllSlowCases(iter);
     192
    191193    auto& bytecode = *reinterpret_cast<OpInstanceof*>(currentInstruction);
    192194    int dst = bytecode.dst();
     
    194196    int proto = bytecode.prototype();
    195197
    196     linkSlowCaseIfNotJSCell(iter, value);
    197     linkSlowCaseIfNotJSCell(iter, proto);
    198     linkSlowCase(iter);
    199     linkSlowCase(iter);
    200 
    201198    emitLoad(value, regT1, regT0);
    202199    emitLoad(proto, regT3, regT2);
     
    206203void JIT::emitSlow_op_instanceof_custom(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    207204{
     205    linkAllSlowCases(iter);
     206
    208207    auto& bytecode = *reinterpret_cast<OpInstanceofCustom*>(currentInstruction);
    209208    int dst = bytecode.dst();
     
    212211    int hasInstanceValue = bytecode.hasInstanceValue();
    213212
    214     linkSlowCase(iter);
    215 
    216213    emitLoad(value, regT1, regT0);
    217214    emitLoadPayload(constructor, regT2);
     
    334331void JIT::emitSlow_op_to_primitive(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    335332{
    336     linkSlowCase(iter);
     333    linkAllSlowCases(iter);
    337334
    338335    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_primitive);
     
    365362void JIT::emitSlow_op_not(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    366363{
    367     linkSlowCase(iter);
     364    linkAllSlowCases(iter);
    368365
    369366    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_not);
     
    591588void JIT::emitSlow_op_stricteq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    592589{
    593     linkSlowCase(iter);
    594     linkSlowCase(iter);
    595     linkSlowCase(iter);
     590    linkAllSlowCases(iter);
    596591
    597592    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_stricteq);
     
    606601void JIT::emitSlow_op_nstricteq(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    607602{
    608     linkSlowCase(iter);
    609     linkSlowCase(iter);
    610     linkSlowCase(iter);
     603    linkAllSlowCases(iter);
    611604
    612605    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_nstricteq);
     
    703696void JIT::emitSlow_op_to_number(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    704697{
    705     linkSlowCase(iter);
     698    linkAllSlowCases(iter);
    706699
    707700    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_number);
     
    725718void JIT::emitSlow_op_to_string(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    726719{
    727     linkSlowCase(iter); // Not JSCell.
    728     linkSlowCase(iter); // Not JSString.
     720    linkAllSlowCases(iter);
    729721
    730722    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_string);
     
    913905void JIT::emitSlow_op_create_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    914906{
    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);
    921908
    922909    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_create_this);
     
    940927void JIT::emitSlow_op_to_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    941928{
    942     linkSlowCase(iter);
    943     linkSlowCase(iter);
    944     linkSlowCase(iter);
     929    linkAllSlowCases(iter);
     930
    945931    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_to_this);
    946932    slowPathCall.call();
     
    955941void JIT::emitSlow_op_check_tdz(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    956942{
    957     linkSlowCase(iter);
     943    linkAllSlowCases(iter);
     944
    958945    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_throw_tdz_error);
    959946    slowPathCall.call();
     
    10511038void JIT::emitSlow_op_has_indexed_property(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    10521039{
     1040    linkAllSlowCases(iter);
     1041
    10531042    int dst = currentInstruction[1].u.operand;
    10541043    int base = currentInstruction[2].u.operand;
    10551044    int property = currentInstruction[3].u.operand;
    10561045    ByValInfo* byValInfo = m_byValCompilationInfo[m_byValInstructionIndex].byValInfo;
    1057    
    1058     linkSlowCaseIfNotJSCell(iter, base); // base cell check
    1059     linkSlowCase(iter); // base array check
    1060     linkSlowCase(iter); // vector length check
    1061     linkSlowCase(iter); // empty value
    10621046
    10631047    Label slowPath = label();
     
    11141098void JIT::emitSlow_op_get_direct_pname(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    11151099{
    1116     int base = currentInstruction[2].u.operand;
    1117     linkSlowCaseIfNotJSCell(iter, base);
    1118     linkSlowCase(iter);
     1100    linkAllSlowCases(iter);
    11191101
    11201102    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_get_direct_pname);
  • trunk/Source/JavaScriptCore/jit/JITPropertyAccess.cpp

    r223823 r223824  
    590590void JIT::emitSlow_op_try_get_by_id(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    591591{
     592    linkAllSlowCases(iter);
     593
    592594    int resultVReg = currentInstruction[1].u.operand;
    593     int baseVReg = currentInstruction[2].u.operand;
    594595    const Identifier* ident = &(m_codeBlock->identifier(currentInstruction[3].u.operand));
    595 
    596     linkSlowCaseIfNotJSCell(iter, baseVReg);
    597     linkSlowCase(iter);
    598596
    599597    JITGetByIdGenerator& gen = m_getByIds[m_getByIdIndex++];
     
    655653void JIT::emitSlow_op_get_by_id(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    656654{
     655    linkAllSlowCases(iter);
     656
    657657    int resultVReg = currentInstruction[1].u.operand;
    658     int baseVReg = currentInstruction[2].u.operand;
    659658    const Identifier* ident = &(m_codeBlock->identifier(currentInstruction[3].u.operand));
    660659
    661     linkSlowCaseIfNotJSCell(iter, baseVReg);
    662     linkSlowCase(iter);
    663 
    664660    JITGetByIdGenerator& gen = m_getByIds[m_getByIdIndex++];
    665661   
     
    673669void JIT::emitSlow_op_get_by_id_with_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    674670{
     671    linkAllSlowCases(iter);
     672
    675673    int resultVReg = currentInstruction[1].u.operand;
    676     int baseVReg = currentInstruction[2].u.operand;
    677     int thisVReg = currentInstruction[3].u.operand;
    678674    const Identifier* ident = &(m_codeBlock->identifier(currentInstruction[4].u.operand));
    679 
    680     linkSlowCaseIfNotJSCell(iter, baseVReg);
    681     linkSlowCaseIfNotJSCell(iter, thisVReg);
    682     linkSlowCase(iter);
    683675
    684676    JITGetByIdWithThisGenerator& gen = m_getByIdsWithThis[m_getByIdWithThisIndex++];
     
    720712void JIT::emitSlow_op_put_by_id(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    721713{
    722     int baseVReg = currentInstruction[1].u.operand;
     714    linkAllSlowCases(iter);
     715
    723716    const Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand));
    724 
    725     linkSlowCaseIfNotJSCell(iter, baseVReg);
    726     linkSlowCase(iter);
    727717
    728718    Label coldPathBegin(this);
     
    831821void JIT::emitSlow_op_resolve_scope(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    832822{
    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
    843825    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_resolve_scope);
    844826    slowPathCall.call();
     
    970952void JIT::emitSlow_op_get_from_scope(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    971953{
     954    linkAllSlowCases(iter);
     955
    972956    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 structure
    980 
    981     if (resolveType == GlobalLexicalVarWithVarInjectionChecks) // Var injections check.
    982         linkSlowCase(iter);
    983 
    984     if (resolveType == UnresolvedProperty || resolveType == UnresolvedPropertyWithVarInjectionChecks) {
    985         // GlobalProperty/GlobalPropertyWithVarInjectionChecks
    986         linkSlowCase(iter); // emitLoadWithStructureCheck
    987         linkSlowCase(iter); // emitLoadWithStructureCheck
    988         // GlobalLexicalVar
    989         linkSlowCase(iter); // TDZ check.
    990         // GlobalLexicalVarWithVarInjectionChecks.
    991         linkSlowCase(iter); // var injection check.
    992         linkSlowCase(iter); // TDZ check.
    993     }
    994 
    995     linkSlowCase(iter);
    996 
    997957    callOperation(WithProfile, operationGetFromScope, dst, currentInstruction);
    998958}
     
    11231083void JIT::emitSlow_op_put_to_scope(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    11241084{
     1085    linkAllSlowCases(iter);
     1086
    11251087    GetPutInfo getPutInfo = GetPutInfo(copiedInstruction(currentInstruction)[4].u.operand);
    11261088    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 == GlobalVarWithVarInjectionChecks
    1131         || resolveType == GlobalLexicalVar || resolveType == GlobalLexicalVarWithVarInjectionChecks
    1132         || resolveType == ClosureVar || resolveType == ClosureVarWithVarInjectionChecks
    1133         || resolveType == LocalClosureVar)
    1134         linkCount++;
    1135     if (resolveType == GlobalProperty || resolveType == GlobalPropertyWithVarInjectionChecks)
    1136         linkCount++; // bad structure
    1137     if (!isInitialization(getPutInfo.initializationMode()) && (resolveType == GlobalLexicalVar || resolveType == GlobalLexicalVarWithVarInjectionChecks)) // TDZ check.
    1138         linkCount++;
    1139     if (resolveType == UnresolvedProperty || resolveType == UnresolvedPropertyWithVarInjectionChecks) {
    1140         // GlobalProperty/GlobalPropertyWithVarInjectionsCheck
    1141         linkCount++; // emitLoadWithStructureCheck
    1142         linkCount++; // emitLoadWithStructureCheck
    1143 
    1144         // GlobalLexicalVar
    1145         bool needsTDZCheck = !isInitialization(getPutInfo.initializationMode());
    1146         if (needsTDZCheck)
    1147             linkCount++;
    1148         linkCount++; // Notify write check.
    1149 
    1150         // GlobalLexicalVarWithVarInjectionsCheck
    1151         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 
    11611089    if (resolveType == ModuleVar) {
    11621090        JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_throw_strict_mode_readonly_property_write_error);
  • trunk/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp

    r223823 r223824  
    606606void JIT::emitSlow_op_try_get_by_id(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    607607{
     608    linkAllSlowCases(iter);
     609
    608610    int resultVReg = currentInstruction[1].u.operand;
    609     int baseVReg = currentInstruction[2].u.operand;
    610611    const Identifier* ident = &(m_codeBlock->identifier(currentInstruction[3].u.operand));
    611 
    612     linkSlowCaseIfNotJSCell(iter, baseVReg);
    613     linkSlowCase(iter);
    614612
    615613    JITGetByIdGenerator& gen = m_getByIds[m_getByIdIndex++];
     
    648646void JIT::emitSlow_op_get_by_id(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    649647{
     648    linkAllSlowCases(iter);
     649
    650650    int resultVReg = currentInstruction[1].u.operand;
    651     int baseVReg = currentInstruction[2].u.operand;
    652651    const Identifier* ident = &(m_codeBlock->identifier(currentInstruction[3].u.operand));
    653 
    654     linkSlowCaseIfNotJSCell(iter, baseVReg);
    655     linkSlowCase(iter);
    656652
    657653    JITGetByIdGenerator& gen = m_getByIds[m_getByIdIndex++];
     
    689685void JIT::emitSlow_op_get_by_id_with_this(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    690686{
     687    linkAllSlowCases(iter);
     688
    691689    int resultVReg = currentInstruction[1].u.operand;
    692     int baseVReg = currentInstruction[2].u.operand;
    693     int thisVReg = currentInstruction[3].u.operand;
    694690    const Identifier* ident = &(m_codeBlock->identifier(currentInstruction[4].u.operand));
    695 
    696     linkSlowCaseIfNotJSCell(iter, baseVReg);
    697     linkSlowCaseIfNotJSCell(iter, thisVReg);
    698     linkSlowCase(iter);
    699691
    700692    JITGetByIdWithThisGenerator& gen = m_getByIdsWithThis[m_getByIdWithThisIndex++];
     
    736728void JIT::emitSlow_op_put_by_id(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    737729{
     730    linkAllSlowCases(iter);
     731
    738732    int base = currentInstruction[1].u.operand;
    739733    const Identifier* ident = &(m_codeBlock->identifier(currentInstruction[2].u.operand));
    740734
    741     linkSlowCaseIfNotJSCell(iter, base);
    742     linkSlowCase(iter);
    743    
    744735    Label coldPathBegin(this);
    745736
     
    851842void JIT::emitSlow_op_resolve_scope(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    852843{
    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
    863846    JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_resolve_scope);
    864847    slowPathCall.call();
     
    991974void JIT::emitSlow_op_get_from_scope(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    992975{
     976    linkAllSlowCases(iter);
     977
    993978    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/GlobalPropertyWithVarInjectionChecks
    1004         linkSlowCase(iter); // emitLoadWithStructureCheck
    1005         // GlobalLexicalVar
    1006         linkSlowCase(iter); // TDZ check.
    1007         // GlobalLexicalVarWithVarInjectionChecks.
    1008         linkSlowCase(iter); // var injection check.
    1009         linkSlowCase(iter); // TDZ check.
    1010     }
    1011 
    1012     linkSlowCase(iter);
    1013979    callOperation(WithProfile, operationGetFromScope, dst, currentInstruction);
    1014980}
     
    11431109void JIT::emitSlow_op_put_to_scope(Instruction* currentInstruction, Vector<SlowCaseEntry>::iterator& iter)
    11441110{
     1111    linkAllSlowCases(iter);
     1112
    11451113    GetPutInfo getPutInfo = GetPutInfo(currentInstruction[4].u.operand);
    11461114    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 == GlobalVarWithVarInjectionChecks
    1151         || resolveType == GlobalLexicalVar || resolveType == GlobalLexicalVarWithVarInjectionChecks
    1152         || resolveType == ClosureVar || resolveType == ClosureVarWithVarInjectionChecks
    1153         || 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/GlobalPropertyWithVarInjectionsCheck
    1159         linkCount++; // emitLoadWithStructureCheck
    1160 
    1161         // GlobalLexicalVar
    1162         bool needsTDZCheck = !isInitialization(getPutInfo.initializationMode());
    1163         if (needsTDZCheck)
    1164             linkCount++;
    1165         linkCount++; // Notify write check.
    1166 
    1167         // GlobalLexicalVarWithVarInjectionsCheck
    1168         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 
    11781115    if (resolveType == ModuleVar) {
    11791116        JITSlowPathCall slowPathCall(this, currentInstruction, slow_path_throw_strict_mode_readonly_property_write_error);
Note: See TracChangeset for help on using the changeset viewer.