WebKit Bugzilla
Attachment 368430 Details for
Bug 197351
: [JSC] Remove IsoSubspacePerVM
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-197351-20190428052419.patch (text/plain), 16.36 KB, created by
Yusuke Suzuki
on 2019-04-28 05:24:19 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Yusuke Suzuki
Created:
2019-04-28 05:24:19 PDT
Size:
16.36 KB
patch
obsolete
>Subversion Revision: 244723 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index 28aeca460ca65580a9ae60e98de7e15fada6d41b..e3507f96390c4b44f53eed58fd2aaa368212e453 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -1,3 +1,25 @@ >+2019-04-28 Yusuke Suzuki <ysuzuki@apple.com> >+ >+ [JSC] Remove IsoSubspacePerVM >+ https://bugs.webkit.org/show_bug.cgi?id=197351 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Since we now have the feature creating IsoSubspace dynamically, IsoSubspacePerVM should be replaced with this. >+ This patch removes IsoSubspacePerVM. >+ >+ * API/glib/JSCCallbackFunction.cpp: >+ (JSC::JSCCallbackFunction::subspaceForImpl): Deleted. >+ * API/glib/JSCCallbackFunction.h: >+ (JSC::JSCCallbackFunction::subspaceFor): >+ * CMakeLists.txt: >+ * JavaScriptCore.xcodeproj/project.pbxproj: >+ * Sources.txt: >+ * heap/IsoSubspacePerVM.cpp: Removed. >+ * heap/IsoSubspacePerVM.h: Removed. >+ * runtime/VM.cpp: >+ * runtime/VM.h: >+ > 2019-04-26 Keith Rollin <krollin@apple.com> > > Enable new build rule for post-processing headers when using XCBuild >diff --git a/Source/JavaScriptCore/API/glib/JSCCallbackFunction.cpp b/Source/JavaScriptCore/API/glib/JSCCallbackFunction.cpp >index 7bd2c1a7b5ca326cf4f182ff2aec54a2a10bdd82..87528f5d0a6a548f3b20edb4f12939167ffff6c2 100644 >--- a/Source/JavaScriptCore/API/glib/JSCCallbackFunction.cpp >+++ b/Source/JavaScriptCore/API/glib/JSCCallbackFunction.cpp >@@ -29,7 +29,6 @@ > > #include "APICallbackFunction.h" > #include "APICast.h" >-#include "IsoSubspacePerVM.h" > #include "JSCClassPrivate.h" > #include "JSCContextPrivate.h" > #include "JSDestructibleObjectHeapCellType.h" >@@ -223,10 +222,4 @@ void JSCCallbackFunction::destroy(JSCell* cell) > static_cast<JSCCallbackFunction*>(cell)->JSCCallbackFunction::~JSCCallbackFunction(); > } > >-IsoSubspace* JSCCallbackFunction::subspaceForImpl(VM& vm) >-{ >- NeverDestroyed<IsoSubspacePerVM> perVM([] (VM& vm) -> IsoSubspacePerVM::SubspaceParameters { return ISO_SUBSPACE_PARAMETERS(vm.destructibleObjectHeapCellType.get(), JSCCallbackFunction); }); >- return &perVM.get().forVM(vm); >-} >- > } // namespace JSC >diff --git a/Source/JavaScriptCore/API/glib/JSCCallbackFunction.h b/Source/JavaScriptCore/API/glib/JSCCallbackFunction.h >index 2c59b9b84fc8630284e318e6235f07026eccc23d..03a8ecec1d4281f8bc7307239ede3a11ea7ec610 100644 >--- a/Source/JavaScriptCore/API/glib/JSCCallbackFunction.h >+++ b/Source/JavaScriptCore/API/glib/JSCCallbackFunction.h >@@ -40,10 +40,10 @@ class JSCCallbackFunction : public InternalFunction { > public: > typedef InternalFunction Base; > >- template<typename CellType, SubspaceAccess> >+ template<typename CellType, SubspaceAccess mode> > static IsoSubspace* subspaceFor(VM& vm) > { >- return subspaceForImpl(vm); >+ return vm.glibCallbackFunctionSpace<mode>(); > } > > enum class Type { >@@ -67,8 +67,6 @@ class JSCCallbackFunction : public InternalFunction { > JSObjectRef construct(JSContextRef, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception); > > private: >- static IsoSubspace* subspaceForImpl(VM&); >- > JSCCallbackFunction(VM&, Structure*, Type, JSCClass*, GRefPtr<GClosure>&&, GType, Optional<Vector<GType>>&&); > > JSObjectCallAsFunctionCallback functionCallback() { return m_functionCallback; } >diff --git a/Source/JavaScriptCore/CMakeLists.txt b/Source/JavaScriptCore/CMakeLists.txt >index ab69001d00519539a9134923a1f79165fc6a845e..d505a1b34b8fa9e0cea9072990d52784f588390f 100644 >--- a/Source/JavaScriptCore/CMakeLists.txt >+++ b/Source/JavaScriptCore/CMakeLists.txt >@@ -593,7 +593,6 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS > heap/IsoCellSet.h > heap/IsoSubspace.h > heap/IsoSubspaceInlines.h >- heap/IsoSubspacePerVM.h > heap/LargeAllocation.h > heap/LocalAllocator.h > heap/LocalAllocatorInlines.h >diff --git a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj >index d8b2aab3477dd928798c932573ec5a856113c61c..1ded7e24c4d222846369fafcafe65bc729be96ed 100644 >--- a/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj >+++ b/Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj >@@ -372,7 +372,6 @@ > 0F5CF9841E9D537700C18692 /* AirLowerStackArgs.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5CF9831E9D537500C18692 /* AirLowerStackArgs.h */; }; > 0F5CF9891E9ED65200C18692 /* AirStackAllocation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5CF9871E9ED64E00C18692 /* AirStackAllocation.h */; }; > 0F5E0FD8207C72730097F0DE /* DFGAbstractInterpreterClobberState.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5E0FD6207C72710097F0DE /* DFGAbstractInterpreterClobberState.h */; }; >- 0F5E0FE72086AD480097F0DE /* IsoSubspacePerVM.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5E0FE52086AD460097F0DE /* IsoSubspacePerVM.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0F5EF91F16878F7D003E5C25 /* JITThunks.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F5EF91C16878F78003E5C25 /* JITThunks.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0F60FE901FFC37020003320A /* ExecutableToCodeBlockEdge.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F60FE8E1FFC36FD0003320A /* ExecutableToCodeBlockEdge.h */; settings = {ATTRIBUTES = (Private, ); }; }; > 0F61832A1C45BF070072450B /* AirCCallingConvention.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6183211C45BF070072450B /* AirCCallingConvention.h */; }; >@@ -2505,8 +2504,6 @@ > 0F5D085C1B8CF99D001143B4 /* DFGNodeOrigin.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGNodeOrigin.cpp; path = dfg/DFGNodeOrigin.cpp; sourceTree = "<group>"; }; > 0F5E0FD6207C72710097F0DE /* DFGAbstractInterpreterClobberState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = DFGAbstractInterpreterClobberState.h; path = dfg/DFGAbstractInterpreterClobberState.h; sourceTree = "<group>"; }; > 0F5E0FD7207C72710097F0DE /* DFGAbstractInterpreterClobberState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = DFGAbstractInterpreterClobberState.cpp; path = dfg/DFGAbstractInterpreterClobberState.cpp; sourceTree = "<group>"; }; >- 0F5E0FE52086AD460097F0DE /* IsoSubspacePerVM.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IsoSubspacePerVM.h; sourceTree = "<group>"; }; >- 0F5E0FE62086AD470097F0DE /* IsoSubspacePerVM.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IsoSubspacePerVM.cpp; sourceTree = "<group>"; }; > 0F5EF91B16878F78003E5C25 /* JITThunks.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITThunks.cpp; sourceTree = "<group>"; }; > 0F5EF91C16878F78003E5C25 /* JITThunks.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITThunks.h; sourceTree = "<group>"; }; > 0F60FE8D1FFC36FC0003320A /* ExecutableToCodeBlockEdge.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExecutableToCodeBlockEdge.cpp; sourceTree = "<group>"; }; >@@ -5990,8 +5987,6 @@ > 0FDCE12C1FAFB4DE006F3901 /* IsoSubspace.cpp */, > 0FDCE12B1FAFB4DE006F3901 /* IsoSubspace.h */, > 0FD2FD9220B52BDC00F09441 /* IsoSubspaceInlines.h */, >- 0F5E0FE62086AD470097F0DE /* IsoSubspacePerVM.cpp */, >- 0F5E0FE52086AD460097F0DE /* IsoSubspacePerVM.h */, > 0F766D2915A8CC34008F363E /* JITStubRoutineSet.cpp */, > 0F766D2A15A8CC34008F363E /* JITStubRoutineSet.h */, > 0F070A451D543A89006E7232 /* LargeAllocation.cpp */, >@@ -9331,7 +9326,6 @@ > 0FB467811FDDA6F7003FCB09 /* IsoCellSetInlines.h in Headers */, > 0FDCE12D1FAFB4E5006F3901 /* IsoSubspace.h in Headers */, > 0FD2FD9520B52BE200F09441 /* IsoSubspaceInlines.h in Headers */, >- 0F5E0FE72086AD480097F0DE /* IsoSubspacePerVM.h in Headers */, > 8B9F6D561D5912FA001C739F /* IterationKind.h in Headers */, > FE4D55B81AE716CA0052E459 /* IterationStatus.h in Headers */, > 70113D4C1A8DB093003848C4 /* IteratorOperations.h in Headers */, >diff --git a/Source/JavaScriptCore/Sources.txt b/Source/JavaScriptCore/Sources.txt >index f5534441390d1a608aae0dc28ffbef31868329b4..923103f09a4338464d5d8347b4868b7b47ce972a 100644 >--- a/Source/JavaScriptCore/Sources.txt >+++ b/Source/JavaScriptCore/Sources.txt >@@ -520,7 +520,6 @@ heap/IncrementalSweeper.cpp > heap/IsoAlignedMemoryAllocator.cpp > heap/IsoCellSet.cpp > heap/IsoSubspace.cpp >-heap/IsoSubspacePerVM.cpp > heap/JITStubRoutineSet.cpp > heap/LargeAllocation.cpp > heap/LocalAllocator.cpp >diff --git a/Source/JavaScriptCore/heap/IsoSubspacePerVM.cpp b/Source/JavaScriptCore/heap/IsoSubspacePerVM.cpp >deleted file mode 100644 >index bbc499f56497246671f4bc851b4e96b1ec69d2f2..0000000000000000000000000000000000000000 >--- a/Source/JavaScriptCore/heap/IsoSubspacePerVM.cpp >+++ /dev/null >@@ -1,73 +0,0 @@ >-/* >- * Copyright (C) 2018 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#include "config.h" >-#include "IsoSubspacePerVM.h" >- >-#include "JSCInlines.h" >- >-namespace JSC { >- >-class IsoSubspacePerVM::AutoremovingIsoSubspace : public IsoSubspace { >-public: >- AutoremovingIsoSubspace(IsoSubspacePerVM& perVM, CString name, Heap& heap, HeapCellType* heapCellType, size_t size) >- : IsoSubspace(name, heap, heapCellType, size) >- , m_perVM(perVM) >- { >- } >- >- ~AutoremovingIsoSubspace() >- { >- auto locker = holdLock(m_perVM.m_lock); >- m_perVM.m_subspacePerVM.remove(space().heap()->vm()); >- } >- >-private: >- IsoSubspacePerVM& m_perVM; >-}; >- >-IsoSubspacePerVM::IsoSubspacePerVM(Function<SubspaceParameters(VM&)> subspaceParameters) >- : m_subspaceParameters(WTFMove(subspaceParameters)) >-{ >-} >- >-IsoSubspacePerVM::~IsoSubspacePerVM() >-{ >- UNREACHABLE_FOR_PLATFORM(); >-} >- >-IsoSubspace& IsoSubspacePerVM::forVM(VM& vm) >-{ >- auto locker = holdLock(m_lock); >- auto result = m_subspacePerVM.add(&vm, nullptr); >- if (result.isNewEntry) { >- SubspaceParameters params = m_subspaceParameters(vm); >- result.iterator->value = new AutoremovingIsoSubspace(*this, params.name, vm.heap, params.heapCellType, params.size); >- } >- return *result.iterator->value; >-} >- >-} // namespace JSC >- >diff --git a/Source/JavaScriptCore/heap/IsoSubspacePerVM.h b/Source/JavaScriptCore/heap/IsoSubspacePerVM.h >deleted file mode 100644 >index 48e682b24ce0715a5ef0b3e02fc119abf5ef370f..0000000000000000000000000000000000000000 >--- a/Source/JavaScriptCore/heap/IsoSubspacePerVM.h >+++ /dev/null >@@ -1,73 +0,0 @@ >-/* >- * Copyright (C) 2018 Apple Inc. All rights reserved. >- * >- * Redistribution and use in source and binary forms, with or without >- * modification, are permitted provided that the following conditions >- * are met: >- * 1. Redistributions of source code must retain the above copyright >- * notice, this list of conditions and the following disclaimer. >- * 2. Redistributions in binary form must reproduce the above copyright >- * notice, this list of conditions and the following disclaimer in the >- * documentation and/or other materials provided with the distribution. >- * >- * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY >- * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE >- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR >- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR >- * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, >- * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, >- * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR >- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY >- * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT >- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE >- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. >- */ >- >-#pragma once >- >-#include "IsoSubspace.h" >-#include <wtf/Function.h> >-#include <wtf/HashMap.h> >-#include <wtf/Lock.h> >- >-namespace JSC { >- >-// This is an appropriate way to stash IsoSubspaces for rarely-used classes or classes that are mostly >-// sure to be main-thread-only. But if a class typically gets instantiated from multiple threads at >-// once, then this is not great, because concurrent allocations will probably contend on this thing's >-// lock. >-class IsoSubspacePerVM { >-public: >- struct SubspaceParameters { >- SubspaceParameters() { } >- >- SubspaceParameters(CString name, HeapCellType* heapCellType, size_t size) >- : name(WTFMove(name)) >- , heapCellType(heapCellType) >- , size(size) >- { >- } >- >- CString name; >- HeapCellType* heapCellType { nullptr }; >- size_t size { 0 }; >- }; >- >- JS_EXPORT_PRIVATE IsoSubspacePerVM(Function<SubspaceParameters(VM&)>); >- JS_EXPORT_PRIVATE ~IsoSubspacePerVM(); >- >- JS_EXPORT_PRIVATE IsoSubspace& forVM(VM&); >- >-private: >- class AutoremovingIsoSubspace; >- friend class AutoremovingIsoSubspace; >- >- Lock m_lock; >- HashMap<VM*, IsoSubspace*> m_subspacePerVM; >- Function<SubspaceParameters(VM&)> m_subspaceParameters; >-}; >- >-#define ISO_SUBSPACE_PARAMETERS(heapCellType, type) ::JSC::IsoSubspacePerVM::SubspaceParameters("Isolated " #type " Space", (heapCellType), sizeof(type)) >- >-} // namespace JSC >- >diff --git a/Source/JavaScriptCore/runtime/VM.cpp b/Source/JavaScriptCore/runtime/VM.cpp >index 12a768e05ce3c5e13785515315baccaced0def11..ccb059758eba4bc1b3c2c363612b12924cb00ca3 100644 >--- a/Source/JavaScriptCore/runtime/VM.cpp >+++ b/Source/JavaScriptCore/runtime/VM.cpp >@@ -172,6 +172,10 @@ > #include "RegExp.h" > #endif > >+#ifdef JSC_GLIB_API_ENABLED >+#include "JSCCallbackFunction.h" >+#endif >+ > namespace JSC { > > #if ENABLE(JIT) >@@ -1254,6 +1258,9 @@ DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(weakSetSpace, destructibleObjectHeapCell > #if JSC_OBJC_API_ENABLED > DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(objCCallbackFunctionSpace, destructibleObjectHeapCellType.get(), ObjCCallbackFunction) > #endif >+#ifdef JSC_GLIB_API_ENABLED >+DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(glibCallbackFunctionSpace, destructibleObjectHeapCellType.get(), JSCCallbackFunction) >+#endif > #if ENABLE(WEBASSEMBLY) > DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(webAssemblyCodeBlockSpace, webAssemblyCodeBlockHeapCellType.get(), JSWebAssemblyCodeBlock) > DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(webAssemblyFunctionSpace, webAssemblyFunctionHeapCellType.get(), WebAssemblyFunction) >diff --git a/Source/JavaScriptCore/runtime/VM.h b/Source/JavaScriptCore/runtime/VM.h >index b985d47ea4d95edddc9c0cf36689653376f7d1df..1831c9d4b3a73b1ee398e5ca515ecac62cb8fc76 100644 >--- a/Source/JavaScriptCore/runtime/VM.h >+++ b/Source/JavaScriptCore/runtime/VM.h >@@ -395,6 +395,9 @@ class VM : public ThreadSafeRefCounted<VM>, public DoublyLinkedListNode<VM> { > > #if JSC_OBJC_API_ENABLED > DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(objCCallbackFunctionSpace) >+#endif >+#ifdef JSC_GLIB_API_ENABLED >+ DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(glibCallbackFunctionSpace) > #endif > DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(boundFunctionSpace) > DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(callbackFunctionSpace)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197351
: 368430