Changeset 232132 in webkit
- Timestamp:
- May 23, 2018 3:34:18 PM (6 years ago)
- Location:
- trunk/Source
- Files:
-
- 2 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/JavaScriptCore/CMakeLists.txt
r232080 r232132 491 491 heap/AllocationFailureMode.h 492 492 heap/Allocator.h 493 heap/AllocatorInlines.h 493 494 heap/AllocatorForMode.h 494 495 heap/BlockDirectory.h … … 501 502 heap/CollectorPhase.h 502 503 heap/CompleteSubspace.h 504 heap/CompleteSubspaceInlines.h 503 505 heap/ConstraintConcurrency.h 504 506 heap/ConstraintParallelism.h … … 534 536 heap/IsoCellSet.h 535 537 heap/IsoSubspace.h 538 heap/IsoSubspaceInlines.h 536 539 heap/IsoSubspacePerVM.h 537 540 heap/LargeAllocation.h 538 541 heap/ListableHandler.h 539 542 heap/LocalAllocator.h 543 heap/LocalAllocatorInlines.h 540 544 heap/LockDuringMarking.h 541 545 heap/MachineStackMarker.h -
trunk/Source/JavaScriptCore/ChangeLog
r232110 r232132 1 2018-05-23 Filip Pizlo <fpizlo@apple.com> 2 3 Speed up JetStream/base64 4 https://bugs.webkit.org/show_bug.cgi?id=185914 5 6 Reviewed by Michael Saboff. 7 8 Make allocation fast paths ALWAYS_INLINE. 9 10 This is a 1% speed-up on SunSpider, mostly because of base64. It also speeds up pdfjs by 11 ~6%. 12 13 * CMakeLists.txt: 14 * JavaScriptCore.xcodeproj/project.pbxproj: 15 * heap/AllocatorInlines.h: 16 (JSC::Allocator::allocate const): 17 * heap/CompleteSubspace.cpp: 18 (JSC::CompleteSubspace::allocateNonVirtual): Deleted. 19 * heap/CompleteSubspace.h: 20 * heap/CompleteSubspaceInlines.h: Added. 21 (JSC::CompleteSubspace::allocateNonVirtual): 22 * heap/FreeListInlines.h: 23 (JSC::FreeList::allocate): 24 * heap/IsoSubspace.cpp: 25 (JSC::IsoSubspace::allocateNonVirtual): Deleted. 26 * heap/IsoSubspace.h: 27 (JSC::IsoSubspace::allocatorForNonVirtual): 28 * heap/IsoSubspaceInlines.h: Added. 29 (JSC::IsoSubspace::allocateNonVirtual): 30 * runtime/JSCellInlines.h: 31 * runtime/VM.h: 32 1 33 2018-05-23 Rick Waldron <waldron.rick@gmail.com> 2 34 -
trunk/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
r232080 r232132 395 395 0F725CB01C506D3B00AD943A /* B3FoldPathConstants.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F725CAE1C506D3B00AD943A /* B3FoldPathConstants.h */; }; 396 396 0F74B93B1F89614800B935D3 /* PrototypeKey.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F74B93A1F89614500B935D3 /* PrototypeKey.h */; settings = {ATTRIBUTES = (Private, ); }; }; 397 0F75A060200D260B0038E2CF /* LocalAllocatorInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F75A05A200D25F00038E2CF /* LocalAllocatorInlines.h */; };397 0F75A060200D260B0038E2CF /* LocalAllocatorInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F75A05A200D25F00038E2CF /* LocalAllocatorInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; 398 398 0F75A061200D26180038E2CF /* LocalAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F75A057200D25F00038E2CF /* LocalAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; 399 0F75A062200D261D0038E2CF /* AllocatorInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F75A05D200D25F10038E2CF /* AllocatorInlines.h */; };399 0F75A062200D261D0038E2CF /* AllocatorInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F75A05D200D25F10038E2CF /* AllocatorInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; 400 400 0F75A063200D261F0038E2CF /* Allocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F75A054200D25EF0038E2CF /* Allocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; 401 401 0F75A0662013E4F10038E2CF /* JITAllocator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F75A0652013E4EF0038E2CF /* JITAllocator.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 547 547 0FD0E5F21E46C8AF0006AB08 /* CollectingScope.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD0E5F11E46C8AD0006AB08 /* CollectingScope.h */; }; 548 548 0FD2C92416D01EE900C7803F /* StructureInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD2C92316D01EE900C7803F /* StructureInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; 549 0FD2FD9420B52BDE00F09441 /* CompleteSubspaceInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD2FD9320B52BDD00F09441 /* CompleteSubspaceInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; 550 0FD2FD9520B52BE200F09441 /* IsoSubspaceInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD2FD9220B52BDC00F09441 /* IsoSubspaceInlines.h */; settings = {ATTRIBUTES = (Private, ); }; }; 549 551 0FD3C82814115D4F00FD81CB /* DFGDriver.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD3C82214115D0E00FD81CB /* DFGDriver.h */; }; 550 552 0FD3E4021B618AAF00C80E1E /* DFGAdaptiveInferredPropertyValueWatchpoint.h in Headers */ = {isa = PBXBuildFile; fileRef = 0FD3E4001B618AAF00C80E1E /* DFGAdaptiveInferredPropertyValueWatchpoint.h */; }; … … 2706 2708 0FD0E5F11E46C8AD0006AB08 /* CollectingScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CollectingScope.h; sourceTree = "<group>"; }; 2707 2709 0FD2C92316D01EE900C7803F /* StructureInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StructureInlines.h; sourceTree = "<group>"; }; 2710 0FD2FD9220B52BDC00F09441 /* IsoSubspaceInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IsoSubspaceInlines.h; sourceTree = "<group>"; }; 2711 0FD2FD9320B52BDD00F09441 /* CompleteSubspaceInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CompleteSubspaceInlines.h; sourceTree = "<group>"; }; 2708 2712 0FD3C82014115CF800FD81CB /* DFGDriver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGDriver.cpp; path = dfg/DFGDriver.cpp; sourceTree = "<group>"; }; 2709 2713 0FD3C82214115D0E00FD81CB /* DFGDriver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGDriver.h; path = dfg/DFGDriver.h; sourceTree = "<group>"; }; … … 5636 5640 0FDCE1271FAFA859006F3901 /* CompleteSubspace.cpp */, 5637 5641 0FDCE1281FAFA859006F3901 /* CompleteSubspace.h */, 5642 0FD2FD9320B52BDD00F09441 /* CompleteSubspaceInlines.h */, 5638 5643 146B14DB12EB5B12001BEC1B /* ConservativeRoots.cpp */, 5639 5644 149DAAF212EB559D0083B12B /* ConservativeRoots.h */, … … 5711 5716 0FDCE12C1FAFB4DE006F3901 /* IsoSubspace.cpp */, 5712 5717 0FDCE12B1FAFB4DE006F3901 /* IsoSubspace.h */, 5718 0FD2FD9220B52BDC00F09441 /* IsoSubspaceInlines.h */, 5713 5719 0F5E0FE62086AD470097F0DE /* IsoSubspacePerVM.cpp */, 5714 5720 0F5E0FE52086AD460097F0DE /* IsoSubspacePerVM.h */, … … 8316 8322 0FEC85261BDACDAC0080FF74 /* B3PatchpointSpecial.h in Headers */, 8317 8323 0FEC85281BDACDAC0080FF74 /* B3PatchpointValue.h in Headers */, 8324 0FD2FD9520B52BE200F09441 /* IsoSubspaceInlines.h in Headers */, 8318 8325 799EF7C41C56ED96002B0534 /* B3PCToOriginMap.h in Headers */, 8319 8326 0FEC852A1BDACDAC0080FF74 /* B3PhaseScope.h in Headers */, … … 8950 8957 BC18C4150E16F5CD00B34460 /* JavaScriptCorePrefix.h in Headers */, 8951 8958 1429D9300ED22D7000B89619 /* JIT.h in Headers */, 8959 0FD2FD9420B52BDE00F09441 /* CompleteSubspaceInlines.h in Headers */, 8952 8960 FE1220271BE7F58C0039E6F2 /* JITAddGenerator.h in Headers */, 8953 8961 0F75A0662013E4F10038E2CF /* JITAllocator.h in Headers */, -
trunk/Source/JavaScriptCore/heap/AllocatorInlines.h
r232074 r232132 31 31 namespace JSC { 32 32 33 inlinevoid* Allocator::allocate(GCDeferralContext* context, AllocationFailureMode mode) const33 ALWAYS_INLINE void* Allocator::allocate(GCDeferralContext* context, AllocationFailureMode mode) const 34 34 { 35 35 return m_localAllocator->allocate(context, mode); -
trunk/Source/JavaScriptCore/heap/CompleteSubspace.cpp
r232074 r232132 56 56 { 57 57 return allocateNonVirtual(vm, size, deferralContext, failureMode); 58 }59 60 void* CompleteSubspace::allocateNonVirtual(VM& vm, size_t size, GCDeferralContext* deferralContext, AllocationFailureMode failureMode)61 {62 if (Allocator allocator = allocatorForNonVirtual(size, AllocatorForMode::AllocatorIfExists))63 return allocator.allocate(deferralContext, failureMode);64 return allocateSlow(vm, size, deferralContext, failureMode);65 58 } 66 59 -
trunk/Source/JavaScriptCore/heap/CompleteSubspace.h
r232074 r232132 44 44 45 45 void* allocate(VM&, size_t, GCDeferralContext*, AllocationFailureMode) override; 46 JS_EXPORT_PRIVATEvoid* allocateNonVirtual(VM&, size_t, GCDeferralContext*, AllocationFailureMode);46 void* allocateNonVirtual(VM&, size_t, GCDeferralContext*, AllocationFailureMode); 47 47 48 48 static ptrdiff_t offsetOfAllocatorForSizeStep() { return OBJECT_OFFSETOF(CompleteSubspace, m_allocatorForSizeStep); } … … 51 51 52 52 private: 53 Allocator allocatorForSlow(size_t);53 JS_EXPORT_PRIVATE Allocator allocatorForSlow(size_t); 54 54 55 55 // These slow paths are concerned with large allocations and allocator creation. 56 void* allocateSlow(VM&, size_t, GCDeferralContext*, AllocationFailureMode);56 JS_EXPORT_PRIVATE void* allocateSlow(VM&, size_t, GCDeferralContext*, AllocationFailureMode); 57 57 void* tryAllocateSlow(VM&, size_t, GCDeferralContext*); 58 58 -
trunk/Source/JavaScriptCore/heap/FreeListInlines.h
r217711 r232132 32 32 33 33 template<typename Func> 34 HeapCell* FreeList::allocate(const Func& slowPath)34 ALWAYS_INLINE HeapCell* FreeList::allocate(const Func& slowPath) 35 35 { 36 36 unsigned remaining = m_remaining; -
trunk/Source/JavaScriptCore/heap/IsoSubspace.cpp
r232074 r232132 64 64 } 65 65 66 void* IsoSubspace::allocateNonVirtual(VM&, size_t size, GCDeferralContext* deferralContext, AllocationFailureMode failureMode)67 {68 RELEASE_ASSERT(size == this->size());69 Allocator allocator = allocatorForNonVirtual(size, AllocatorForMode::MustAlreadyHaveAllocator);70 void* result = allocator.allocate(deferralContext, failureMode);71 return result;72 }73 74 66 void IsoSubspace::didResizeBits(size_t blockIndex) 75 67 { -
trunk/Source/JavaScriptCore/heap/IsoSubspace.h
r232074 r232132 46 46 47 47 void* allocate(VM&, size_t, GCDeferralContext*, AllocationFailureMode) override; 48 JS_EXPORT_PRIVATEvoid* allocateNonVirtual(VM&, size_t, GCDeferralContext*, AllocationFailureMode);48 void* allocateNonVirtual(VM&, size_t, GCDeferralContext*, AllocationFailureMode); 49 49 50 50 private: … … 62 62 }; 63 63 64 inlineAllocator IsoSubspace::allocatorForNonVirtual(size_t size, AllocatorForMode)64 ALWAYS_INLINE Allocator IsoSubspace::allocatorForNonVirtual(size_t size, AllocatorForMode) 65 65 { 66 66 RELEASE_ASSERT(size == this->size()); -
trunk/Source/JavaScriptCore/runtime/JSCellInlines.h
r232070 r232132 26 26 #pragma once 27 27 28 #include "AllocatorInlines.h" 29 #include "CompleteSubspaceInlines.h" 28 30 #include "CPU.h" 29 31 #include "CallFrame.h" 30 32 #include "DeferGC.h" 33 #include "FreeListInlines.h" 31 34 #include "Handle.h" 35 #include "IsoSubspaceInlines.h" 32 36 #include "JSCast.h" 33 37 #include "JSDestructibleObject.h" 34 38 #include "JSObject.h" 35 39 #include "JSString.h" 40 #include "LocalAllocatorInlines.h" 36 41 #include "MarkedBlock.h" 37 42 #include "Structure.h" -
trunk/Source/JavaScriptCore/runtime/JSString.cpp
r231337 r232132 296 296 // Vector before performing any concatenation, but by working backwards we likely 297 297 // only fill the queue with the number of substrings at any given level in a 298 // rope-of-ropes.) 298 // rope-of-ropes.) 299 299 void JSRopeString::resolveRopeSlowCase8(LChar* buffer) const 300 300 { -
trunk/Source/JavaScriptCore/runtime/VM.h
r232074 r232132 951 951 #endif 952 952 953 void sanitizeStackForVM(VM*);953 JS_EXPORT_PRIVATE void sanitizeStackForVM(VM*); 954 954 void logSanitizeStack(VM*); 955 955 -
trunk/Source/WTF/ChangeLog
r232122 r232132 1 2018-05-23 Filip Pizlo <fpizlo@apple.com> 2 3 Speed up JetStream/base64 4 https://bugs.webkit.org/show_bug.cgi?id=185914 5 6 Reviewed by Michael Saboff. 7 8 Make Vector<>::append ALWAYS_INLINE. 9 10 * wtf/Vector.h: 11 (WTF::Vector::append): 12 (WTF::minCapacity>::expandCapacity): 13 (WTF::minCapacity>::append): 14 (WTF::minCapacity>::tryAppend): 15 1 16 2018-05-23 Michael Saboff <msaboff@apple.com> 2 17 -
trunk/Source/WTF/wtf/Vector.h
r231565 r232132 759 759 void clear() { shrinkCapacity(0); } 760 760 761 void append(ValueType&& value) { append<ValueType>(std::forward<ValueType>(value)); }761 ALWAYS_INLINE void append(ValueType&& value) { append<ValueType>(std::forward<ValueType>(value)); } 762 762 template<typename U> void append(U&&); 763 763 template<typename... Args> void constructAndAppend(Args&&...); … … 1033 1033 1034 1034 template<typename T, size_t inlineCapacity, typename OverflowHandler, size_t minCapacity> 1035 T* Vector<T, inlineCapacity, OverflowHandler, minCapacity>::expandCapacity(size_t newMinCapacity, T* ptr)1035 NEVER_INLINE T* Vector<T, inlineCapacity, OverflowHandler, minCapacity>::expandCapacity(size_t newMinCapacity, T* ptr) 1036 1036 { 1037 1037 if (ptr < begin() || ptr >= end()) { … … 1245 1245 template<typename T, size_t inlineCapacity, typename OverflowHandler, size_t minCapacity> 1246 1246 template<typename U> 1247 void Vector<T, inlineCapacity, OverflowHandler, minCapacity>::append(const U* data, size_t dataSize)1247 ALWAYS_INLINE void Vector<T, inlineCapacity, OverflowHandler, minCapacity>::append(const U* data, size_t dataSize) 1248 1248 { 1249 1249 size_t newSize = m_size + dataSize; … … 1262 1262 template<typename T, size_t inlineCapacity, typename OverflowHandler, size_t minCapacity> 1263 1263 template<typename U> 1264 bool Vector<T, inlineCapacity, OverflowHandler, minCapacity>::tryAppend(const U* data, size_t dataSize)1264 ALWAYS_INLINE bool Vector<T, inlineCapacity, OverflowHandler, minCapacity>::tryAppend(const U* data, size_t dataSize) 1265 1265 { 1266 1266 size_t newSize = m_size + dataSize;
Note: See TracChangeset
for help on using the changeset viewer.