Changeset 277117 in webkit
- Timestamp:
- May 6, 2021 1:54:16 PM (3 years ago)
- Location:
- trunk/Source
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/ChangeLog
r277110 r277117 1 2021-05-06 Filip Pizlo <fpizlo@apple.com> 2 3 Reduce use of dmb ish on ARM64 4 https://bugs.webkit.org/show_bug.cgi?id=225465 5 6 Reviewed by Keith Miller. 7 8 We use loadLoadFence a lot, often in situations like: 9 10 Foo* ptr = loadStuff; 11 loadLoadFence(); 12 use ptr 13 14 On ARM64, we don't need a dmb ish here. This introduces a dependentLoadLoadFence() for these 15 cases; it's just a compiler fence on ARM64 and Intel. 16 17 We also used loadLoadFence in some places where I couldn't think of any good reason for the 18 fence other than paranoia. I got rid of those. 19 20 * bytecode/CallLinkStatus.cpp: 21 (JSC::CallLinkStatus::computeFromCallLinkInfo): 22 * bytecode/CodeBlock.h: 23 (JSC::CodeBlock::jitType const): 24 * bytecode/ObjectAllocationProfile.h: 25 (JSC::ObjectAllocationProfileBase::structure): 26 (JSC::ObjectAllocationProfileWithPrototype::prototype): 27 * bytecode/Watchpoint.h: 28 (JSC::WatchpointSet::state const): 29 (JSC::InlineWatchpointSet::state const): 30 * dfg/DFGByteCodeParser.cpp: 31 (JSC::DFG::ByteCodeParser::parseBlock): 32 (JSC::DFG::ByteCodeParser::handlePutByVal): 33 * dfg/DFGSpeculativeJIT.cpp: 34 (JSC::DFG::SpeculativeJIT::compileGetByValOnString): 35 * ftl/FTLLowerDFGToB3.cpp: 36 (JSC::FTL::DFG::LowerDFGToB3::compileStringCharAt): 37 * runtime/GetterSetter.h: 38 * runtime/InferredValue.h: 39 (JSC::InferredValue::state const): 40 * runtime/Structure.h: 41 (JSC::Structure::tryRareData): 42 * runtime/StructureInlines.h: 43 (JSC::Structure::propertyReplacementWatchpointSet): 44 1 45 2021-05-06 Filip Pizlo <fpizlo@apple.com> 2 46 -
trunk/Source/JavaScriptCore/bytecode/CallLinkStatus.cpp
r263054 r277117 194 194 // fencing in place to make sure that we see the variants list after construction. 195 195 if (PolymorphicCallStubRoutine* stub = callLinkInfo.stub()) { 196 WTF:: loadLoadFence();196 WTF::dependentLoadLoadFence(); 197 197 198 198 if (!stub->hasEdges()) { -
trunk/Source/JavaScriptCore/bytecode/CodeBlock.h
r276610 r277117 435 435 { 436 436 JITCode* jitCode = m_jitCode.get(); 437 WTF::loadLoadFence();438 437 JITType result = JITCode::jitTypeFor(jitCode); 439 WTF::loadLoadFence(); // This probably isn't needed. Oh well, paranoia is good.440 438 return result; 441 439 } -
trunk/Source/JavaScriptCore/bytecode/ObjectAllocationProfile.h
r273138 r277117 53 53 Structure* structure = m_structure.get(); 54 54 // Ensure that if we see the structure, it has been properly created 55 WTF:: loadLoadFence();55 WTF::dependentLoadLoadFence(); 56 56 return structure; 57 57 } … … 101 101 { 102 102 JSObject* prototype = m_prototype.get(); 103 WTF:: loadLoadFence();103 WTF::dependentLoadLoadFence(); 104 104 return prototype; 105 105 } -
trunk/Source/JavaScriptCore/bytecode/Watchpoint.h
r272174 r277117 209 209 WatchpointState state() const 210 210 { 211 WTF::loadLoadFence();212 211 WatchpointState result = static_cast<WatchpointState>(m_state); 213 WTF::loadLoadFence();214 212 return result; 215 213 } … … 362 360 WatchpointState state() const 363 361 { 364 WTF::loadLoadFence();365 362 uintptr_t data = m_data; 366 WTF::loadLoadFence();367 363 if (isFat(data)) 368 364 return fat(data)->state(); -
trunk/Source/JavaScriptCore/dfg/DFGByteCodeParser.cpp
r276823 r277117 5656 5656 // Unfortunately, we can't allocate a new JSImmutableButterfly if the profile tells us new information because we 5657 5657 // cannot allocate from compilation threads. 5658 WTF::loadLoadFence();5659 5658 FrozenValue* frozen = get(VirtualRegister(bytecode.m_immutableButterfly))->constant(); 5660 WTF:: loadLoadFence();5659 WTF::dependentLoadLoadFence(); 5661 5660 JSImmutableButterfly* immutableButterfly = frozen->cast<JSImmutableButterfly*>(); 5662 5661 NewArrayBufferData data { }; -
trunk/Source/JavaScriptCore/dfg/DFGSpeculativeJIT.cpp
r276686 r277117 2405 2405 Structure* stringPrototypeStructure = globalObject->stringPrototype()->structure(vm); 2406 2406 Structure* objectPrototypeStructure = globalObject->objectPrototype()->structure(vm); 2407 WTF:: loadLoadFence();2407 WTF::dependentLoadLoadFence(); 2408 2408 2409 2409 if (globalObject->stringPrototypeChainIsSane()) { -
trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp
r276609 r277117 8494 8494 Structure* stringPrototypeStructure = globalObject->stringPrototype()->structure(vm()); 8495 8495 Structure* objectPrototypeStructure = globalObject->objectPrototype()->structure(vm()); 8496 WTF:: loadLoadFence();8496 WTF::dependentLoadLoadFence(); 8497 8497 8498 8498 if (globalObject->stringPrototypeChainIsSane()) { -
trunk/Source/JavaScriptCore/runtime/GetterSetter.h
r276592 r277117 90 90 { 91 91 JSObject* result = getter(); 92 WTF:: loadLoadFence();92 WTF::dependentLoadLoadFence(); 93 93 return result; 94 94 } -
trunk/Source/JavaScriptCore/runtime/InferredValue.h
r261755 r277117 82 82 WatchpointState state() const 83 83 { 84 WTF::loadLoadFence();85 84 uintptr_t data = m_data; 86 WTF::loadLoadFence();87 85 if (isFat(data)) 88 86 return fat(data)->state(); -
trunk/Source/JavaScriptCore/runtime/Structure.h
r276592 r277117 44 44 #include "Watchpoint.h" 45 45 #include "WriteBarrierInlines.h" 46 #include <wtf/Atomics.h> 46 47 #include <wtf/PrintStream.h> 47 48 … … 339 340 } 340 341 342 StructureRareData* tryRareData() 343 { 344 JSCell* value = m_previousOrRareData.get(); 345 WTF::dependentLoadLoadFence(); 346 if (isRareData(value)) 347 return static_cast<StructureRareData*>(value); 348 return nullptr; 349 } 350 341 351 const StructureRareData* rareData() const 342 352 { -
trunk/Source/JavaScriptCore/runtime/StructureInlines.h
r272580 r277117 368 368 { 369 369 ConcurrentJSLocker locker(m_lock); 370 if (!hasRareData()) 370 StructureRareData* rareData = tryRareData(); 371 if (!rareData) 371 372 return nullptr; 372 WTF::loadLoadFence(); 373 StructureRareData::PropertyWatchpointMap* map = rareData()->m_replacementWatchpointSets.get(); 373 StructureRareData::PropertyWatchpointMap* map = rareData->m_replacementWatchpointSets.get(); 374 374 if (!map) 375 375 return nullptr; -
trunk/Source/WTF/ChangeLog
r277104 r277117 1 2021-05-06 Filip Pizlo <fpizlo@apple.com> 2 3 Reduce use of dmb ish on ARM64 4 https://bugs.webkit.org/show_bug.cgi?id=225465 5 6 Reviewed by Keith Miller. 7 8 * wtf/Atomics.h: 9 (WTF::dependentLoadLoadFence): 10 1 11 2021-05-06 Per Arne Vollan <pvollan@apple.com> 2 12 -
trunk/Source/WTF/wtf/Atomics.h
r248546 r277117 329 329 #endif 330 330 331 #if CPU(ARM64) || CPU(X86) || CPU(X86_64) 332 // Use this fence if you want a fence between loads that are already depdendent. 333 inline void dependentLoadLoadFence() { compilerFence(); } 334 #else 335 inline void dependentLoadLoadFence() { loadLoadFence(); } 336 #endif 337 331 338 typedef unsigned InternalDependencyType; 332 339
Note: See TracChangeset
for help on using the changeset viewer.