Skip to content

Commit 57d315a

Browse files
committed
[JSC] Put DebuggerScope in IsoSubspace
https://bugs.webkit.org/show_bug.cgi?id=205303 Reviewed by Mark Lam. Put DebuggerScope in IsoSubspace, and refine empty `subspaceFor` implementations. * bytecode/CodeBlock.h: (JSC::CodeBlock::subspaceFor): * bytecode/UnlinkedCodeBlock.h: (JSC::UnlinkedCodeBlock::subspaceFor): * debugger/DebuggerScope.h: * runtime/AbstractModuleRecord.h: (JSC::AbstractModuleRecord::subspaceFor): * runtime/JSArrayBufferView.h: (JSC::JSArrayBufferView::subspaceFor): * runtime/JSInternalFieldObjectImpl.h: (JSC::JSInternalFieldObjectImpl::subspaceFor): * runtime/JSWrapperObject.h: (JSC::JSWrapperObject::subspaceFor): * runtime/VM.cpp: * runtime/VM.h: Canonical link: https://commits.webkit.org/218501@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@253588 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent a7f5569 commit 57d315a

10 files changed

Lines changed: 50 additions & 11 deletions

File tree

‎Source/JavaScriptCore/ChangeLog‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
2019-12-16 Yusuke Suzuki <ysuzuki@apple.com>
2+
3+
[JSC] Put DebuggerScope in IsoSubspace
4+
https://bugs.webkit.org/show_bug.cgi?id=205303
5+
6+
Reviewed by Mark Lam.
7+
8+
Put DebuggerScope in IsoSubspace, and refine empty `subspaceFor` implementations.
9+
10+
* bytecode/CodeBlock.h:
11+
(JSC::CodeBlock::subspaceFor):
12+
* bytecode/UnlinkedCodeBlock.h:
13+
(JSC::UnlinkedCodeBlock::subspaceFor):
14+
* debugger/DebuggerScope.h:
15+
* runtime/AbstractModuleRecord.h:
16+
(JSC::AbstractModuleRecord::subspaceFor):
17+
* runtime/JSArrayBufferView.h:
18+
(JSC::JSArrayBufferView::subspaceFor):
19+
* runtime/JSInternalFieldObjectImpl.h:
20+
(JSC::JSInternalFieldObjectImpl::subspaceFor):
21+
* runtime/JSWrapperObject.h:
22+
(JSC::JSWrapperObject::subspaceFor):
23+
* runtime/VM.cpp:
24+
* runtime/VM.h:
25+
126
2019-12-16 Yusuke Suzuki <ysuzuki@apple.com>
227

328
[JSC] Move JSCell::subspaceFor to JSObject::subspaceFor, removing destructibleCellSpace

