⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 283887 in webkit


Ignore:
Timestamp:
Oct 11, 2021, 2:10:40 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

[JSC][32bit] Fix profiling in baseline
​https://bugs.webkit.org/show_bug.cgi?id=231368

Patch by Geza Lore <Geza Lore> on 2021-10-11
Reviewed by Yusuke Suzuki.

Fixes profiling omissions introduced with the recent 32-bit baseline
build fixes, and also brings the rest of profile updates in-line with
the unlinked baseline on 64-bit platforms.

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

(JSC::JIT::emitPutCallResult):
(JSC::JIT::compileSetupFrame):
(JSC::JIT::compileOpCall):
(JSC::JIT::emit_op_iterator_open):
(JSC::JIT::emitSlow_op_iterator_open):
(JSC::JIT::emit_op_iterator_next):
(JSC::JIT::emitSlow_op_iterator_next):

  • jit/JITInlines.h:

(JSC::JIT::emitValueProfilingSiteIfProfiledOpcode):
(JSC::JIT::emitValueProfilingSite):
(JSC::JIT::emitArrayProfilingSiteWithCell):

  • jit/JITOpcodes32_64.cpp:

(JSC::JIT::emit_op_jneq_ptr):
(JSC::JIT::emit_op_to_number):
(JSC::JIT::emit_op_to_numeric):
(JSC::JIT::emit_op_to_object):
(JSC::JIT::emit_op_catch):

  • jit/JITPropertyAccess32_64.cpp:

(JSC::JIT::emit_op_get_by_val):
(JSC::JIT::emitSlow_op_get_by_val):
(JSC::JIT::emit_op_get_private_name):
(JSC::JIT::emitSlow_op_get_private_name):
(JSC::JIT::emit_op_put_by_val):
(JSC::JIT::emit_op_try_get_by_id):
(JSC::JIT::emit_op_get_by_id_direct):
(JSC::JIT::emitSlow_op_get_by_id_direct):
(JSC::JIT::emit_op_get_by_id):
(JSC::JIT::emitSlow_op_get_by_id):
(JSC::JIT::emit_op_get_by_id_with_this):
(JSC::JIT::emitSlow_op_get_by_id_with_this):
(JSC::JIT::emit_op_in_by_val):
(JSC::JIT::emit_op_get_from_scope):
(JSC::JIT::emitSlow_op_get_from_scope):
(JSC::JIT::emit_op_get_from_arguments):
(JSC::JIT::emit_op_get_internal_field):

