Changeset 232048 in webkit


Ignore:
Timestamp:
May 21, 2018 10:46:27 PM (6 years ago)
Author:
Yusuke Suzuki
Message:

[JSC] Remove duplicate methods in JSInterfaceJIT
https://bugs.webkit.org/show_bug.cgi?id=185813

Reviewed by Saam Barati.

Some methods of JSInterfaceJIT are duplicate with AssemblyHelpers' ones.
This patch removes these ones and use AssemblyHelpers' ones instead.

This patch also a bit cleans up ThunkGenerators' unnecessary ifdefs.

  • jit/AssemblyHelpers.h:

(JSC::AssemblyHelpers::tagFor):
(JSC::AssemblyHelpers::payloadFor):

  • jit/JIT.h:
  • jit/JITArithmetic.cpp:

(JSC::JIT::emit_op_unsigned):
(JSC::JIT::emit_compareUnsigned):
(JSC::JIT::emit_op_inc):
(JSC::JIT::emit_op_dec):
(JSC::JIT::emit_op_mod):

  • jit/JITCall32_64.cpp:

(JSC::JIT::compileOpCall):

  • jit/JITInlines.h:

(JSC::JIT::emitPutIntToCallFrameHeader):
(JSC::JIT::updateTopCallFrame):
(JSC::JIT::emitInitRegister):
(JSC::JIT::emitLoad):
(JSC::JIT::emitStore):
(JSC::JIT::emitStoreInt32):
(JSC::JIT::emitStoreCell):
(JSC::JIT::emitStoreBool):
(JSC::JIT::emitGetVirtualRegister):
(JSC::JIT::emitPutVirtualRegister):
(JSC::JIT::emitTagBool): Deleted.

  • jit/JITOpcodes.cpp:

(JSC::JIT::emit_op_overrides_has_instance):
(JSC::JIT::emit_op_is_empty):
(JSC::JIT::emit_op_is_undefined):
(JSC::JIT::emit_op_is_boolean):
(JSC::JIT::emit_op_is_number):
(JSC::JIT::emit_op_is_cell_with_type):
(JSC::JIT::emit_op_is_object):
(JSC::JIT::emit_op_eq):
(JSC::JIT::emit_op_neq):
(JSC::JIT::compileOpStrictEq):
(JSC::JIT::emit_op_eq_null):
(JSC::JIT::emit_op_neq_null):
(JSC::JIT::emitSlow_op_eq):
(JSC::JIT::emitSlow_op_neq):
(JSC::JIT::emitSlow_op_instanceof_custom):
(JSC::JIT::emitNewFuncExprCommon):

  • jit/JSInterfaceJIT.h:

(JSC::JSInterfaceJIT::emitLoadInt32):
(JSC::JSInterfaceJIT::emitLoadDouble):
(JSC::JSInterfaceJIT::emitPutToCallFrameHeader):
(JSC::JSInterfaceJIT::emitPutCellToCallFrameHeader):
(JSC::JSInterfaceJIT::tagFor): Deleted.
(JSC::JSInterfaceJIT::payloadFor): Deleted.
(JSC::JSInterfaceJIT::intPayloadFor): Deleted.
(JSC::JSInterfaceJIT::intTagFor): Deleted.
(JSC::JSInterfaceJIT::emitTagInt): Deleted.
(JSC::JSInterfaceJIT::addressFor): Deleted.

  • jit/SpecializedThunkJIT.h:

(JSC::SpecializedThunkJIT::returnDouble):

  • jit/ThunkGenerators.cpp:

(JSC::nativeForGenerator):
(JSC::arityFixupGenerator):