‎Source/JavaScriptCore/bytecode/CodeBlock.h‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,10 @@ class CodeBlock : public JSCell {
116116
static constexpr bool needsDestruction = true;
117117

118118
template<typename, SubspaceAccess>
119-
static IsoSubspace* subspaceFor(VM&) { return nullptr; }
119+
static void subspaceFor(VM&)
120+
{
121+
RELEASE_ASSERT_NOT_REACHED();
122+
}
120123
// GC strongly assumes CodeBlock is not a PreciseAllocation for now.
121124
static constexpr uint8_t numberOfLowerTierCells = 0;
122125

‎Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,9 @@ class UnlinkedCodeBlock : public JSCell {
113113
static constexpr bool needsDestruction = true;
114114

115115
template<typename, SubspaceAccess>
116-
static IsoSubspace* subspaceFor(VM&)
116+
static void subspaceFor(VM&)
117117
{
118-
ASSERT_NOT_REACHED();
119-
return nullptr;
118+
RELEASE_ASSERT_NOT_REACHED();
120119
}
121120

122121
enum { CallFunction, ApplyFunction };

‎Source/JavaScriptCore/debugger/DebuggerScope.h‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,15 @@ class JSScope;
3535

3636
class DebuggerScope final : public JSNonFinalObject {
3737
public:
38-
typedef JSNonFinalObject Base;
38+
using Base = JSNonFinalObject;
3939
static constexpr unsigned StructureFlags = Base::StructureFlags | OverridesGetOwnPropertySlot | OverridesGetPropertyNames;
4040

41+
template<typename CellType, SubspaceAccess mode>
42+
static IsoSubspace* subspaceFor(VM& vm)
43+
{
44+
return vm.debuggerScopeSpace<mode>();
45+
}
46+
4147
JS_EXPORT_PRIVATE static DebuggerScope* create(VM& vm, JSScope* scope);
4248

4349
static void visitChildren(JSCell*, SlotVisitor&);

‎Source/JavaScriptCore/runtime/AbstractModuleRecord.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,9 @@ class AbstractModuleRecord : public JSNonFinalObject {
4545
static constexpr bool needsDestruction = true;
4646

4747
template<typename CellType, SubspaceAccess>
48-
static IsoSubspace* subspaceFor(VM&)
48+
static void subspaceFor(VM&)
4949
{
5050
RELEASE_ASSERT_NOT_REACHED();
51-
return nullptr;
5251
}
5352

5453
// https://tc39.github.io/ecma262/#sec-source-text-module-records

‎Source/JavaScriptCore/runtime/JSArrayBufferView.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,9 @@ class JSArrayBufferView : public JSNonFinalObject {
9898
using Base = JSNonFinalObject;
9999

100100
template<typename, SubspaceAccess>
101-
static IsoSubspace* subspaceFor(VM&)
101+
static void subspaceFor(VM&)
102102
{
103103
RELEASE_ASSERT_NOT_REACHED();
104-
return nullptr;
105104
}
106105

107106
static constexpr unsigned fastSizeLimit = 1000;

‎Source/JavaScriptCore/runtime/JSInternalFieldObjectImpl.h‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ class JSInternalFieldObjectImpl : public JSNonFinalObject {
3838
using Base = JSNonFinalObject;
3939
static constexpr unsigned numberOfInternalFields = passedNumberOfInternalFields;
4040

41+
template<typename CellType, SubspaceAccess>
42+
static void subspaceFor(VM&)
43+
{
44+
RELEASE_ASSERT_NOT_REACHED();
45+
}
46+
4147
static size_t allocationSize(Checked<size_t> inlineCapacity)
4248
{
4349
ASSERT_UNUSED(inlineCapacity, !inlineCapacity);

‎Source/JavaScriptCore/runtime/JSWrapperObject.h‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,9 @@ class JSWrapperObject : public JSNonFinalObject {
3232
using Base = JSNonFinalObject;
3333

3434
template<typename, SubspaceAccess>
35-
static IsoSubspace* subspaceFor(VM&)
35+
static void subspaceFor(VM&)
3636
{
3737
RELEASE_ASSERT_NOT_REACHED();
38-
return nullptr;
3938
}
4039

4140
static size_t allocationSize(Checked<size_t> inlineCapacity)

‎Source/JavaScriptCore/runtime/VM.cpp‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include "DFGWorklist.h"
4444
#include "DOMAttributeGetterSetter.h"
4545
#include "DateInstance.h"
46+
#include "DebuggerScope.h"
4647
#include "DirectEvalExecutable.h"
4748
#include "Disassembler.h"
4849
#include "DoublePredictionFuzzerAgent.h"
@@ -1395,6 +1396,7 @@ DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(callbackFunctionSpace, cellHeapCellType.
13951396
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(callbackObjectSpace, callbackObjectHeapCellType.get(), JSCallbackObject<JSNonFinalObject>)
13961397
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(customGetterSetterFunctionSpace, cellHeapCellType.get(), JSCustomGetterSetterFunction) // Hash:0x18091000
13971398
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(dataViewSpace, cellHeapCellType.get(), JSDataView)
1399+
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(debuggerScopeSpace, cellHeapCellType.get(), DebuggerScope)
13981400
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(errorInstanceSpace, errorInstanceHeapCellType.get(), ErrorInstance) // Hash:0x3f40d4a
13991401
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(float32ArraySpace, cellHeapCellType.get(), JSFloat32Array)
14001402
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER_SLOW(float64ArraySpace, cellHeapCellType.get(), JSFloat64Array)

‎Source/JavaScriptCore/runtime/VM.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,7 @@ class VM : public ThreadSafeRefCounted<VM>, public DoublyLinkedListNode<VM> {
500500
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(callbackObjectSpace)
501501
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(customGetterSetterFunctionSpace)
502502
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(dataViewSpace)
503+
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(debuggerScopeSpace)
503504
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(errorInstanceSpace)
504505
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(float32ArraySpace)
505506
DYNAMIC_ISO_SUBSPACE_DEFINE_MEMBER(float64ArraySpace)

0 commit comments

Comments
 (0)