Location:
trunk/Source/JavaScriptCore
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r283881 r283887  
     12021-10-11  Geza Lore  <glore@igalia.com>
     2
     3        [JSC][32bit] Fix profiling in baseline
     4        https://bugs.webkit.org/show_bug.cgi?id=231368
     5
     6        Reviewed by Yusuke Suzuki.
     7
     8        Fixes profiling omissions introduced with the recent 32-bit baseline
     9        build fixes, and also brings the rest of profile updates in-line with
     10        the unlinked baseline on 64-bit platforms.
     11
     12        * jit/JIT.h:
     13        * jit/JITCall32_64.cpp:
     14        (JSC::JIT::emitPutCallResult):
     15        (JSC::JIT::compileSetupFrame):
     16        (JSC::JIT::compileOpCall):
     17        (JSC::JIT::emit_op_iterator_open):
     18        (JSC::JIT::emitSlow_op_iterator_open):
     19        (JSC::JIT::emit_op_iterator_next):
     20        (JSC::JIT::emitSlow_op_iterator_next):
     21        * jit/JITInlines.h:
     22        (JSC::JIT::emitValueProfilingSiteIfProfiledOpcode):
     23        (JSC::JIT::emitValueProfilingSite):
     24        (JSC::JIT::emitArrayProfilingSiteWithCell):
     25        * jit/JITOpcodes32_64.cpp:
     26        (JSC::JIT::emit_op_jneq_ptr):
     27        (JSC::JIT::emit_op_to_number):
     28        (JSC::JIT::emit_op_to_numeric):
     29        (JSC::JIT::emit_op_to_object):
     30        (JSC::JIT::emit_op_catch):
     31        * jit/JITPropertyAccess32_64.cpp:
     32        (JSC::JIT::emit_op_get_by_val):
     33        (JSC::JIT::emitSlow_op_get_by_val):
     34        (JSC::JIT::emit_op_get_private_name):
     35        (JSC::JIT::emitSlow_op_get_private_name):
     36        (JSC::JIT::emit_op_put_by_val):
     37        (JSC::JIT::emit_op_try_get_by_id):
     38        (JSC::JIT::emit_op_get_by_id_direct):
     39        (JSC::JIT::emitSlow_op_get_by_id_direct):
     40        (JSC::JIT::emit_op_get_by_id):
     41        (JSC::JIT::emitSlow_op_get_by_id):
     42        (JSC::JIT::emit_op_get_by_id_with_this):
     43        (JSC::JIT::emitSlow_op_get_by_id_with_this):
     44        (JSC::JIT::emit_op_in_by_val):
     45        (JSC::JIT::emit_op_get_from_scope):
     46        (JSC::JIT::emitSlow_op_get_from_scope):
     47        (JSC::JIT::emit_op_get_from_arguments):
     48        (JSC::JIT::emit_op_get_internal_field):
     49
    1502021-10-10  Sihui Liu  <sihui_liu@apple.com>
    251
  • trunk/Source/JavaScriptCore/jit/JIT.h

    r283389 r283887  
    344344        void emitWriteBarrier(GPRReg owner);
    345345
    346         // This assumes that the value to profile is in regT0 and that regT3 is available for
    347         // scratch.
     346#if USE(JSVALUE64)
    348347        template<typename Bytecode> void emitValueProfilingSite(const Bytecode&, GPRReg);
     348#endif
    349349        template<typename Bytecode> void emitValueProfilingSite(const Bytecode&, JSValueRegs);
    350 #if USE(JSVALUE32_64)
    351         void emitValueProfilingSite(ValueProfile&, JSValueRegs);
    352         template<typename Metadata>
    353         std::enable_if_t<std::is_same<decltype(Metadata::m_profile), ValueProfile>::value, void>
    354         emitValueProfilingSite(Metadata&, JSValueRegs);
    355 #endif
    356 
     350
     351        // This assumes that the value to profile is in regT0 (regT1/regT0 on JSVALUE32_64).
    357352        void emitValueProfilingSiteIfProfiledOpcode(...);
    358353        template<typename Op>
    … …  
    364359        template <typename Bytecode>
    365360        void emitArrayProfilingSiteWithCell(const Bytecode&, ptrdiff_t, RegisterID cellGPR, RegisterID scratchGPR);
    366 
    367 #if USE(JSVALUE32_64)
    368         void emitArrayProfilingSiteWithCell(RegisterID, ArrayProfile* , RegisterID);
    369         void emitArrayProfilingSiteWithCell(RegisterID, RegisterID , RegisterID);
    370 #endif
    371361
    372362        template<typename Op>
  • trunk/Source/JavaScriptCore/jit/JITCall32_64.cpp

    r283557 r283887  
    5353void JIT::emitPutCallResult(const Op& bytecode)
    5454{
    55     emitValueProfilingSite(bytecode.metadata(m_profiledCodeBlock), JSValueRegs(regT1, regT0));
     55    emitValueProfilingSite(bytecode, JSValueRegs(regT1, regT0));
    5656    emitStore(destinationFor(bytecode, m_bytecodeIndex.checkpoint()).virtualRegister(), regT1, regT0);
    5757}
    … …  
    158158{
    159159    unsigned checkpoint = m_bytecodeIndex.checkpoint();
    160     auto& metadata = bytecode.metadata(m_profiledCodeBlock);
    161160    int argCount = argumentCountIncludingThisFor(bytecode, checkpoint);
    162161    int registerOffset = -static_cast<int>(stackOffsetInRegistersForCall(bytecode, checkpoint));
    … …  
    165164        emitLoad(VirtualRegister(registerOffset + CallFrame::argumentOffsetIncludingThis(0)), regT0, regT1);
    166165        Jump done = branchIfNotCell(regT0);
    167         load32(Address(regT1, JSCell::structureIDOffset()), regT1);
    168         store32(regT1, metadata.m_callLinkInfo.m_arrayProfile.addressOfLastSeenStructureID());
     166        load32(Address(regT1, JSCell::structureIDOffset()), regT0);
     167        store32ToMetadata(regT0, bytecode, OpCall::Metadata::offsetOfCallLinkInfo() + LLIntCallLinkInfo::offsetOfArrayProfile() + ArrayProfile::offsetOfLastSeenStructureID());
    169168        done.link(this);
    170169    }
    … …  
    321320    }
    322321
    323     auto slowPaths = info->emitFastPath(*this, regT0, regT2, CallLinkInfo::UseDataIC::Yes);
     322    auto slowPaths = info->emitFastPath(*this, regT0, regT2, CallLinkInfo::UseDataIC::No);
    324323    addSlowCase(slowPaths);
    325324    m_callCompilationInfo[callLinkInfoIndex].doneLocation = label();
    … …  
    412411    m_getByIds.append(gen);
    413412
    414     emitValueProfilingSite(bytecode.metadata(m_profiledCodeBlock), nextRegs);
     413    emitValueProfilingSite(bytecode, nextRegs);
    415414    emitPutVirtualRegister(bytecode.m_next, nextRegs);
    416415
    … …  
    442441
    443442    Call call = callOperationWithProfile(
    444         bytecode.metadata(m_profiledCodeBlock), // metadata
     443        bytecode,
    445444        operationGetByIdOptimize, // operation
    446445        nextVReg, // result
    … …  
    462461{
    463462    auto bytecode = instruction->as<OpIteratorNext>();
    464     auto& metadata = bytecode.metadata(m_profiledCodeBlock);
    465463    auto* tryFastFunction = ([&] () {
    466464        switch (instruction->width()) {
    … …  
    481479
    482480    genericCase.link(this);
    483     or8(TrustedImm32(static_cast<uint8_t>(IterationMode::Generic)), AbsoluteAddress(&metadata.m_iterationMetadata.seenModes));
     481    load8FromMetadata(bytecode, OpIteratorNext::Metadata::offsetOfIterationMetadata() + IterationModeMetadata::offsetOfSeenModes(), regT0);
     482    or32(TrustedImm32(static_cast<uint8_t>(IterationMode::Generic)), regT0);
     483    store8ToMetadata(regT0, bytecode, OpIteratorNext::Metadata::offsetOfIterationMetadata() + IterationModeMetadata::offsetOfSeenModes());
    484484    compileOpCall<OpIteratorNext>(instruction, m_callLinkInfoIndex++);
    485485    advanceToNextCheckpoint();
    … …  
    522522        m_getByIds.append(gen);
    523523
    524         emitValueProfilingSite(metadata, doneRegs);
     524        emitValueProfilingSite(bytecode, doneRegs);
    525525        emitPutVirtualRegister(bytecode.m_done, doneRegs);
    526526        advanceToNextCheckpoint();
    … …  
    552552        m_getByIds.append(gen);
    553553
    554         emitValueProfilingSite(metadata, resultRegs);
     554        emitValueProfilingSite(bytecode, resultRegs);
    555555        emitPutVirtualRegister(bytecode.m_value, resultRegs);
    556556
    … …  
    590590
    591591        Call call = callOperationWithProfile(
    592             bytecode.metadata(m_profiledCodeBlock), // metadata
     592            bytecode,
    593593            operationGetByIdOptimize, // operation
    594594            doneVReg, // result
    … …  
    620620
    621621        Call call = callOperationWithProfile(
    622             bytecode.metadata(m_profiledCodeBlock), // metadata
     622            bytecode,
    623623            operationGetByIdOptimize, // operation
    624624            valueVReg, // result
  • trunk/Source/JavaScriptCore/jit/JITInlines.h

    r283557 r283887  
    330330}
    331331
    332 #if USE(JSVALUE32_64)
    333 inline void JIT::emitValueProfilingSite(ValueProfile& valueProfile, JSValueRegs value)
     332template<typename Op>
     333inline std::enable_if_t<std::is_same<decltype(Op::Metadata::m_profile), ValueProfile>::value, void> JIT::emitValueProfilingSiteIfProfiledOpcode(Op bytecode)
     334{
     335#if USE(JSVALUE64)
     336    JSValueRegs result { regT0 };
     337#else
     338    JSValueRegs result { regT1, regT0 };
     339#endif
     340    emitValueProfilingSite(bytecode, result);
     341}
     342
     343inline void JIT::emitValueProfilingSiteIfProfiledOpcode(...) { }
     344
     345template<typename Bytecode>
     346inline void JIT::emitValueProfilingSite(const Bytecode& bytecode, JSValueRegs value)
    334347{
    335348    if (!shouldEmitProfiling())
    336349        return;
    337350
    338     EncodedValueDescriptor* descriptor = bitwise_cast<EncodedValueDescriptor*>(valueProfile.m_buckets);
    339     store32(value.payloadGPR(), &descriptor->asBits.payload);
    340     store32(value.tagGPR(), &descriptor->asBits.tag);
    341 }
    342 
    343 template<typename Metadata>
    344 std::enable_if_t<std::is_same<decltype(Metadata::m_profile), ValueProfile>::value, void> JIT::emitValueProfilingSite(Metadata& metadata, JSValueRegs value)
    345 {
    346     emitValueProfilingSite(valueProfileFor(metadata, m_bytecodeIndex.checkpoint()), value);
    347 }
    348 #endif
    349 
    350 template<typename Op>
    351 inline std::enable_if_t<std::is_same<decltype(Op::Metadata::m_profile), ValueProfile>::value, void> JIT::emitValueProfilingSiteIfProfiledOpcode(Op bytecode)
    352 {
     351    ptrdiff_t offset = m_unlinkedCodeBlock->metadata().offsetInMetadataTable(bytecode) + valueProfileOffsetFor<Bytecode>(m_bytecodeIndex.checkpoint()) + ValueProfile::offsetOfFirstBucket();
    353352#if USE(JSVALUE64)
    354     emitValueProfilingSite(bytecode, regT0);
    355 #else
    356     emitValueProfilingSite(bytecode, JSValueRegs(regT1, regT0));
    357 #endif
    358 }
    359 
    360 inline void JIT::emitValueProfilingSiteIfProfiledOpcode(...) { }
    361 
    362 template<typename Bytecode>
    363 inline void JIT::emitValueProfilingSite(const Bytecode& bytecode, JSValueRegs value)
    364 {
    365     if (!shouldEmitProfiling())
    366         return;
    367 
    368 #if USE(JSVALUE64)
    369     ptrdiff_t offset = m_unlinkedCodeBlock->metadata().offsetInMetadataTable(bytecode) + valueProfileOffsetFor<Bytecode>(m_bytecodeIndex.checkpoint()) + ValueProfile::offsetOfFirstBucket();
    370353    store64(value.gpr(), Address(s_metadataGPR, offset));
    371354#else
    372     UNUSED_PARAM(value);
    373     UNUSED_PARAM(bytecode);
    374     // FIXME.
    375 #endif
    376 }
    377 
     355    store32(value.payloadGPR(), Address(s_metadataGPR, offset + PayloadOffset));
     356    store32(value.tagGPR(), Address(s_metadataGPR, offset + TagOffset));
     357#endif
     358}
     359
     360#if USE(JSVALUE64)
    378361template<typename Bytecode>
    379362inline void JIT::emitValueProfilingSite(const Bytecode& bytecode, GPRReg resultReg)
    … …  
    381364    emitValueProfilingSite(bytecode, JSValueRegs(resultReg));
    382365}
     366#endif
    383367
    384368template <typename Bytecode>
    … …  
    386370{
    387371    if (shouldEmitProfiling()) {
    388         load32(MacroAssembler::Address(cellGPR, JSCell::structureIDOffset()), scratchGPR);
     372        load32(Address(cellGPR, JSCell::structureIDOffset()), scratchGPR);
    389373        store32ToMetadata(scratchGPR, bytecode, offsetOfArrayProfile);
    390374    }
    … …  
    396380    emitArrayProfilingSiteWithCell(bytecode, Bytecode::Metadata::offsetOfArrayProfile() + ArrayProfile::offsetOfLastSeenStructureID(), cellGPR, scratchGPR);
    397381}
    398 
    399 #if USE(JSVALUE32_64)
    400 inline void JIT::emitArrayProfilingSiteWithCell(RegisterID cellGPR, ArrayProfile* arrayProfile, RegisterID scratchGPR)
    401 {
    402     if (shouldEmitProfiling()) {
    403         load32(MacroAssembler::Address(cellGPR, JSCell::structureIDOffset()), scratchGPR);
    404         store32(scratchGPR, arrayProfile->addressOfLastSeenStructureID());
    405     }
    406 }
    407 
    408 inline void JIT::emitArrayProfilingSiteWithCell(RegisterID cellGPR, RegisterID arrayProfileGPR, RegisterID scratchGPR)
    409 {
    410     if (shouldEmitProfiling()) {
    411         load32(MacroAssembler::Address(cellGPR, JSCell::structureIDOffset()), scratchGPR);
    412         store32(scratchGPR, Address(arrayProfileGPR, ArrayProfile::offsetOfLastSeenStructureID()));
    413     }
    414 }
    415 #endif
    416382
    417383ALWAYS_INLINE int32_t JIT::getOperandConstantInt(VirtualRegister src)
  • trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp

    r283608 r283887  
    519519{
    520520    auto bytecode = currentInstruction->as<OpJneqPtr>();
    521     auto& metadata = bytecode.metadata(m_profiledCodeBlock);
    522521    VirtualRegister src = bytecode.m_value;
    523522    JSValue specialPointer = getConstantOperand(bytecode.m_specialPointer);
    … …  
    529528    Jump equal = branchPtr(Equal, regT0, TrustedImmPtr(specialPointer.asCell()));
    530529    notCell.link(this);
    531     store8(TrustedImm32(1), &metadata.m_hasJumped);
     530    store8ToMetadata(TrustedImm32(1), bytecode, OpJneqPtr::Metadata::offsetOfHasJumped());
    532531    addJump(jump(), target);
    533532    equal.link(this);
    … …  
    877876    isInt32.link(this);
    878877
    879     emitValueProfilingSite(bytecode.metadata(m_profiledCodeBlock), JSValueRegs(regT1, regT0));
     878    emitValueProfilingSite(bytecode, JSValueRegs(regT1, regT0));
    880879    if (src != dst)
    881880        emitStore(dst, regT1, regT0);
    … …  
    899898    isBigInt.link(this);
    900899
    901     emitValueProfilingSite(bytecode.metadata(m_profiledCodeBlock), JSValueRegs(regT1, regT0));
     900    emitValueProfilingSite(bytecode, JSValueRegs(regT1, regT0));
    902901    if (src != dst)
    903902        emitStore(dst, regT1, regT0);
    … …  
    930929    addSlowCase(branchIfNotObject(regT0));
    931930
    932     emitValueProfilingSite(bytecode.metadata(m_profiledCodeBlock), JSValueRegs(regT1, regT0));
     931    emitValueProfilingSite(bytecode, JSValueRegs(regT1, regT0));
    933932    if (src != dst)
    934933        emitStore(dst, regT1, regT0);
    … …  
    980979    // https://bugs.webkit.org/show_bug.cgi?id=175598
    981980
    982     auto& metadata = bytecode.metadata(m_profiledCodeBlock);
    983     ValueProfileAndVirtualRegisterBuffer* buffer = metadata.m_buffer;
    984     if (buffer || !shouldEmitProfiling())
    985         callOperationNoExceptionCheck(operationTryOSREnterAtCatch, &vm(), m_bytecodeIndex.asBits());
    986     else
    987         callOperationNoExceptionCheck(operationTryOSREnterAtCatchAndValueProfile, &vm(), m_bytecodeIndex.asBits());
     981    callOperationNoExceptionCheck(operationTryOSREnterAtCatchAndValueProfile, &vm(), m_bytecodeIndex.asBits());
    988982    auto skipOSREntry = branchTestPtr(Zero, returnValueGPR);
    989983    emitRestoreCalleeSaves();
    990984    farJump(returnValueGPR, NoPtrTag);
    991985    skipOSREntry.link(this);
    992     if (buffer && shouldEmitProfiling()) {
    993         buffer->forEach([&] (ValueProfileAndVirtualRegister& profile) {
    994             JSValueRegs regs(regT1, regT0);
    995             emitGetVirtualRegister(profile.m_operand, regs);
    996             emitValueProfilingSite(static_cast<ValueProfile&>(profile), regs);
    997         });
    998     }
    999986#endif // ENABLE(DFG_JIT)
    1000987}
  • trunk/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp

    r283389 r283887  
    238238{
    239239    auto bytecode = currentInstruction->as<OpGetByVal>();
    240     auto& metadata = bytecode.metadata(m_profiledCodeBlock);
    241240    VirtualRegister dst = bytecode.m_dst;
    242241    VirtualRegister base = bytecode.m_base;
    243242    VirtualRegister property = bytecode.m_property;
    244     ArrayProfile* profile = &metadata.m_arrayProfile;
    245243
    246244    emitLoad2(base, regT1, regT0, property, regT3, regT2);
    247245
    248     if (metadata.m_seenIdentifiers.count() > Options::getByValICMaxNumberOfIdentifiers()) {
     246    if (bytecode.metadata(m_profiledCodeBlock).m_seenIdentifiers.count() > Options::getByValICMaxNumberOfIdentifiers()) {
    249247        auto notCell = branchIfNotCell(regT1);
    250         emitArrayProfilingSiteWithCell(regT0, profile, regT4);
     248        emitArrayProfilingSiteWithCell(bytecode, regT0, regT4);
    251249        notCell.link(this);
    252         callOperationWithProfile(bytecode.metadata(m_profiledCodeBlock), operationGetByVal, dst, TrustedImmPtr(m_profiledCodeBlock->globalObject()), JSValueRegs(regT1, regT0), JSValueRegs(regT3, regT2));
     250        callOperationWithProfile(bytecode, operationGetByVal, dst, TrustedImmPtr(m_profiledCodeBlock->globalObject()), JSValueRegs(regT1, regT0), JSValueRegs(regT3, regT2));
    253251    } else {
    254252        emitJumpSlowCaseIfNotJSCell(base, regT1);
    255         emitArrayProfilingSiteWithCell(regT0, profile, regT4);
     253        emitArrayProfilingSiteWithCell(bytecode, regT0, regT4);
    256254
    257255        JSValueRegs resultRegs = JSValueRegs(regT1, regT0);
    … …  
    266264        m_getByVals.append(gen);
    267265
    268         emitValueProfilingSite(bytecode.metadata(m_profiledCodeBlock), resultRegs);
     266        emitValueProfilingSite(bytecode, resultRegs);
    269267        emitStore(dst, regT1, regT0);
    270268    }
    … …  
    285283
    286284        Label coldPathBegin = label();
    287         Call call = callOperationWithProfile(bytecode.metadata(m_profiledCodeBlock), operationGetByValOptimize, dst, TrustedImmPtr(m_profiledCodeBlock->globalObject()), gen.stubInfo(), profile, JSValueRegs(regT1, regT0), JSValueRegs(regT3, regT2));
     285        Call call = callOperationWithProfile(bytecode, operationGetByValOptimize, dst, TrustedImmPtr(m_profiledCodeBlock->globalObject()), gen.stubInfo(), profile, JSValueRegs(regT1, regT0), JSValueRegs(regT3, regT2));
    288286        gen.reportSlowPathCall(coldPathBegin, call);
    289287    }
    … …  
    312310    m_getByVals.append(gen);
    313311
    314     emitValueProfilingSite(bytecode.metadata(m_profiledCodeBlock), resultRegs);
     312    emitValueProfilingSite(bytecode, resultRegs);
    315313    emitStore(dst, resultRegs.tagGPR(), resultRegs.payloadGPR());
    316314}
    … …  
    331329    auto baseGPR = JSValueRegs(regT1, regT0);
    332330    auto propertyGPR = JSValueRegs(regT3, regT2);
    333     Call call = callOperationWithProfile(bytecode.metadata(m_profiledCodeBlock), operationGetPrivateNameOptimize, dst, TrustedImmPtr(m_profiledCodeBlock->globalObject()), gen.stubInfo(), baseGPR, propertyGPR);
     331    Call call = callOperationWithProfile(bytecode, operationGetPrivateNameOptimize, dst, TrustedImmPtr(m_profiledCodeBlock->globalObject()), gen.stubInfo(), baseGPR, propertyGPR);
    334332    gen.reportSlowPathCall(coldPathBegin, call);
    335333}
    … …  
    466464{
    467465    auto bytecode = currentInstruction->as<Op>();
    468     auto& metadata = bytecode.metadata(m_profiledCodeBlock);
    469466    VirtualRegister base = bytecode.m_base;
    470467    VirtualRegister property = bytecode.m_property;
    471468    VirtualRegister value = bytecode.m_value;
    472     ArrayProfile* profile = &metadata.m_arrayProfile;
    473469
    474470    emitLoad2(base, regT1, regT0, property, regT3, regT2);
    475471    emitLoad(value, regT5, regT4);
    476     move(TrustedImmPtr(profile), regT6);
     472
    477473    emitJumpSlowCaseIfNotJSCell(base, regT1);
    478     emitArrayProfilingSiteWithCell(regT0, regT6, regT7);
     474    emitArrayProfilingSiteWithCell(bytecode, regT0, regT6);
     475    materializePointerIntoMetadata(bytecode, Op::Metadata::offsetOfArrayProfile(), regT6);
    479476
    480477    JITPutByValGenerator gen(
    … …  
    549546    m_getByIds.append(gen);
    550547   
    551     emitValueProfilingSite(bytecode.metadata(m_profiledCodeBlock), resultRegs);
     548    emitValueProfilingSite(bytecode, resultRegs);
    552549    emitStore(dst, resultRegs.tagGPR(), resultRegs.payloadGPR());
    553550}
    … …  
    590587    m_getByIds.append(gen);
    591588
    592     emitValueProfilingSite(bytecode.metadata(m_profiledCodeBlock), resultRegs);
     589    emitValueProfilingSite(bytecode, resultRegs);
    593590    emitStore(dst, resultRegs.tagGPR(), resultRegs.payloadGPR());
    594591}
    … …  
    606603    Label coldPathBegin = label();
    607604
    608     Call call = callOperationWithProfile(bytecode.metadata(m_profiledCodeBlock), operationGetByIdDirectOptimize, resultVReg, m_profiledCodeBlock->globalObject(), gen.stubInfo(), JSValueRegs(regT1, regT0), CacheableIdentifier::createFromIdentifierOwnedByCodeBlock(m_profiledCodeBlock, *ident).rawBits());
     605    Call call = callOperationWithProfile(bytecode, operationGetByIdDirectOptimize, resultVReg, m_profiledCodeBlock->globalObject(), gen.stubInfo(), JSValueRegs(regT1, regT0), CacheableIdentifier::createFromIdentifierOwnedByCodeBlock(m_profiledCodeBlock, *ident).rawBits());
    609606
    610607    gen.reportSlowPathCall(coldPathBegin, call);
    … …  
    615612{
    616613    auto bytecode = currentInstruction->as<OpGetById>();
    617     auto& metadata = bytecode.metadata(m_profiledCodeBlock);
    618614    VirtualRegister dst = bytecode.m_dst;
    619615    VirtualRegister base = bytecode.m_base;
    … …  
    624620
    625621    if (*ident == m_vm->propertyNames->length && shouldEmitProfiling()) {
    626         Jump notArrayLengthMode = branch8(NotEqual, AbsoluteAddress(&metadata.m_modeMetadata.mode), TrustedImm32(static_cast<uint8_t>(GetByIdMode::ArrayLength)));
    627         emitArrayProfilingSiteWithCell(regT0, &metadata.m_modeMetadata.arrayLengthMode.arrayProfile, regT2);
     622        load8FromMetadata(bytecode, OpGetById::Metadata::offsetOfModeMetadata() + GetByIdModeMetadata::offsetOfMode(), regT2);
     623        Jump notArrayLengthMode = branch32(NotEqual, TrustedImm32(static_cast<uint8_t>(GetByIdMode::ArrayLength)), regT2);
     624        emitArrayProfilingSiteWithCell(bytecode, OpGetById::Metadata::offsetOfModeMetadata() + GetByIdModeMetadataArrayLength::offsetOfArrayProfile(), regT0, regT2);
    628625        notArrayLengthMode.link(this);
    629626    }
    … …  
    637634    m_getByIds.append(gen);
    638635
    639     emitValueProfilingSite(bytecode.metadata(m_profiledCodeBlock), resultRegs);
     636    emitValueProfilingSite(bytecode, resultRegs);
    640637    emitStore(dst, resultRegs.tagGPR(), resultRegs.payloadGPR());
    641638}
    … …  
    653650    Label coldPathBegin = label();
    654651   
    655     Call call = callOperationWithProfile(bytecode.metadata(m_profiledCodeBlock), operationGetByIdOptimize, resultVReg, m_profiledCodeBlock->globalObject(), gen.stubInfo(), JSValueRegs(regT1, regT0), CacheableIdentifier::createFromIdentifierOwnedByCodeBlock(m_profiledCodeBlock, *ident).rawBits());
     652    Call call = callOperationWithProfile(bytecode, operationGetByIdOptimize, resultVReg, m_profiledCodeBlock->globalObject(), gen.stubInfo(), JSValueRegs(regT1, regT0), CacheableIdentifier::createFromIdentifierOwnedByCodeBlock(m_profiledCodeBlock, *ident).rawBits());
    656653   
    657654    gen.reportSlowPathCall(coldPathBegin, call);
    … …  
    680677    m_getByIdsWithThis.append(gen);
    681678
    682     emitValueProfilingSite(bytecode.metadata(m_profiledCodeBlock), resultRegs);
     679    emitValueProfilingSite(bytecode, resultRegs);
    683680    emitStore(dst, resultRegs.tagGPR(), resultRegs.payloadGPR());
    684681}
    … …  
    696693    Label coldPathBegin = label();
    697694   
    698     Call call = callOperationWithProfile(bytecode.metadata(m_profiledCodeBlock), operationGetByIdWithThisOptimize, resultVReg, m_profiledCodeBlock->globalObject(), gen.stubInfo(), JSValueRegs(regT1, regT0), JSValueRegs(regT4, regT3), CacheableIdentifier::createFromIdentifierOwnedByCodeBlock(m_profiledCodeBlock, *ident).rawBits());
     695    Call call = callOperationWithProfile(bytecode, operationGetByIdWithThisOptimize, resultVReg, m_profiledCodeBlock->globalObject(), gen.stubInfo(), JSValueRegs(regT1, regT0), JSValueRegs(regT4, regT3), CacheableIdentifier::createFromIdentifierOwnedByCodeBlock(m_profiledCodeBlock, *ident).rawBits());
    699696   
    700697    gen.reportSlowPathCall(coldPathBegin, call);
    … …  
    797794    VirtualRegister base = bytecode.m_base;
    798795    VirtualRegister property = bytecode.m_property;
    799     auto& metadata = bytecode.metadata(m_profiledCodeBlock);
    800     ArrayProfile* profile = &metadata.m_arrayProfile;
    801796
    802797    emitLoad2(base, regT1, regT0, property, regT3, regT2);
    803798    emitJumpSlowCaseIfNotJSCell(base, regT1);
    804     emitArrayProfilingSiteWithCell(regT0, profile, regT4);
     799    emitArrayProfilingSiteWithCell(bytecode, regT0, regT4);
    805800
    806801    JITInByValGenerator gen(
    … …  
    11431138        break;
    11441139    }
    1145     emitValueProfilingSite(bytecode.metadata(m_profiledCodeBlock), JSValueRegs(regT1, regT0));
     1140    emitValueProfilingSite(bytecode, JSValueRegs(regT1, regT0));
    11461141    emitStore(dst, regT1, regT0);
    11471142}
    … …  
    11531148    auto bytecode = currentInstruction->as<OpGetFromScope>();
    11541149    VirtualRegister dst = bytecode.m_dst;
    1155     callOperationWithProfile(bytecode.metadata(m_profiledCodeBlock), operationGetFromScope, dst, m_profiledCodeBlock->globalObject(), currentInstruction);
     1150    callOperationWithProfile(bytecode, operationGetFromScope, dst, m_profiledCodeBlock->globalObject(), currentInstruction);
    11561151}
    11571152
    … …  
    13251320    int index = bytecode.m_index;
    13261321
    1327     JSValueRegs resutlRegs = JSValueRegs(regT1, regT0);
     1322    JSValueRegs resultRegs = JSValueRegs(regT1, regT0);
    13281323   
    13291324    emitLoadPayload(arguments, regT0);
    1330     load32(Address(regT0, DirectArguments::storageOffset() + index * sizeof(WriteBarrier<Unknown>) + TagOffset), resutlRegs.tagGPR());
    1331     load32(Address(regT0, DirectArguments::storageOffset() + index * sizeof(WriteBarrier<Unknown>) + PayloadOffset), resutlRegs.payloadGPR());
    1332     emitValueProfilingSite(bytecode.metadata(m_profiledCodeBlock), resutlRegs);
    1333     emitStore(dst, resutlRegs.tagGPR(), resutlRegs.payloadGPR());
     1325    load32(Address(regT0, DirectArguments::storageOffset() + index * sizeof(WriteBarrier<Unknown>) + TagOffset), resultRegs.tagGPR());
     1326    load32(Address(regT0, DirectArguments::storageOffset() + index * sizeof(WriteBarrier<Unknown>) + PayloadOffset), resultRegs.payloadGPR());
     1327    emitValueProfilingSite(bytecode, resultRegs);
     1328    emitStore(dst, resultRegs.tagGPR(), resultRegs.payloadGPR());
    13341329}
    13351330
    … …  
    13521347{
    13531348    auto bytecode = currentInstruction->as<OpGetInternalField>();
    1354     auto& metadata = bytecode.metadata(m_profiledCodeBlock);
    13551349    VirtualRegister dst = bytecode.m_dst;
    13561350    VirtualRegister base = bytecode.m_base;
    … …  
    13621356    load32(Address(regT2, JSInternalFieldObjectImpl<>::offsetOfInternalField(index) + TagOffset), resultRegs.tagGPR());
    13631357    load32(Address(regT2, JSInternalFieldObjectImpl<>::offsetOfInternalField(index) + PayloadOffset), resultRegs.payloadGPR());
    1364     emitValueProfilingSite(metadata, resultRegs);
     1358    emitValueProfilingSite(bytecode, resultRegs);
    13651359    emitStore(dst, resultRegs.tagGPR(), resultRegs.payloadGPR());
    13661360}
Note: See TracChangeset for help on using the changeset viewer.