Location:
trunk/Source/JavaScriptCore
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r232047 r232048  
     12018-05-21  Yusuke Suzuki  <utatane.tea@gmail.com>
     2
     3        [JSC] Remove duplicate methods in JSInterfaceJIT
     4        https://bugs.webkit.org/show_bug.cgi?id=185813
     5
     6        Reviewed by Saam Barati.
     7
     8        Some methods of JSInterfaceJIT are duplicate with AssemblyHelpers' ones.
     9        This patch removes these ones and use AssemblyHelpers' ones instead.
     10
     11        This patch also a bit cleans up ThunkGenerators' unnecessary ifdefs.
     12
     13        * jit/AssemblyHelpers.h:
     14        (JSC::AssemblyHelpers::tagFor):
     15        (JSC::AssemblyHelpers::payloadFor):
     16        * jit/JIT.h:
     17        * jit/JITArithmetic.cpp:
     18        (JSC::JIT::emit_op_unsigned):
     19        (JSC::JIT::emit_compareUnsigned):
     20        (JSC::JIT::emit_op_inc):
     21        (JSC::JIT::emit_op_dec):
     22        (JSC::JIT::emit_op_mod):
     23        * jit/JITCall32_64.cpp:
     24        (JSC::JIT::compileOpCall):
     25        * jit/JITInlines.h:
     26        (JSC::JIT::emitPutIntToCallFrameHeader):
     27        (JSC::JIT::updateTopCallFrame):
     28        (JSC::JIT::emitInitRegister):
     29        (JSC::JIT::emitLoad):
     30        (JSC::JIT::emitStore):
     31        (JSC::JIT::emitStoreInt32):
     32        (JSC::JIT::emitStoreCell):
     33        (JSC::JIT::emitStoreBool):
     34        (JSC::JIT::emitGetVirtualRegister):
     35        (JSC::JIT::emitPutVirtualRegister):
     36        (JSC::JIT::emitTagBool): Deleted.
     37        * jit/JITOpcodes.cpp:
     38        (JSC::JIT::emit_op_overrides_has_instance):
     39        (JSC::JIT::emit_op_is_empty):
     40        (JSC::JIT::emit_op_is_undefined):
     41        (JSC::JIT::emit_op_is_boolean):
     42        (JSC::JIT::emit_op_is_number):
     43        (JSC::JIT::emit_op_is_cell_with_type):
     44        (JSC::JIT::emit_op_is_object):
     45        (JSC::JIT::emit_op_eq):
     46        (JSC::JIT::emit_op_neq):
     47        (JSC::JIT::compileOpStrictEq):
     48        (JSC::JIT::emit_op_eq_null):
     49        (JSC::JIT::emit_op_neq_null):
     50        (JSC::JIT::emitSlow_op_eq):
     51        (JSC::JIT::emitSlow_op_neq):
     52        (JSC::JIT::emitSlow_op_instanceof_custom):
     53        (JSC::JIT::emitNewFuncExprCommon):
     54        * jit/JSInterfaceJIT.h:
     55        (JSC::JSInterfaceJIT::emitLoadInt32):
     56        (JSC::JSInterfaceJIT::emitLoadDouble):
     57        (JSC::JSInterfaceJIT::emitPutToCallFrameHeader):
     58        (JSC::JSInterfaceJIT::emitPutCellToCallFrameHeader):
     59        (JSC::JSInterfaceJIT::tagFor): Deleted.
     60        (JSC::JSInterfaceJIT::payloadFor): Deleted.
     61        (JSC::JSInterfaceJIT::intPayloadFor): Deleted.
     62        (JSC::JSInterfaceJIT::intTagFor): Deleted.
     63        (JSC::JSInterfaceJIT::emitTagInt): Deleted.
     64        (JSC::JSInterfaceJIT::addressFor): Deleted.
     65        * jit/SpecializedThunkJIT.h:
     66        (JSC::SpecializedThunkJIT::returnDouble):
     67        * jit/ThunkGenerators.cpp:
     68        (JSC::nativeForGenerator):
     69        (JSC::arityFixupGenerator):
     70
    1712018-05-21  Yusuke Suzuki  <utatane.tea@gmail.com>
    272
  • trunk/Source/JavaScriptCore/jit/AssemblyHelpers.h

    r232047 r232048  
    10921092    }
    10931093
     1094    static Address tagFor(VirtualRegister virtualRegister, GPRReg baseGPR)
     1095    {
     1096        ASSERT(virtualRegister.isValid());
     1097        return Address(baseGPR, virtualRegister.offset() * sizeof(Register) + TagOffset);
     1098    }
    10941099    static Address tagFor(VirtualRegister virtualRegister)
    10951100    {
     
    11021107    }
    11031108
     1109    static Address payloadFor(VirtualRegister virtualRegister, GPRReg baseGPR)
     1110    {
     1111        ASSERT(virtualRegister.isValid());
     1112        return Address(baseGPR, virtualRegister.offset() * sizeof(Register) + PayloadOffset);
     1113    }
    11041114    static Address payloadFor(VirtualRegister virtualRegister)
    11051115    {
  • trunk/Source/JavaScriptCore/jit/JIT.h

    r232047 r232048  
    449449        void emitJumpSlowCaseIfNotNumber(RegisterID);
    450450        void emitJumpSlowCaseIfNotInt(RegisterID, RegisterID, RegisterID scratch);
    451 
    452         void emitTagBool(RegisterID);
    453451
    454452        void compileGetByIdHotPath(int baseVReg, const Identifier*);
  • trunk/Source/JavaScriptCore/jit/JITArithmetic.cpp

    r231905 r232048  
    242242    emitJumpSlowCaseIfNotInt(regT0);
    243243    addSlowCase(branch32(LessThan, regT0, TrustedImm32(0)));
    244     emitTagInt(regT0, regT0);
     244    boxInt32(regT0, JSValueRegs { regT0 });
    245245    emitPutVirtualRegister(result, regT0);
    246246}
     
    323323        compare32(condition, regT0, regT1, regT0);
    324324    }
    325     emitTagBool(regT0);
     325    boxBoolean(regT0, JSValueRegs { regT0 });
    326326    emitPutVirtualRegister(dst);
    327327}
     
    435435    emitJumpSlowCaseIfNotInt(regT0);
    436436    addSlowCase(branchAdd32(Overflow, TrustedImm32(1), regT0));
    437     emitTagInt(regT0, regT0);
     437    boxInt32(regT0, JSValueRegs { regT0 });
    438438    emitPutVirtualRegister(srcDst);
    439439}
     
    446446    emitJumpSlowCaseIfNotInt(regT0);
    447447    addSlowCase(branchSub32(Overflow, TrustedImm32(1), regT0));
    448     emitTagInt(regT0, regT0);
     448    boxInt32(regT0, JSValueRegs { regT0 });
    449449    emitPutVirtualRegister(srcDst);
    450450}
     
    481481    addSlowCase(branchTest32(Zero, edx));
    482482    numeratorPositive.link(this);
    483     emitTagInt(edx, regT0);
     483    boxInt32(edx, JSValueRegs { regT0 });
    484484    emitPutVirtualRegister(result);
    485485}
  • trunk/Source/JavaScriptCore/jit/JITCall32_64.cpp

    r231905 r232048  
    262262   
    263263    uint32_t locationBits = CallSiteIndex(instruction).bits();
    264     store32(TrustedImm32(locationBits), tagFor(CallFrameSlot::argumentCount, callFrameRegister));
     264    store32(TrustedImm32(locationBits), tagFor(CallFrameSlot::argumentCount));
    265265    emitLoad(callee, regT1, regT0); // regT1, regT0 holds callee.
    266266
  • trunk/Source/JavaScriptCore/jit/JITInlines.h

    r231905 r232048  
    9191{
    9292#if USE(JSVALUE32_64)
    93     store32(TrustedImm32(Int32Tag), intTagFor(entry, callFrameRegister));
    94     store32(from, intPayloadFor(entry, callFrameRegister));
     93    store32(TrustedImm32(JSValue::Int32Tag), tagFor(entry));
     94    store32(from, payloadFor(entry));
    9595#else
    96     store64(from, addressFor(entry, callFrameRegister));
     96    store64(from, addressFor(entry));
    9797#endif
    9898}
     
    142142    uint32_t locationBits = CallSiteIndex(m_bytecodeOffset).bits();
    143143#endif
    144     store32(TrustedImm32(locationBits), intTagFor(CallFrameSlot::argumentCount));
     144    store32(TrustedImm32(locationBits), tagFor(CallFrameSlot::argumentCount));
    145145   
    146146    // FIXME: It's not clear that this is needed. JITOperations tend to update the top call frame on
     
    397397}
    398398
     399ALWAYS_INLINE void JIT::emitInitRegister(int dst)
     400{
     401    storeTrustedValue(jsUndefined(), addressFor(dst));
     402}
     403
    399404#if USE(JSVALUE32_64)
    400405
     
    446451    }
    447452
     453    VirtualRegister target { index };
    448454    if (payload == base) { // avoid stomping base
    449         load32(tagFor(index, base), tag);
    450         load32(payloadFor(index, base), payload);
     455        load32(tagFor(target, base), tag);
     456        load32(payloadFor(target, base), payload);
    451457        return;
    452458    }
    453459
    454     load32(payloadFor(index, base), payload);
    455     load32(tagFor(index, base), tag);
     460    load32(payloadFor(target, base), payload);
     461    load32(tagFor(target, base), tag);
    456462}
    457463
     
    483489inline void JIT::emitStore(int index, RegisterID tag, RegisterID payload, RegisterID base)
    484490{
    485     store32(payload, payloadFor(index, base));
    486     store32(tag, tagFor(index, base));
     491    VirtualRegister target { index };
     492    store32(payload, payloadFor(target, base));
     493    store32(tag, tagFor(target, base));
    487494}
    488495
    489496inline void JIT::emitStoreInt32(int index, RegisterID payload, bool indexIsInt32)
    490497{
    491     store32(payload, payloadFor(index, callFrameRegister));
     498    store32(payload, payloadFor(index));
    492499    if (!indexIsInt32)
    493         store32(TrustedImm32(JSValue::Int32Tag), tagFor(index, callFrameRegister));
     500        store32(TrustedImm32(JSValue::Int32Tag), tagFor(index));
    494501}
    495502
    496503inline void JIT::emitStoreInt32(int index, TrustedImm32 payload, bool indexIsInt32)
    497504{
    498     store32(payload, payloadFor(index, callFrameRegister));
     505    store32(payload, payloadFor(index));
    499506    if (!indexIsInt32)
    500         store32(TrustedImm32(JSValue::Int32Tag), tagFor(index, callFrameRegister));
     507        store32(TrustedImm32(JSValue::Int32Tag), tagFor(index));
    501508}
    502509
    503510inline void JIT::emitStoreCell(int index, RegisterID payload, bool indexIsCell)
    504511{
    505     store32(payload, payloadFor(index, callFrameRegister));
     512    store32(payload, payloadFor(index));
    506513    if (!indexIsCell)
    507         store32(TrustedImm32(JSValue::CellTag), tagFor(index, callFrameRegister));
     514        store32(TrustedImm32(JSValue::CellTag), tagFor(index));
    508515}
    509516
    510517inline void JIT::emitStoreBool(int index, RegisterID payload, bool indexIsBool)
    511518{
    512     store32(payload, payloadFor(index, callFrameRegister));
     519    store32(payload, payloadFor(index));
    513520    if (!indexIsBool)
    514         store32(TrustedImm32(JSValue::BooleanTag), tagFor(index, callFrameRegister));
     521        store32(TrustedImm32(JSValue::BooleanTag), tagFor(index));
    515522}
    516523
     
    522529inline void JIT::emitStore(int index, const JSValue constant, RegisterID base)
    523530{
    524     store32(Imm32(constant.payload()), payloadFor(index, base));
    525     store32(Imm32(constant.tag()), tagFor(index, base));
    526 }
    527 
    528 ALWAYS_INLINE void JIT::emitInitRegister(int dst)
    529 {
    530     emitStore(dst, jsUndefined());
     531    VirtualRegister target { index };
     532    store32(Imm32(constant.payload()), payloadFor(target, base));
     533    store32(Imm32(constant.tag()), tagFor(target, base));
    531534}
    532535
     
    590593    }
    591594
    592     load64(Address(callFrameRegister, src * sizeof(Register)), dst);
     595    load64(addressFor(src), dst);
    593596}
    594597
     
    621624ALWAYS_INLINE void JIT::emitPutVirtualRegister(int dst, RegisterID from)
    622625{
    623     store64(from, Address(callFrameRegister, dst * sizeof(Register)));
     626    store64(from, addressFor(dst));
    624627}
    625628
     
    632635{
    633636    emitPutVirtualRegister(dst.offset(), from);
    634 }
    635 
    636 ALWAYS_INLINE void JIT::emitInitRegister(int dst)
    637 {
    638     store64(TrustedImm64(JSValue::encode(jsUndefined())), Address(callFrameRegister, dst * sizeof(Register)));
    639637}
    640638
     
    707705}
    708706
    709 ALWAYS_INLINE void JIT::emitTagBool(RegisterID reg)
    710 {
    711     or32(TrustedImm32(static_cast<int32_t>(ValueFalse)), reg);
    712 }
    713 
    714707inline Instruction* JIT::copiedInstruction(Instruction* inst)
    715708{
  • trunk/Source/JavaScriptCore/jit/JITOpcodes.cpp

    r231961 r232048  
    126126    // Check that constructor 'ImplementsDefaultHasInstance' i.e. the object is not a C-API user nor a bound function.
    127127    test8(Zero, Address(regT0, JSCell::typeInfoFlagsOffset()), TrustedImm32(ImplementsDefaultHasInstance), regT0);
    128     emitTagBool(regT0);
     128    boxBoolean(regT0, JSValueRegs { regT0 });
    129129    Jump done = jump();
    130130
     
    192192    compare64(Equal, regT0, TrustedImm32(JSValue::encode(JSValue())), regT0);
    193193
    194     emitTagBool(regT0);
     194    boxBoolean(regT0, JSValueRegs { regT0 });
    195195    emitPutVirtualRegister(dst);
    196196}
     
    220220    notMasqueradesAsUndefined.link(this);
    221221    done.link(this);
    222     emitTagBool(regT0);
     222    boxBoolean(regT0, JSValueRegs { regT0 });
    223223    emitPutVirtualRegister(dst);
    224224}
     
    232232    xor64(TrustedImm32(static_cast<int32_t>(ValueFalse)), regT0);
    233233    test64(Zero, regT0, TrustedImm32(static_cast<int32_t>(~1)), regT0);
    234     emitTagBool(regT0);
     234    boxBoolean(regT0, JSValueRegs { regT0 });
    235235    emitPutVirtualRegister(dst);
    236236}
     
    243243    emitGetVirtualRegister(value, regT0);
    244244    test64(NonZero, regT0, tagTypeNumberRegister, regT0);
    245     emitTagBool(regT0);
     245    boxBoolean(regT0, JSValueRegs { regT0 });
    246246    emitPutVirtualRegister(dst);
    247247}
     
    257257
    258258    compare8(Equal, Address(regT0, JSCell::typeInfoTypeOffset()), TrustedImm32(type), regT0);
    259     emitTagBool(regT0);
     259    boxBoolean(regT0, JSValueRegs { regT0 });
    260260    Jump done = jump();
    261261
     
    276276
    277277    compare8(AboveOrEqual, Address(regT0, JSCell::typeInfoTypeOffset()), TrustedImm32(ObjectType), regT0);
    278     emitTagBool(regT0);
     278    boxBoolean(regT0, JSValueRegs { regT0 });
    279279    Jump done = jump();
    280280
     
    417417    emitJumpSlowCaseIfNotInt(regT0, regT1, regT2);
    418418    compare32(Equal, regT1, regT0, regT0);
    419     emitTagBool(regT0);
     419    boxBoolean(regT0, JSValueRegs { regT0 });
    420420    emitPutVirtualRegister(currentInstruction[1].u.operand);
    421421}
     
    447447    emitJumpSlowCaseIfNotInt(regT0, regT1, regT2);
    448448    compare32(NotEqual, regT1, regT0, regT0);
    449     emitTagBool(regT0);
     449    boxBoolean(regT0, JSValueRegs { regT0 });
    450450
    451451    emitPutVirtualRegister(currentInstruction[1].u.operand);
     
    495495    else
    496496        compare64(NotEqual, regT1, regT0, regT0);
    497     emitTagBool(regT0);
     497    boxBoolean(regT0, JSValueRegs { regT0 });
    498498
    499499    emitPutVirtualRegister(dst);
     
    746746    wasNotMasqueradesAsUndefined.link(this);
    747747
    748     emitTagBool(regT0);
     748    boxBoolean(regT0, JSValueRegs { regT0 });
    749749    emitPutVirtualRegister(dst);
    750750
     
    778778    wasNotMasqueradesAsUndefined.link(this);
    779779
    780     emitTagBool(regT0);
     780    boxBoolean(regT0, JSValueRegs { regT0 });
    781781    emitPutVirtualRegister(dst);
    782782}
     
    870870
    871871    callOperation(operationCompareEq, regT0, regT1);
    872     emitTagBool(returnValueGPR);
     872    boxBoolean(returnValueGPR, JSValueRegs { returnValueGPR });
    873873    emitPutVirtualRegister(currentInstruction[1].u.operand, returnValueGPR);
    874874}
     
    880880    callOperation(operationCompareEq, regT0, regT1);
    881881    xor32(TrustedImm32(0x1), regT0);
    882     emitTagBool(returnValueGPR);
     882    boxBoolean(returnValueGPR, JSValueRegs { returnValueGPR });
    883883    emitPutVirtualRegister(currentInstruction[1].u.operand, returnValueGPR);
    884884}
     
    916916    emitGetVirtualRegister(hasInstanceValue, regT2);
    917917    callOperation(operationInstanceOfCustom, regT0, regT1, regT2);
    918     emitTagBool(returnValueGPR);
     918    boxBoolean(returnValueGPR, JSValueRegs { returnValueGPR });
    919919    emitPutVirtualRegister(dst, returnValueGPR);
    920920}
     
    10421042    emitGetVirtualRegister(currentInstruction[2].u.operand, regT0);
    10431043    notUndefinedScope = branchIfNotUndefined(regT0);
    1044     store64(TrustedImm64(JSValue::encode(jsUndefined())), Address(callFrameRegister, sizeof(Register) * dst));
    10451044#else
    10461045    emitLoadPayload(currentInstruction[2].u.operand, regT0);
    10471046    notUndefinedScope = branch32(NotEqual, tagFor(currentInstruction[2].u.operand), TrustedImm32(JSValue::UndefinedTag));
    1048     emitStore(dst, jsUndefined());
    10491047#endif
     1048    storeTrustedValue(jsUndefined(), addressFor(dst));
     1049
    10501050    Jump done = jump();
    10511051    notUndefinedScope.link(this);
  • trunk/Source/JavaScriptCore/jit/JSInterfaceJIT.h

    r231905 r232048  
    4545        }
    4646
    47 #if USE(JSVALUE32_64)
    48         static const unsigned Int32Tag = static_cast<unsigned>(JSValue::Int32Tag);
    49 #else
    50         static const unsigned Int32Tag = static_cast<unsigned>(TagTypeNumber >> 32);
    51 #endif
    5247        inline Jump emitLoadJSCell(unsigned virtualRegisterIndex, RegisterID payload);
    5348        inline Jump emitLoadInt32(unsigned virtualRegisterIndex, RegisterID dst);
     
    5651#if USE(JSVALUE32_64)
    5752        inline Jump emitJumpIfNotJSCell(unsigned virtualRegisterIndex);
    58         inline Address tagFor(int index, RegisterID base = callFrameRegister);
    59 #endif
    60 
    61 #if USE(JSVALUE64)
    62         void emitTagInt(RegisterID src, RegisterID dest);
    6353#endif
    6454
     
    6757        void emitPutToCallFrameHeader(void* value, int entry);
    6858        void emitPutCellToCallFrameHeader(RegisterID from, int entry);
    69 
    70         inline Address payloadFor(int index, RegisterID base = callFrameRegister);
    71         inline Address intPayloadFor(int index, RegisterID base = callFrameRegister);
    72         inline Address intTagFor(int index, RegisterID base = callFrameRegister);
    73         inline Address addressFor(int index, RegisterID base = callFrameRegister);
    7459
    7560        VM* vm() const { return m_vm; }
     
    10186        loadPtr(payloadFor(virtualRegisterIndex), dst);
    10287        return branch32(NotEqual, tagFor(static_cast<int>(virtualRegisterIndex)), TrustedImm32(JSValue::Int32Tag));
    103     }
    104    
    105     inline JSInterfaceJIT::Address JSInterfaceJIT::tagFor(int virtualRegisterIndex, RegisterID base)
    106     {
    107         ASSERT(virtualRegisterIndex < FirstConstantRegisterIndex);
    108         return Address(base, (static_cast<unsigned>(virtualRegisterIndex) * sizeof(Register)) + OBJECT_OFFSETOF(JSValue, u.asBits.tag));
    109     }
    110    
    111     inline JSInterfaceJIT::Address JSInterfaceJIT::payloadFor(int virtualRegisterIndex, RegisterID base)
    112     {
    113         ASSERT(virtualRegisterIndex < FirstConstantRegisterIndex);
    114         return Address(base, (static_cast<unsigned>(virtualRegisterIndex) * sizeof(Register)) + OBJECT_OFFSETOF(JSValue, u.asBits.payload));
    115     }
    116 
    117     inline JSInterfaceJIT::Address JSInterfaceJIT::intPayloadFor(int virtualRegisterIndex, RegisterID base)
    118     {
    119         return payloadFor(virtualRegisterIndex, base);
    120     }
    121 
    122     inline JSInterfaceJIT::Address JSInterfaceJIT::intTagFor(int virtualRegisterIndex, RegisterID base)
    123     {
    124         return tagFor(virtualRegisterIndex, base);
    12588    }
    12689
     
    169132        return notNumber;
    170133    }
    171 
    172     // operand is int32_t, must have been zero-extended if register is 64-bit.
    173     ALWAYS_INLINE void JSInterfaceJIT::emitTagInt(RegisterID src, RegisterID dest)
    174     {
    175         if (src != dest)
    176             move(src, dest);
    177         or64(tagTypeNumberRegister, dest);
    178     }
    179 #endif
    180 
    181 #if USE(JSVALUE64)
    182     inline JSInterfaceJIT::Address JSInterfaceJIT::payloadFor(int virtualRegisterIndex, RegisterID base)
    183     {
    184         ASSERT(virtualRegisterIndex < FirstConstantRegisterIndex);
    185         return addressFor(virtualRegisterIndex, base);
    186     }
    187 
    188     inline JSInterfaceJIT::Address JSInterfaceJIT::intPayloadFor(int virtualRegisterIndex, RegisterID base)
    189     {
    190         ASSERT(virtualRegisterIndex < FirstConstantRegisterIndex);
    191         return Address(base, (static_cast<unsigned>(virtualRegisterIndex) * sizeof(Register)) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.payload));
    192     }
    193     inline JSInterfaceJIT::Address JSInterfaceJIT::intTagFor(int virtualRegisterIndex, RegisterID base)
    194     {
    195         ASSERT(virtualRegisterIndex < FirstConstantRegisterIndex);
    196         return Address(base, (static_cast<unsigned>(virtualRegisterIndex) * sizeof(Register)) + OBJECT_OFFSETOF(EncodedValueDescriptor, asBits.tag));
    197     }
    198134#endif
    199135
     
    206142    {
    207143#if USE(JSVALUE32_64)
    208         storePtr(from, payloadFor(entry, callFrameRegister));
     144        storePtr(from, payloadFor(entry));
    209145#else
    210         store64(from, addressFor(entry, callFrameRegister));
     146        store64(from, addressFor(entry));
    211147#endif
    212148    }
     
    214150    ALWAYS_INLINE void JSInterfaceJIT::emitPutToCallFrameHeader(void* value, int entry)
    215151    {
    216         storePtr(TrustedImmPtr(value), Address(callFrameRegister, entry * sizeof(Register)));
     152        storePtr(TrustedImmPtr(value), addressFor(entry));
    217153    }
    218154
     
    220156    {
    221157#if USE(JSVALUE32_64)
    222         store32(TrustedImm32(JSValue::CellTag), tagFor(entry, callFrameRegister));
    223         store32(from, payloadFor(entry, callFrameRegister));
     158        store32(TrustedImm32(JSValue::CellTag), tagFor(entry));
     159        store32(from, payloadFor(entry));
    224160#else
    225         store64(from, addressFor(entry, callFrameRegister));
     161        store64(from, addressFor(entry));
    226162#endif
    227     }
    228 
    229     inline JSInterfaceJIT::Address JSInterfaceJIT::addressFor(int virtualRegisterIndex, RegisterID base)
    230     {
    231         ASSERT(virtualRegisterIndex < FirstConstantRegisterIndex);
    232         return Address(base, (static_cast<unsigned>(virtualRegisterIndex) * sizeof(Register)));
    233163    }
    234164
  • trunk/Source/JavaScriptCore/jit/SpecializedThunkJIT.h

    r230748 r232048  
    136136            Jump highNonZero = branchTestPtr(NonZero, regT0);
    137137            move(TrustedImm32(0), regT0);
    138             move(TrustedImm32(Int32Tag), regT1);
     138            move(TrustedImm32(JSValue::Int32Tag), regT1);
    139139            lowNonZero.link(this);
    140140            highNonZero.link(this);
  • trunk/Source/JavaScriptCore/jit/ThunkGenerators.cpp

    r231905 r232048  
    266266        // We're coming from a specialized thunk that has saved the prior tag registers' contents.
    267267        // Restore them now.
    268 #if CPU(ARM64)
    269268        jit.popPair(JSInterfaceJIT::tagTypeNumberRegister, JSInterfaceJIT::tagMaskRegister);
    270 #else
    271         jit.pop(JSInterfaceJIT::tagMaskRegister);
    272         jit.pop(JSInterfaceJIT::tagTypeNumberRegister);
    273 #endif
    274269#endif
    275270        break;
     
    486481#endif
    487482    jit.move(JSInterfaceJIT::callFrameRegister, JSInterfaceJIT::regT3);
    488     jit.load32(JSInterfaceJIT::Address(JSInterfaceJIT::callFrameRegister, CallFrameSlot::argumentCount * sizeof(Register)), JSInterfaceJIT::argumentGPR2);
     483    jit.load32(JSInterfaceJIT::addressFor(CallFrameSlot::argumentCount), JSInterfaceJIT::argumentGPR2);
    489484    jit.add32(JSInterfaceJIT::TrustedImm32(CallFrame::headerSizeInRegisters), JSInterfaceJIT::argumentGPR2);
    490485
     
    550545#  endif
    551546    jit.move(JSInterfaceJIT::callFrameRegister, JSInterfaceJIT::regT3);
    552     jit.load32(JSInterfaceJIT::Address(JSInterfaceJIT::callFrameRegister, CallFrameSlot::argumentCount * sizeof(Register)), JSInterfaceJIT::argumentGPR2);
     547    jit.load32(JSInterfaceJIT::addressFor(CallFrameSlot::argumentCount), JSInterfaceJIT::argumentGPR2);
    553548    jit.add32(JSInterfaceJIT::TrustedImm32(CallFrame::headerSizeInRegisters), JSInterfaceJIT::argumentGPR2);
    554549
Note: See TracChangeset for help on using the changeset viewer.