Changeset 283887 in webkit
- Timestamp:
- Oct 11, 2021, 2:10:40 AM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 6 edited
-
ChangeLog (modified) (1 diff)
-
jit/JIT.h (modified) (2 diffs)
-
jit/JITCall32_64.cpp (modified) (12 diffs)
-
jit/JITInlines.h (modified) (4 diffs)
-
jit/JITOpcodes32_64.cpp (modified) (6 diffs)
-
jit/JITPropertyAccess32_64.cpp (modified) (21 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r283881 r283887 1 2021-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 1 50 2021-10-10 Sihui Liu <sihui_liu@apple.com> 2 51 -
trunk/Source/JavaScriptCore/jit/JIT.h
r283389 r283887 344 344 void emitWriteBarrier(GPRReg owner); 345 345 346 // This assumes that the value to profile is in regT0 and that regT3 is available for 347 // scratch. 346 #if USE(JSVALUE64) 348 347 template<typename Bytecode> void emitValueProfilingSite(const Bytecode&, GPRReg); 348 #endif 349 349 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). 357 352 void emitValueProfilingSiteIfProfiledOpcode(...); 358 353 template<typename Op> … … 364 359 template <typename Bytecode> 365 360 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 #endif371 361 372 362 template<typename Op> -
trunk/Source/JavaScriptCore/jit/JITCall32_64.cpp
r283557 r283887 53 53 void JIT::emitPutCallResult(const Op& bytecode) 54 54 { 55 emitValueProfilingSite(bytecode .metadata(m_profiledCodeBlock), JSValueRegs(regT1, regT0));55 emitValueProfilingSite(bytecode, JSValueRegs(regT1, regT0)); 56 56 emitStore(destinationFor(bytecode, m_bytecodeIndex.checkpoint()).virtualRegister(), regT1, regT0); 57 57 } … … 158 158 { 159 159 unsigned checkpoint = m_bytecodeIndex.checkpoint(); 160 auto& metadata = bytecode.metadata(m_profiledCodeBlock);161 160 int argCount = argumentCountIncludingThisFor(bytecode, checkpoint); 162 161 int registerOffset = -static_cast<int>(stackOffsetInRegistersForCall(bytecode, checkpoint)); … … 165 164 emitLoad(VirtualRegister(registerOffset + CallFrame::argumentOffsetIncludingThis(0)), regT0, regT1); 166 165 Jump done = branchIfNotCell(regT0); 167 load32(Address(regT1, JSCell::structureIDOffset()), regT 1);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()); 169 168 done.link(this); 170 169 } … … 321 320 } 322 321 323 auto slowPaths = info->emitFastPath(*this, regT0, regT2, CallLinkInfo::UseDataIC:: Yes);322 auto slowPaths = info->emitFastPath(*this, regT0, regT2, CallLinkInfo::UseDataIC::No); 324 323 addSlowCase(slowPaths); 325 324 m_callCompilationInfo[callLinkInfoIndex].doneLocation = label(); … … 412 411 m_getByIds.append(gen); 413 412 414 emitValueProfilingSite(bytecode .metadata(m_profiledCodeBlock), nextRegs);413 emitValueProfilingSite(bytecode, nextRegs); 415 414 emitPutVirtualRegister(bytecode.m_next, nextRegs); 416 415 … … 442 441 443 442 Call call = callOperationWithProfile( 444 bytecode .metadata(m_profiledCodeBlock), // metadata443 bytecode, 445 444 operationGetByIdOptimize, // operation 446 445 nextVReg, // result … … 462 461 { 463 462 auto bytecode = instruction->as<OpIteratorNext>(); 464 auto& metadata = bytecode.metadata(m_profiledCodeBlock);465 463 auto* tryFastFunction = ([&] () { 466 464 switch (instruction->width()) { … … 481 479 482 480 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()); 484 484 compileOpCall<OpIteratorNext>(instruction, m_callLinkInfoIndex++); 485 485 advanceToNextCheckpoint(); … … 522 522 m_getByIds.append(gen); 523 523 524 emitValueProfilingSite( metadata, doneRegs);524 emitValueProfilingSite(bytecode, doneRegs); 525 525 emitPutVirtualRegister(bytecode.m_done, doneRegs); 526 526 advanceToNextCheckpoint(); … … 552 552 m_getByIds.append(gen); 553 553 554 emitValueProfilingSite( metadata, resultRegs);554 emitValueProfilingSite(bytecode, resultRegs); 555 555 emitPutVirtualRegister(bytecode.m_value, resultRegs); 556 556 … … 590 590 591 591 Call call = callOperationWithProfile( 592 bytecode .metadata(m_profiledCodeBlock), // metadata592 bytecode, 593 593 operationGetByIdOptimize, // operation 594 594 doneVReg, // result … … 620 620 621 621 Call call = callOperationWithProfile( 622 bytecode .metadata(m_profiledCodeBlock), // metadata622 bytecode, 623 623 operationGetByIdOptimize, // operation 624 624 valueVReg, // result -
trunk/Source/JavaScriptCore/jit/JITInlines.h
r283557 r283887 330 330 } 331 331 332 #if USE(JSVALUE32_64) 333 inline void JIT::emitValueProfilingSite(ValueProfile& valueProfile, JSValueRegs value) 332 template<typename Op> 333 inline 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 343 inline void JIT::emitValueProfilingSiteIfProfiledOpcode(...) { } 344 345 template<typename Bytecode> 346 inline void JIT::emitValueProfilingSite(const Bytecode& bytecode, JSValueRegs value) 334 347 { 335 348 if (!shouldEmitProfiling()) 336 349 return; 337 350 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(); 353 352 #if USE(JSVALUE64) 354 emitValueProfilingSite(bytecode, regT0);355 #else356 emitValueProfilingSite(bytecode, JSValueRegs(regT1, regT0));357 #endif358 }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();370 353 store64(value.gpr(), Address(s_metadataGPR, offset)); 371 354 #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) 378 361 template<typename Bytecode> 379 362 inline void JIT::emitValueProfilingSite(const Bytecode& bytecode, GPRReg resultReg) … … 381 364 emitValueProfilingSite(bytecode, JSValueRegs(resultReg)); 382 365 } 366 #endif 383 367 384 368 template <typename Bytecode> … … 386 370 { 387 371 if (shouldEmitProfiling()) { 388 load32( MacroAssembler::Address(cellGPR, JSCell::structureIDOffset()), scratchGPR);372 load32(Address(cellGPR, JSCell::structureIDOffset()), scratchGPR); 389 373 store32ToMetadata(scratchGPR, bytecode, offsetOfArrayProfile); 390 374 } … … 396 380 emitArrayProfilingSiteWithCell(bytecode, Bytecode::Metadata::offsetOfArrayProfile() + ArrayProfile::offsetOfLastSeenStructureID(), cellGPR, scratchGPR); 397 381 } 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 #endif416 382 417 383 ALWAYS_INLINE int32_t JIT::getOperandConstantInt(VirtualRegister src) -
trunk/Source/JavaScriptCore/jit/JITOpcodes32_64.cpp
r283608 r283887 519 519 { 520 520 auto bytecode = currentInstruction->as<OpJneqPtr>(); 521 auto& metadata = bytecode.metadata(m_profiledCodeBlock);522 521 VirtualRegister src = bytecode.m_value; 523 522 JSValue specialPointer = getConstantOperand(bytecode.m_specialPointer); … … 529 528 Jump equal = branchPtr(Equal, regT0, TrustedImmPtr(specialPointer.asCell())); 530 529 notCell.link(this); 531 store8 (TrustedImm32(1), &metadata.m_hasJumped);530 store8ToMetadata(TrustedImm32(1), bytecode, OpJneqPtr::Metadata::offsetOfHasJumped()); 532 531 addJump(jump(), target); 533 532 equal.link(this); … … 877 876 isInt32.link(this); 878 877 879 emitValueProfilingSite(bytecode .metadata(m_profiledCodeBlock), JSValueRegs(regT1, regT0));878 emitValueProfilingSite(bytecode, JSValueRegs(regT1, regT0)); 880 879 if (src != dst) 881 880 emitStore(dst, regT1, regT0); … … 899 898 isBigInt.link(this); 900 899 901 emitValueProfilingSite(bytecode .metadata(m_profiledCodeBlock), JSValueRegs(regT1, regT0));900 emitValueProfilingSite(bytecode, JSValueRegs(regT1, regT0)); 902 901 if (src != dst) 903 902 emitStore(dst, regT1, regT0); … … 930 929 addSlowCase(branchIfNotObject(regT0)); 931 930 932 emitValueProfilingSite(bytecode .metadata(m_profiledCodeBlock), JSValueRegs(regT1, regT0));931 emitValueProfilingSite(bytecode, JSValueRegs(regT1, regT0)); 933 932 if (src != dst) 934 933 emitStore(dst, regT1, regT0); … … 980 979 // https://bugs.webkit.org/show_bug.cgi?id=175598 981 980 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()); 988 982 auto skipOSREntry = branchTestPtr(Zero, returnValueGPR); 989 983 emitRestoreCalleeSaves(); 990 984 farJump(returnValueGPR, NoPtrTag); 991 985 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 }999 986 #endif // ENABLE(DFG_JIT) 1000 987 } -
trunk/Source/JavaScriptCore/jit/JITPropertyAccess32_64.cpp
r283389 r283887 238 238 { 239 239 auto bytecode = currentInstruction->as<OpGetByVal>(); 240 auto& metadata = bytecode.metadata(m_profiledCodeBlock);241 240 VirtualRegister dst = bytecode.m_dst; 242 241 VirtualRegister base = bytecode.m_base; 243 242 VirtualRegister property = bytecode.m_property; 244 ArrayProfile* profile = &metadata.m_arrayProfile;245 243 246 244 emitLoad2(base, regT1, regT0, property, regT3, regT2); 247 245 248 if ( metadata.m_seenIdentifiers.count() > Options::getByValICMaxNumberOfIdentifiers()) {246 if (bytecode.metadata(m_profiledCodeBlock).m_seenIdentifiers.count() > Options::getByValICMaxNumberOfIdentifiers()) { 249 247 auto notCell = branchIfNotCell(regT1); 250 emitArrayProfilingSiteWithCell( regT0, profile, regT4);248 emitArrayProfilingSiteWithCell(bytecode, regT0, regT4); 251 249 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)); 253 251 } else { 254 252 emitJumpSlowCaseIfNotJSCell(base, regT1); 255 emitArrayProfilingSiteWithCell( regT0, profile, regT4);253 emitArrayProfilingSiteWithCell(bytecode, regT0, regT4); 256 254 257 255 JSValueRegs resultRegs = JSValueRegs(regT1, regT0); … … 266 264 m_getByVals.append(gen); 267 265 268 emitValueProfilingSite(bytecode .metadata(m_profiledCodeBlock), resultRegs);266 emitValueProfilingSite(bytecode, resultRegs); 269 267 emitStore(dst, regT1, regT0); 270 268 } … … 285 283 286 284 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)); 288 286 gen.reportSlowPathCall(coldPathBegin, call); 289 287 } … … 312 310 m_getByVals.append(gen); 313 311 314 emitValueProfilingSite(bytecode .metadata(m_profiledCodeBlock), resultRegs);312 emitValueProfilingSite(bytecode, resultRegs); 315 313 emitStore(dst, resultRegs.tagGPR(), resultRegs.payloadGPR()); 316 314 } … … 331 329 auto baseGPR = JSValueRegs(regT1, regT0); 332 330 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); 334 332 gen.reportSlowPathCall(coldPathBegin, call); 335 333 } … … 466 464 { 467 465 auto bytecode = currentInstruction->as<Op>(); 468 auto& metadata = bytecode.metadata(m_profiledCodeBlock);469 466 VirtualRegister base = bytecode.m_base; 470 467 VirtualRegister property = bytecode.m_property; 471 468 VirtualRegister value = bytecode.m_value; 472 ArrayProfile* profile = &metadata.m_arrayProfile;473 469 474 470 emitLoad2(base, regT1, regT0, property, regT3, regT2); 475 471 emitLoad(value, regT5, regT4); 476 move(TrustedImmPtr(profile), regT6); 472 477 473 emitJumpSlowCaseIfNotJSCell(base, regT1); 478 emitArrayProfilingSiteWithCell(regT0, regT6, regT7); 474 emitArrayProfilingSiteWithCell(bytecode, regT0, regT6); 475 materializePointerIntoMetadata(bytecode, Op::Metadata::offsetOfArrayProfile(), regT6); 479 476 480 477 JITPutByValGenerator gen( … … 549 546 m_getByIds.append(gen); 550 547 551 emitValueProfilingSite(bytecode .metadata(m_profiledCodeBlock), resultRegs);548 emitValueProfilingSite(bytecode, resultRegs); 552 549 emitStore(dst, resultRegs.tagGPR(), resultRegs.payloadGPR()); 553 550 } … … 590 587 m_getByIds.append(gen); 591 588 592 emitValueProfilingSite(bytecode .metadata(m_profiledCodeBlock), resultRegs);589 emitValueProfilingSite(bytecode, resultRegs); 593 590 emitStore(dst, resultRegs.tagGPR(), resultRegs.payloadGPR()); 594 591 } … … 606 603 Label coldPathBegin = label(); 607 604 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()); 609 606 610 607 gen.reportSlowPathCall(coldPathBegin, call); … … 615 612 { 616 613 auto bytecode = currentInstruction->as<OpGetById>(); 617 auto& metadata = bytecode.metadata(m_profiledCodeBlock);618 614 VirtualRegister dst = bytecode.m_dst; 619 615 VirtualRegister base = bytecode.m_base; … … 624 620 625 621 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); 628 625 notArrayLengthMode.link(this); 629 626 } … … 637 634 m_getByIds.append(gen); 638 635 639 emitValueProfilingSite(bytecode .metadata(m_profiledCodeBlock), resultRegs);636 emitValueProfilingSite(bytecode, resultRegs); 640 637 emitStore(dst, resultRegs.tagGPR(), resultRegs.payloadGPR()); 641 638 } … … 653 650 Label coldPathBegin = label(); 654 651 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()); 656 653 657 654 gen.reportSlowPathCall(coldPathBegin, call); … … 680 677 m_getByIdsWithThis.append(gen); 681 678 682 emitValueProfilingSite(bytecode .metadata(m_profiledCodeBlock), resultRegs);679 emitValueProfilingSite(bytecode, resultRegs); 683 680 emitStore(dst, resultRegs.tagGPR(), resultRegs.payloadGPR()); 684 681 } … … 696 693 Label coldPathBegin = label(); 697 694 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()); 699 696 700 697 gen.reportSlowPathCall(coldPathBegin, call); … … 797 794 VirtualRegister base = bytecode.m_base; 798 795 VirtualRegister property = bytecode.m_property; 799 auto& metadata = bytecode.metadata(m_profiledCodeBlock);800 ArrayProfile* profile = &metadata.m_arrayProfile;801 796 802 797 emitLoad2(base, regT1, regT0, property, regT3, regT2); 803 798 emitJumpSlowCaseIfNotJSCell(base, regT1); 804 emitArrayProfilingSiteWithCell( regT0, profile, regT4);799 emitArrayProfilingSiteWithCell(bytecode, regT0, regT4); 805 800 806 801 JITInByValGenerator gen( … … 1143 1138 break; 1144 1139 } 1145 emitValueProfilingSite(bytecode .metadata(m_profiledCodeBlock), JSValueRegs(regT1, regT0));1140 emitValueProfilingSite(bytecode, JSValueRegs(regT1, regT0)); 1146 1141 emitStore(dst, regT1, regT0); 1147 1142 } … … 1153 1148 auto bytecode = currentInstruction->as<OpGetFromScope>(); 1154 1149 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); 1156 1151 } 1157 1152 … … 1325 1320 int index = bytecode.m_index; 1326 1321 1327 JSValueRegs resu tlRegs = JSValueRegs(regT1, regT0);1322 JSValueRegs resultRegs = JSValueRegs(regT1, regT0); 1328 1323 1329 1324 emitLoadPayload(arguments, regT0); 1330 load32(Address(regT0, DirectArguments::storageOffset() + index * sizeof(WriteBarrier<Unknown>) + TagOffset), resu tlRegs.tagGPR());1331 load32(Address(regT0, DirectArguments::storageOffset() + index * sizeof(WriteBarrier<Unknown>) + PayloadOffset), resu tlRegs.payloadGPR());1332 emitValueProfilingSite(bytecode .metadata(m_profiledCodeBlock), resutlRegs);1333 emitStore(dst, resu tlRegs.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()); 1334 1329 } 1335 1330 … … 1352 1347 { 1353 1348 auto bytecode = currentInstruction->as<OpGetInternalField>(); 1354 auto& metadata = bytecode.metadata(m_profiledCodeBlock);1355 1349 VirtualRegister dst = bytecode.m_dst; 1356 1350 VirtualRegister base = bytecode.m_base; … … 1362 1356 load32(Address(regT2, JSInternalFieldObjectImpl<>::offsetOfInternalField(index) + TagOffset), resultRegs.tagGPR()); 1363 1357 load32(Address(regT2, JSInternalFieldObjectImpl<>::offsetOfInternalField(index) + PayloadOffset), resultRegs.payloadGPR()); 1364 emitValueProfilingSite( metadata, resultRegs);1358 emitValueProfilingSite(bytecode, resultRegs); 1365 1359 emitStore(dst, resultRegs.tagGPR(), resultRegs.payloadGPR()); 1366 1360 }
Note:
See TracChangeset
for help on using the changeset viewer.