Diff
Modified: trunk/Source/_javascript_Core/ChangeLog (252389 => 252390)
--- trunk/Source/_javascript_Core/ChangeLog 2019-11-13 02:07:30 UTC (rev 252389)
+++ trunk/Source/_javascript_Core/ChangeLog 2019-11-13 02:25:44 UTC (rev 252390)
@@ -1,5 +1,37 @@
2019-11-12 Yusuke Suzuki <[email protected]>
+ [JSC] Put more things in IsoSubspace
+ https://bugs.webkit.org/show_bug.cgi?id=204039
+
+ Reviewed by Keith Miller and Saam Barati.
+
+ This patch puts following things into IsoSubspace.
+
+ 1. UnlinkedEvalCodeBlock
+ 2. UnlinkedFunctionCodeBlock
+ 3. UnlinkedModuleProgramCodeBlock
+ 4. UnlinkedModuleProgramCodeBlock
+ 5. Symbol
+ 6. JSString
+ 7. JSRopeString
+ 8. GetterSetter
+
+ * bytecode/UnlinkedCodeBlock.h:
+ (JSC::UnlinkedCodeBlock::subspaceFor):
+ * bytecode/UnlinkedEvalCodeBlock.h:
+ * bytecode/UnlinkedFunctionCodeBlock.h:
+ * bytecode/UnlinkedModuleProgramCodeBlock.h:
+ * bytecode/UnlinkedProgramCodeBlock.h:
+ * runtime/GetterSetter.h:
+ * runtime/JSString.h:
+ (JSC::JSString::subspaceFor):
+ * runtime/Symbol.h:
+ * runtime/VM.cpp:
+ (JSC::VM::VM):
+ * runtime/VM.h:
+
+2019-11-12 Yusuke Suzuki <[email protected]>
+
[JSC] JSC GC relies on CodeBlock is not PreciseAllocation
https://bugs.webkit.org/show_bug.cgi?id=204124
Modified: trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h (252389 => 252390)
--- trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h 2019-11-13 02:07:30 UTC (rev 252389)
+++ trunk/Source/_javascript_Core/bytecode/UnlinkedCodeBlock.h 2019-11-13 02:25:44 UTC (rev 252390)
@@ -112,6 +112,13 @@
static constexpr bool needsDestruction = true;
+ template<typename, SubspaceAccess>
+ static IsoSubspace* subspaceFor(VM&)
+ {
+ ASSERT_NOT_REACHED();
+ return nullptr;
+ }
+
enum { CallFunction, ApplyFunction };
bool isConstructor() const { return m_isConstructor; }
Modified: trunk/Source/_javascript_Core/bytecode/UnlinkedEvalCodeBlock.h (252389 => 252390)
--- trunk/Source/_javascript_Core/bytecode/UnlinkedEvalCodeBlock.h 2019-11-13 02:07:30 UTC (rev 252389)
+++ trunk/Source/_javascript_Core/bytecode/UnlinkedEvalCodeBlock.h 2019-11-13 02:25:44 UTC (rev 252390)
@@ -36,6 +36,12 @@
typedef UnlinkedGlobalCodeBlock Base;
static constexpr unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal;
+ template<typename CellType, SubspaceAccess mode>
+ static IsoSubspace* subspaceFor(VM& vm)
+ {
+ return vm.unlinkedEvalCodeBlockSpace<mode>();
+ }
+
static UnlinkedEvalCodeBlock* create(VM& vm, const ExecutableInfo& info, OptionSet<CodeGenerationMode> codeGenerationMode)
{
UnlinkedEvalCodeBlock* instance = new (NotNull, allocateCell<UnlinkedEvalCodeBlock>(vm.heap)) UnlinkedEvalCodeBlock(vm, vm.unlinkedEvalCodeBlockStructure.get(), info, codeGenerationMode);
Modified: trunk/Source/_javascript_Core/bytecode/UnlinkedFunctionCodeBlock.h (252389 => 252390)
--- trunk/Source/_javascript_Core/bytecode/UnlinkedFunctionCodeBlock.h 2019-11-13 02:07:30 UTC (rev 252389)
+++ trunk/Source/_javascript_Core/bytecode/UnlinkedFunctionCodeBlock.h 2019-11-13 02:25:44 UTC (rev 252390)
@@ -36,6 +36,12 @@
typedef UnlinkedCodeBlock Base;
static constexpr unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal;
+ template<typename CellType, SubspaceAccess mode>
+ static IsoSubspace* subspaceFor(VM& vm)
+ {
+ return vm.unlinkedFunctionCodeBlockSpace<mode>();
+ }
+
static UnlinkedFunctionCodeBlock* create(VM& vm, CodeType codeType, const ExecutableInfo& info, OptionSet<CodeGenerationMode> codeGenerationMode)
{
UnlinkedFunctionCodeBlock* instance = new (NotNull, allocateCell<UnlinkedFunctionCodeBlock>(vm.heap)) UnlinkedFunctionCodeBlock(vm, vm.unlinkedFunctionCodeBlockStructure.get(), codeType, info, codeGenerationMode);
Modified: trunk/Source/_javascript_Core/bytecode/UnlinkedModuleProgramCodeBlock.h (252389 => 252390)
--- trunk/Source/_javascript_Core/bytecode/UnlinkedModuleProgramCodeBlock.h 2019-11-13 02:07:30 UTC (rev 252389)
+++ trunk/Source/_javascript_Core/bytecode/UnlinkedModuleProgramCodeBlock.h 2019-11-13 02:25:44 UTC (rev 252390)
@@ -37,6 +37,12 @@
typedef UnlinkedGlobalCodeBlock Base;
static constexpr unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal;
+ template<typename CellType, SubspaceAccess mode>
+ static IsoSubspace* subspaceFor(VM& vm)
+ {
+ return vm.unlinkedModuleProgramCodeBlockSpace<mode>();
+ }
+
static UnlinkedModuleProgramCodeBlock* create(VM& vm, const ExecutableInfo& info, OptionSet<CodeGenerationMode> codeGenerationMode)
{
UnlinkedModuleProgramCodeBlock* instance = new (NotNull, allocateCell<UnlinkedModuleProgramCodeBlock>(vm.heap)) UnlinkedModuleProgramCodeBlock(vm, vm.unlinkedModuleProgramCodeBlockStructure.get(), info, codeGenerationMode);
Modified: trunk/Source/_javascript_Core/bytecode/UnlinkedProgramCodeBlock.h (252389 => 252390)
--- trunk/Source/_javascript_Core/bytecode/UnlinkedProgramCodeBlock.h 2019-11-13 02:07:30 UTC (rev 252389)
+++ trunk/Source/_javascript_Core/bytecode/UnlinkedProgramCodeBlock.h 2019-11-13 02:25:44 UTC (rev 252390)
@@ -36,6 +36,12 @@
typedef UnlinkedGlobalCodeBlock Base;
static constexpr unsigned StructureFlags = Base::StructureFlags | StructureIsImmortal;
+ template<typename CellType, SubspaceAccess mode>
+ static IsoSubspace* subspaceFor(VM& vm)
+ {
+ return vm.unlinkedProgramCodeBlockSpace<mode>();
+ }
+
static UnlinkedProgramCodeBlock* create(VM& vm, const ExecutableInfo& info, OptionSet<CodeGenerationMode> codeGenerationMode)
{
UnlinkedProgramCodeBlock* instance = new (NotNull, allocateCell<UnlinkedProgramCodeBlock>(vm.heap)) UnlinkedProgramCodeBlock(vm, vm.unlinkedProgramCodeBlockStructure.get(), info, codeGenerationMode);
Modified: trunk/Source/_javascript_Core/runtime/GetterSetter.h (252389 => 252390)
--- trunk/Source/_javascript_Core/runtime/GetterSetter.h 2019-11-13 02:07:30 UTC (rev 252389)
+++ trunk/Source/_javascript_Core/runtime/GetterSetter.h 2019-11-13 02:25:44 UTC (rev 252390)
@@ -56,6 +56,12 @@
static constexpr unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot | StructureIsImmortal;
+ template<typename CellType, SubspaceAccess>
+ static IsoSubspace* subspaceFor(VM& vm)
+ {
+ return &vm.getterSetterSpace;
+ }
+
static GetterSetter* create(VM& vm, JSGlobalObject* globalObject, JSObject* getter, JSObject* setter)
{
GetterSetter* getterSetter = new (NotNull, allocateCell<GetterSetter>(vm.heap)) GetterSetter(vm, globalObject, getter, setter);
Modified: trunk/Source/_javascript_Core/runtime/JSString.h (252389 => 252390)
--- trunk/Source/_javascript_Core/runtime/JSString.h 2019-11-13 02:07:30 UTC (rev 252389)
+++ trunk/Source/_javascript_Core/runtime/JSString.h 2019-11-13 02:25:44 UTC (rev 252390)
@@ -97,7 +97,7 @@
// We specialize the string subspace to get the fastest possible sweep. This wouldn't be
// necessary if JSString didn't have a destructor.
template<typename, SubspaceAccess>
- static CompleteSubspace* subspaceFor(VM& vm)
+ static IsoSubspace* subspaceFor(VM& vm)
{
return &vm.stringSpace;
}
@@ -255,6 +255,12 @@
class JSRopeString final : public JSString {
friend class JSString;
public:
+ template<typename, SubspaceAccess>
+ static IsoSubspace* subspaceFor(VM& vm)
+ {
+ return &vm.ropeStringSpace;
+ }
+
// We use lower 3bits of fiber0 for flags. These bits are usable due to alignment, and it is OK even in 32bit architecture.
static constexpr uintptr_t is8BitInPointer = static_cast<uintptr_t>(StringImpl::flagIs8Bit());
static constexpr uintptr_t isSubstringInPointer = 0x2;
Modified: trunk/Source/_javascript_Core/runtime/Symbol.h (252389 => 252390)
--- trunk/Source/_javascript_Core/runtime/Symbol.h 2019-11-13 02:07:30 UTC (rev 252389)
+++ trunk/Source/_javascript_Core/runtime/Symbol.h 2019-11-13 02:25:44 UTC (rev 252390)
@@ -40,6 +40,12 @@
static constexpr bool needsDestruction = true;
+ template<typename CellType, SubspaceAccess mode>
+ static IsoSubspace* subspaceFor(VM& vm)
+ {
+ return vm.symbolSpace<mode>();
+ }
+
static Structure* createStructure(VM& vm, JSGlobalObject* globalObject, JSValue prototype)
{
return Structure::create(vm, globalObject, prototype, TypeInfo(SymbolType, StructureFlags), info());
Modified: trunk/Source/_javascript_Core/runtime/VM.cpp (252389 => 252390)
--- trunk/Source/_javascript_Core/runtime/VM.cpp 2019-11-13 02:07:30 UTC (rev 252389)
+++ trunk/Source/_javascript_Core/runtime/VM.cpp 2019-11-13 02:25:44 UTC (rev 252390)
@@ -274,13 +274,15 @@
, cellSpace("JSCell", heap, cellHeapCellType.get(), fastMallocAllocator.get()) // Hash:0xadfb5a79
, variableSizedCellSpace("Variable Sized JSCell", heap, cellHeapCellType.get(), fastMallocAllocator.get()) // Hash:0xbcd769cc
, destructibleCellSpace("Destructible JSCell", heap, destructibleCellHeapCellType.get(), fastMallocAllocator.get()) // Hash:0xbfff3d73
- , stringSpace("JSString", heap, stringHeapCellType.get(), fastMallocAllocator.get()) // Hash:0x90cf758f
, destructibleObjectSpace("JSDestructibleObject", heap, destructibleObjectHeapCellType.get(), fastMallocAllocator.get()) // Hash:0x4f5ed7a9
, executableToCodeBlockEdgeSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), ExecutableToCodeBlockEdge) // Hash:0x7b730b20
, functionSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), JSFunction) // Hash:0x800fca72
+ , getterSetterSpace ISO_SUBSPACE_INIT(heap, cellHeapCellType.get(), GetterSetter)
, internalFunctionSpace ISO_SUBSPACE_INIT(heap, destructibleObjectHeapCellType.get(), InternalFunction) // Hash:0xf845c464
, nativeExecutableSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), NativeExecutable) // Hash:0x67567f95
, propertyTableSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), PropertyTable) // Hash:0xc6bc9f12
+ , stringSpace ISO_SUBSPACE_INIT(heap, stringHeapCellType.get(), JSString) // Hash:0x90cf758f
+ , ropeStringSpace ISO_SUBSPACE_INIT(heap, stringHeapCellType.get(), JSRopeString)
, structureRareDataSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), StructureRareData) // Hash:0xaca4e62d
, structureSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), Structure) // Hash:0x1f1bcdca
, symbolTableSpace ISO_SUBSPACE_INIT(heap, destructibleCellHeapCellType.get(), SymbolTable) // Hash:0xc5215afd
@@ -1293,6 +1295,11 @@
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(errorInstanceSpace, destructibleObjectHeapCellType.get(), ErrorInstance) // Hash:0x3f40d4a
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(nativeStdFunctionSpace, cellHeapCellType.get(), JSNativeStdFunction) // Hash:0x70ed61e4
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(proxyRevokeSpace, destructibleObjectHeapCellType.get(), ProxyRevoke) // Hash:0xb506a939
+DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(symbolSpace, destructibleCellHeapCellType.get(), Symbol)
+DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(unlinkedEvalCodeBlockSpace, destructibleCellHeapCellType.get(), UnlinkedEvalCodeBlock)
+DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(unlinkedFunctionCodeBlockSpace, destructibleCellHeapCellType.get(), UnlinkedFunctionCodeBlock)
+DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(unlinkedModuleProgramCodeBlockSpace, destructibleCellHeapCellType.get(), UnlinkedModuleProgramCodeBlock)
+DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(unlinkedProgramCodeBlockSpace, destructibleCellHeapCellType.get(), UnlinkedProgramCodeBlock)
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(weakMapSpace, destructibleObjectHeapCellType.get(), JSWeakMap) // Hash:0x662b12a3
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(weakSetSpace, destructibleObjectHeapCellType.get(), JSWeakSet) // Hash:0x4c781b30
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(weakObjectRefSpace, cellHeapCellType.get(), JSWeakObjectRef) // Hash:0x8ec68f1f
Modified: trunk/Source/_javascript_Core/runtime/VM.h (252389 => 252390)
--- trunk/Source/_javascript_Core/runtime/VM.h 2019-11-13 02:07:30 UTC (rev 252389)
+++ trunk/Source/_javascript_Core/runtime/VM.h 2019-11-13 02:25:44 UTC (rev 252390)
@@ -374,14 +374,16 @@
CompleteSubspace cellSpace;
CompleteSubspace variableSizedCellSpace; // FIXME: This space is problematic because we have things in here like DirectArguments and ScopedArguments; those should be split into JSValueOOB cells and JSValueStrict auxiliaries. https://bugs.webkit.org/show_bug.cgi?id=182858
CompleteSubspace destructibleCellSpace;
- CompleteSubspace stringSpace;
CompleteSubspace destructibleObjectSpace;
IsoSubspace executableToCodeBlockEdgeSpace;
IsoSubspace functionSpace;
+ IsoSubspace getterSetterSpace;
IsoSubspace internalFunctionSpace;
IsoSubspace nativeExecutableSpace;
IsoSubspace propertyTableSpace;
+ IsoSubspace stringSpace;
+ IsoSubspace ropeStringSpace;
IsoSubspace structureRareDataSpace;
IsoSubspace structureSpace;
IsoSubspace symbolTableSpace;
@@ -407,6 +409,11 @@
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(errorInstanceSpace)
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(nativeStdFunctionSpace)
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(proxyRevokeSpace)
+ DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(symbolSpace)
+ DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(unlinkedEvalCodeBlockSpace)
+ DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(unlinkedFunctionCodeBlockSpace)
+ DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(unlinkedModuleProgramCodeBlockSpace)
+ DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(unlinkedProgramCodeBlockSpace)
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(weakObjectRefSpace)
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(weakSetSpace)
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(weakMapSpace)