Changeset 287758 in webkit
- Timestamp:
- Jan 7, 2022, 10:36:15 AM (5 years ago)
- Location:
- trunk/Source/JavaScriptCore
- Files:
-
- 10 edited
-
ChangeLog (modified) (1 diff)
-
bytecode/CheckPrivateBrandStatus.cpp (modified) (1 diff)
-
bytecode/DeleteByStatus.cpp (modified) (1 diff)
-
bytecode/GetByStatus.cpp (modified) (1 diff)
-
bytecode/InByStatus.cpp (modified) (1 diff)
-
bytecode/InstanceOfStatus.cpp (modified) (1 diff)
-
bytecode/PutByStatus.cpp (modified) (1 diff)
-
bytecode/SetPrivateBrandStatus.cpp (modified) (1 diff)
-
bytecode/StructureStubInfo.cpp (modified) (11 diffs)
-
bytecode/StructureStubInfo.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r287738 r287758 1 2022-01-07 Yusuke Suzuki <ysuzuki@apple.com> 2 3 [JSC] Clean up StructureStubInfo 4 https://bugs.webkit.org/show_bug.cgi?id=234943 5 6 Reviewed by Saam Barati. 7 8 Use std::unique_ptr<PolymorphicAccess> instead of raw pointer. 9 10 * bytecode/CheckPrivateBrandStatus.cpp: 11 (JSC::CheckPrivateBrandStatus::computeForStubInfoWithoutExitSiteFeedback): 12 * bytecode/DeleteByStatus.cpp: 13 (JSC::DeleteByStatus::computeForStubInfoWithoutExitSiteFeedback): 14 * bytecode/GetByStatus.cpp: 15 (JSC::GetByStatus::computeForStubInfoWithoutExitSiteFeedback): 16 * bytecode/InByStatus.cpp: 17 (JSC::InByStatus::computeForStubInfoWithoutExitSiteFeedback): 18 * bytecode/InstanceOfStatus.cpp: 19 (JSC::InstanceOfStatus::computeForStubInfo): 20 * bytecode/PutByStatus.cpp: 21 (JSC::PutByStatus::computeForStubInfo): 22 * bytecode/SetPrivateBrandStatus.cpp: 23 (JSC::SetPrivateBrandStatus::computeForStubInfoWithoutExitSiteFeedback): 24 * bytecode/StructureStubInfo.cpp: 25 (JSC::StructureStubInfo::deref): 26 (JSC::StructureStubInfo::aboutToDie): 27 (JSC::StructureStubInfo::addAccessCase): 28 (JSC::StructureStubInfo::visitAggregateImpl): 29 (JSC::StructureStubInfo::visitWeakReferences): 30 (JSC::StructureStubInfo::propagateTransitions): 31 (JSC::StructureStubInfo::summary const): 32 (JSC::StructureStubInfo::containsPC const): 33 (JSC::StructureStubInfo::~StructureStubInfo): Deleted. 34 * bytecode/StructureStubInfo.h: 35 (JSC::StructureStubInfo::offsetOfCodePtr): 36 (JSC::StructureStubInfo::offsetOfDoneLocation): 37 (JSC::StructureStubInfo::offsetOfSlowPathStartLocation): 38 (JSC::StructureStubInfo::offsetOfSlowOperation): 39 (JSC::StructureStubInfo::offsetOfCountdown): 40 1 41 2022-01-06 Saam Barati <sbarati@apple.com> 2 42 -
trunk/Source/JavaScriptCore/bytecode/CheckPrivateBrandStatus.cpp
r286994 r287758 101 101 102 102 case CacheType::Stub: { 103 PolymorphicAccess* list = stubInfo-> u.stub;103 PolymorphicAccess* list = stubInfo->m_stub.get(); 104 104 105 105 for (unsigned listIndex = 0; listIndex < list->size(); ++listIndex) { -
trunk/Source/JavaScriptCore/bytecode/DeleteByStatus.cpp
r286994 r287758 100 100 101 101 case CacheType::Stub: { 102 PolymorphicAccess* list = stubInfo-> u.stub;102 PolymorphicAccess* list = stubInfo->m_stub.get(); 103 103 104 104 for (unsigned listIndex = 0; listIndex < list->size(); ++listIndex) { -
trunk/Source/JavaScriptCore/bytecode/GetByStatus.cpp
r286994 r287758 237 237 238 238 case CacheType::Stub: { 239 PolymorphicAccess* list = stubInfo-> u.stub;239 PolymorphicAccess* list = stubInfo->m_stub.get(); 240 240 if (list->size() == 1) { 241 241 const AccessCase& access = list->at(0); -
trunk/Source/JavaScriptCore/bytecode/InByStatus.cpp
r286994 r287758 161 161 162 162 case CacheType::Stub: { 163 PolymorphicAccess* list = stubInfo-> u.stub;163 PolymorphicAccess* list = stubInfo->m_stub.get(); 164 164 for (unsigned listIndex = 0; listIndex < list->size(); ++listIndex) { 165 165 const AccessCase& access = list->at(listIndex); -
trunk/Source/JavaScriptCore/bytecode/InstanceOfStatus.cpp
r286994 r287758 84 84 return TakesSlowPath; // This is conservative. It could be that we have no information. 85 85 86 PolymorphicAccess* list = stubInfo-> u.stub;86 PolymorphicAccess* list = stubInfo->m_stub.get(); 87 87 InstanceOfStatus result; 88 88 for (unsigned listIndex = 0; listIndex < list->size(); ++listIndex) { -
trunk/Source/JavaScriptCore/bytecode/PutByStatus.cpp
r286994 r287758 189 189 190 190 case CacheType::Stub: { 191 PolymorphicAccess* list = stubInfo-> u.stub;191 PolymorphicAccess* list = stubInfo->m_stub.get(); 192 192 193 193 PutByStatus result; -
trunk/Source/JavaScriptCore/bytecode/SetPrivateBrandStatus.cpp
r286994 r287758 101 101 102 102 case CacheType::Stub: { 103 PolymorphicAccess* list = stubInfo-> u.stub;103 PolymorphicAccess* list = stubInfo->m_stub.get(); 104 104 105 105 for (unsigned listIndex = 0; listIndex < list->size(); ++listIndex) { -
trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.cpp
r286994 r287758 40 40 } 41 41 42 StructureStubInfo::~StructureStubInfo() 43 { 44 } 42 StructureStubInfo::~StructureStubInfo() = default; 45 43 46 44 void StructureStubInfo::initGetByIdSelf(const ConcurrentJSLockerBase& locker, CodeBlock* codeBlock, Structure* inlineAccessBaseStructure, PropertyOffset offset, CacheableIdentifier identifier) … … 91 89 switch (m_cacheType) { 92 90 case CacheType::Stub: 93 delete u.stub;91 m_stub.reset(); 94 92 return; 95 93 case CacheType::Unset: … … 109 107 switch (m_cacheType) { 110 108 case CacheType::Stub: 111 u.stub->aboutToDie();109 m_stub->aboutToDie(); 112 110 return; 113 111 case CacheType::Unset: … … 140 138 141 139 if (m_cacheType == CacheType::Stub) { 142 result = u.stub->addCase(locker, vm, codeBlock, *this, accessCase.releaseNonNull());140 result = m_stub->addCase(locker, vm, codeBlock, *this, accessCase.releaseNonNull()); 143 141 144 142 if (StructureStubInfoInternal::verbose) … … 177 175 178 176 setCacheType(locker, CacheType::Stub); 179 u.stub = access.release();177 m_stub = WTFMove(access); 180 178 } 181 179 … … 203 201 clearBufferedStructures(); 204 202 205 result = u.stub->regenerate(locker, vm, globalObject, codeBlock, ecmaMode, *this);203 result = m_stub->regenerate(locker, vm, globalObject, codeBlock, ecmaMode, *this); 206 204 207 205 if (StructureStubInfoInternal::verbose) … … 324 322 return; 325 323 case CacheType::Stub: 326 u.stub->visitAggregate(visitor);324 m_stub->visitAggregate(visitor); 327 325 return; 328 326 } … … 349 347 isValid &= vm.heap.isMarked(structure); 350 348 if (m_cacheType == CacheType::Stub) 351 isValid &= u.stub->visitWeak(vm);349 isValid &= m_stub->visitWeak(vm); 352 350 353 351 if (isValid) … … 365 363 366 364 if (m_cacheType == CacheType::Stub) 367 u.stub->propagateTransitions(visitor);365 m_stub->propagateTransitions(visitor); 368 366 } 369 367 … … 376 374 StubInfoSummary simple = StubInfoSummary::Simple; 377 375 if (m_cacheType == CacheType::Stub) { 378 PolymorphicAccess* list = u.stub;376 PolymorphicAccess* list = m_stub.get(); 379 377 for (unsigned i = 0; i < list->size(); ++i) { 380 378 const AccessCase& access = list->at(i); … … 408 406 if (m_cacheType != CacheType::Stub) 409 407 return false; 410 return u.stub->containsPC(pc);408 return m_stub->containsPC(pc); 411 409 } 412 410 -
trunk/Source/JavaScriptCore/bytecode/StructureStubInfo.h
r286994 r287758 33 33 #include "MacroAssembler.h" 34 34 #include "Options.h" 35 #include "PolymorphicAccess.h" 35 36 #include "PutKind.h" 36 37 #include "RegisterSet.h" … … 351 352 352 353 public: 353 CodeOrigin codeOrigin;354 PropertyOffset byIdSelfOffset;355 354 static ptrdiff_t offsetOfByIdSelfOffset() { return OBJECT_OFFSETOF(StructureStubInfo, byIdSelfOffset); } 356 355 static ptrdiff_t offsetOfInlineAccessBaseStructure() { return OBJECT_OFFSETOF(StructureStubInfo, m_inlineAccessBaseStructure); } 357 union { 358 PolymorphicAccess* stub; 359 } u; 356 static ptrdiff_t offsetOfCodePtr() { return OBJECT_OFFSETOF(StructureStubInfo, m_codePtr); } 357 static ptrdiff_t offsetOfDoneLocation() { return OBJECT_OFFSETOF(StructureStubInfo, doneLocation); } 358 static ptrdiff_t offsetOfSlowPathStartLocation() { return OBJECT_OFFSETOF(StructureStubInfo, slowPathStartLocation); } 359 static ptrdiff_t offsetOfSlowOperation() { return OBJECT_OFFSETOF(StructureStubInfo, m_slowOperation); } 360 static ptrdiff_t offsetOfCountdown() { return OBJECT_OFFSETOF(StructureStubInfo, countdown); } 361 360 362 Structure* inlineAccessBaseStructure(VM& vm) 361 363 { … … 364 366 return vm.getStructure(m_inlineAccessBaseStructure); 365 367 } 368 369 CodeOrigin codeOrigin; 370 PropertyOffset byIdSelfOffset; 371 std::unique_ptr<PolymorphicAccess> m_stub; 366 372 StructureID m_inlineAccessBaseStructure { 0 }; 367 373 private: … … 383 389 384 390 MacroAssemblerCodePtr<JITStubRoutinePtrTag> m_codePtr; 385 386 static ptrdiff_t offsetOfCodePtr() { return OBJECT_OFFSETOF(StructureStubInfo, m_codePtr); }387 static ptrdiff_t offsetOfDoneLocation() { return OBJECT_OFFSETOF(StructureStubInfo, doneLocation); }388 static ptrdiff_t offsetOfSlowPathStartLocation() { return OBJECT_OFFSETOF(StructureStubInfo, slowPathStartLocation); }389 static ptrdiff_t offsetOfSlowOperation() { return OBJECT_OFFSETOF(StructureStubInfo, m_slowOperation); }390 static ptrdiff_t offsetOfCountdown() { return OBJECT_OFFSETOF(StructureStubInfo, countdown); }391 391 392 392 RegisterSet usedRegisters;
Note:
See TracChangeset
for help on using the changeset viewer.