Skip to content

Commit fe1e360

Browse files
committed
[WTF] Introduce FixedVector and use it for FixedOperands
https://bugs.webkit.org/show_bug.cgi?id=224171 Reviewed by Mark Lam. Source/JavaScriptCore: Define FixedOperands<T> which uses FixedVector for its storage. We use FixedOperands in FTL::OSRExitDescriptor. We also replace RefCountedArray<T> with FixedVector<T> if they are not requiring RefCountedArray<T>'s ref-counting semantics. * bytecode/BytecodeGeneratorification.cpp: (JSC::BytecodeGeneratorification::run): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::finishCreation): (JSC::CodeBlock::setConstantRegisters): (JSC::CodeBlock::setNumParameters): (JSC::CodeBlock::setRareCaseProfiles): (JSC::CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler): * bytecode/CodeBlock.h: * bytecode/Operands.h: (JSC::Operands::Operands): * bytecode/OperandsInlines.h: (JSC::U>::dumpInContext const): (JSC::U>::dump const): (JSC::Operands<T>::dumpInContext const): Deleted. (JSC::Operands<T>::dump const): Deleted. * bytecode/PolyProtoAccessChain.h: * bytecode/PolymorphicAccess.cpp: (JSC::PolymorphicAccess::regenerate): * bytecode/PolymorphicAccess.h: * bytecode/UnlinkedCodeBlock.cpp: (JSC::UnlinkedCodeBlock::dumpExpressionRangeInfo): (JSC::UnlinkedCodeBlock::expressionRangeForBytecodeIndex const): * bytecode/UnlinkedCodeBlock.h: (JSC::UnlinkedCodeBlock::expressionInfo): (JSC::UnlinkedCodeBlock::identifiers const): (JSC::UnlinkedCodeBlock::constantRegisters): (JSC::UnlinkedCodeBlock::constantsSourceCodeRepresentation): (JSC::UnlinkedCodeBlock::constantIdentifierSets): (JSC::UnlinkedCodeBlock::opProfileControlFlowBytecodeOffsets const): * bytecode/UnlinkedFunctionExecutable.h: * bytecompiler/BytecodeGenerator.cpp: (JSC::prepareJumpTableForSwitch): * dfg/DFGJITCode.h: * dfg/DFGPlan.h: (JSC::DFG::Plan::tierUpInLoopHierarchy): * ftl/FTLOSRExit.h: * jit/GCAwareJITStubRoutine.h: * jit/JIT.cpp: (JSC::JIT::privateCompileSlowCases): * jit/PolymorphicCallStubRoutine.h: * llint/LLIntOffsetsExtractor.cpp: * llint/LowLevelInterpreter.asm: * parser/Parser.cpp: (JSC::Parser<LexerType>::parseInner): (JSC::Parser<LexerType>::parseClassFieldInitializerSourceElements): * parser/Parser.h: (JSC::Parser<LexerType>::parse): (JSC::parse): * runtime/CachedTypes.cpp: (JSC::CachedVector::encode): (JSC::CachedVector::decode const): * wasm/js/JSWebAssemblyInstance.h: Source/WTF: This FixedVector<T> is a wrapper around RefCountedArray<T>, but this offers Vector-like copy / move semantics, so that we can use this FixedVector<T> as a drop-in-replacement for fixed-sized Vector fields. The purpose of that is saving memory by removing unnecessary storage (FixedVector is fixed-sized allocated) and putting size into the allocated memory. * WTF.xcodeproj/project.pbxproj: * wtf/CMakeLists.txt: * wtf/FastBitVector.h: (WTF::FastBitVector::FastBitVector): * wtf/FixedVector.h: Added. (WTF::FixedVector::FixedVector): (WTF::FixedVector::operator=): (WTF::FixedVector::size const): (WTF::FixedVector::isEmpty const): (WTF::FixedVector::byteSize const): (WTF::FixedVector::data): (WTF::FixedVector::begin): (WTF::FixedVector::end): (WTF::FixedVector::data const): (WTF::FixedVector::begin const): (WTF::FixedVector::end const): (WTF::FixedVector::rbegin): (WTF::FixedVector::rend): (WTF::FixedVector::rbegin const): (WTF::FixedVector::rend const): (WTF::FixedVector::at): (WTF::FixedVector::at const): (WTF::FixedVector::operator[]): (WTF::FixedVector::operator[] const): (WTF::FixedVector::first): (WTF::FixedVector::first const): (WTF::FixedVector::last): (WTF::FixedVector::last const): (WTF::FixedVector::fill): (WTF::FixedVector::operator== const): (WTF::FixedVector::swap): (WTF::swap): * wtf/RefCountedArray.h: (WTF::RefCountedArray::RefCountedArray): (WTF::RefCountedArray::fill): (WTF::RefCountedArray::swap): Tools: * TestWebKitAPI/CMakeLists.txt: * TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj: * TestWebKitAPI/Tests/WTF/FixedVector.cpp: Added. (TestWebKitAPI::TEST): (TestWebKitAPI::DestructorObserver::DestructorObserver): (TestWebKitAPI::DestructorObserver::~DestructorObserver): (TestWebKitAPI::DestructorObserver::operator=): Canonical link: https://commits.webkit.org/236198@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275542 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 0a80b45 commit fe1e360

35 files changed

Lines changed: 645 additions & 109 deletions

Source/JavaScriptCore/ChangeLog

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,68 @@
1+
2021-04-06 Yusuke Suzuki <[email protected]>
2+
3+
[WTF] Introduce FixedVector and use it for FixedOperands
4+
https://bugs.webkit.org/show_bug.cgi?id=224171
5+
6+
Reviewed by Mark Lam.
7+
8+
Define FixedOperands<T> which uses FixedVector for its storage. We use FixedOperands in FTL::OSRExitDescriptor.
9+
We also replace RefCountedArray<T> with FixedVector<T> if they are not requiring RefCountedArray<T>'s ref-counting
10+
semantics.
11+
12+
* bytecode/BytecodeGeneratorification.cpp:
13+
(JSC::BytecodeGeneratorification::run):
14+
* bytecode/CodeBlock.cpp:
15+
(JSC::CodeBlock::finishCreation):
16+
(JSC::CodeBlock::setConstantRegisters):
17+
(JSC::CodeBlock::setNumParameters):
18+
(JSC::CodeBlock::setRareCaseProfiles):
19+
(JSC::CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler):
20+
* bytecode/CodeBlock.h:
21+
* bytecode/Operands.h:
22+
(JSC::Operands::Operands):
23+
* bytecode/OperandsInlines.h:
24+
(JSC::U>::dumpInContext const):
25+
(JSC::U>::dump const):
26+
(JSC::Operands<T>::dumpInContext const): Deleted.
27+
(JSC::Operands<T>::dump const): Deleted.
28+
* bytecode/PolyProtoAccessChain.h:
29+
* bytecode/PolymorphicAccess.cpp:
30+
(JSC::PolymorphicAccess::regenerate):
31+
* bytecode/PolymorphicAccess.h:
32+
* bytecode/UnlinkedCodeBlock.cpp:
33+
(JSC::UnlinkedCodeBlock::dumpExpressionRangeInfo):
34+
(JSC::UnlinkedCodeBlock::expressionRangeForBytecodeIndex const):
35+
* bytecode/UnlinkedCodeBlock.h:
36+
(JSC::UnlinkedCodeBlock::expressionInfo):
37+
(JSC::UnlinkedCodeBlock::identifiers const):
38+
(JSC::UnlinkedCodeBlock::constantRegisters):
39+
(JSC::UnlinkedCodeBlock::constantsSourceCodeRepresentation):
40+
(JSC::UnlinkedCodeBlock::constantIdentifierSets):
41+
(JSC::UnlinkedCodeBlock::opProfileControlFlowBytecodeOffsets const):
42+
* bytecode/UnlinkedFunctionExecutable.h:
43+
* bytecompiler/BytecodeGenerator.cpp:
44+
(JSC::prepareJumpTableForSwitch):
45+
* dfg/DFGJITCode.h:
46+
* dfg/DFGPlan.h:
47+
(JSC::DFG::Plan::tierUpInLoopHierarchy):
48+
* ftl/FTLOSRExit.h:
49+
* jit/GCAwareJITStubRoutine.h:
50+
* jit/JIT.cpp:
51+
(JSC::JIT::privateCompileSlowCases):
52+
* jit/PolymorphicCallStubRoutine.h:
53+
* llint/LLIntOffsetsExtractor.cpp:
54+
* llint/LowLevelInterpreter.asm:
55+
* parser/Parser.cpp:
56+
(JSC::Parser<LexerType>::parseInner):
57+
(JSC::Parser<LexerType>::parseClassFieldInitializerSourceElements):
58+
* parser/Parser.h:
59+
(JSC::Parser<LexerType>::parse):
60+
(JSC::parse):
61+
* runtime/CachedTypes.cpp:
62+
(JSC::CachedVector::encode):
63+
(JSC::CachedVector::decode const):
64+
* wasm/js/JSWebAssemblyInstance.h:
65+
166
2021-04-05 Yusuke Suzuki <[email protected]>
267

368
[JSC] Shrink some of Vectors in JSC

Source/JavaScriptCore/bytecode/BytecodeGeneratorification.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ void BytecodeGeneratorification::run()
220220
VirtualRegister state = virtualRegisterForArgumentIncludingThis(static_cast<int32_t>(JSGenerator::Argument::State));
221221
auto& jumpTable = m_codeBlock->addSwitchJumpTable();
222222
jumpTable.min = 0;
223-
jumpTable.branchOffsets = RefCountedArray<int32_t>(m_yields.size() + 1);
223+
jumpTable.branchOffsets = FixedVector<int32_t>(m_yields.size() + 1);
224224
std::fill(jumpTable.branchOffsets.begin(), jumpTable.branchOffsets.end(), 0);
225225
jumpTable.add(0, nextToEnterPoint.offset());
226226
for (unsigned i = 0; i < m_yields.size(); ++i)

Source/JavaScriptCore/bytecode/CodeBlock.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -403,15 +403,15 @@ bool CodeBlock::finishCreation(VM& vm, ScriptExecutable* ownerExecutable, Unlink
403403
}
404404

405405
bool shouldUpdateFunctionHasExecutedCache = m_unlinkedCode->wasCompiledWithTypeProfilerOpcodes() || m_unlinkedCode->wasCompiledWithControlFlowProfilerOpcodes();
406-
m_functionDecls = RefCountedArray<WriteBarrier<FunctionExecutable>>(unlinkedCodeBlock->numberOfFunctionDecls());
406+
m_functionDecls = FixedVector<WriteBarrier<FunctionExecutable>>(unlinkedCodeBlock->numberOfFunctionDecls());
407407
for (size_t count = unlinkedCodeBlock->numberOfFunctionDecls(), i = 0; i < count; ++i) {
408408
UnlinkedFunctionExecutable* unlinkedExecutable = unlinkedCodeBlock->functionDecl(i);
409409
if (shouldUpdateFunctionHasExecutedCache)
410410
vm.functionHasExecutedCache()->insertUnexecutedRange(ownerExecutable->sourceID(), unlinkedExecutable->typeProfilingStartOffset(), unlinkedExecutable->typeProfilingEndOffset());
411411
m_functionDecls[i].set(vm, this, unlinkedExecutable->link(vm, topLevelExecutable, ownerExecutable->source(), WTF::nullopt, NoIntrinsic, ownerExecutable->isInsideOrdinaryFunction()));
412412
}
413413

414-
m_functionExprs = RefCountedArray<WriteBarrier<FunctionExecutable>>(unlinkedCodeBlock->numberOfFunctionExprs());
414+
m_functionExprs = FixedVector<WriteBarrier<FunctionExecutable>>(unlinkedCodeBlock->numberOfFunctionExprs());
415415
for (size_t count = unlinkedCodeBlock->numberOfFunctionExprs(), i = 0; i < count; ++i) {
416416
UnlinkedFunctionExecutable* unlinkedExecutable = unlinkedCodeBlock->functionExpr(i);
417417
if (shouldUpdateFunctionHasExecutedCache)
@@ -887,7 +887,7 @@ CodeBlock::~CodeBlock()
887887
#endif // ENABLE(JIT)
888888
}
889889

890-
void CodeBlock::setConstantRegisters(const RefCountedArray<WriteBarrier<Unknown>>& constants, const RefCountedArray<SourceCodeRepresentation>& constantsSourceCodeRepresentation, ScriptExecutable* topLevelExecutable)
890+
void CodeBlock::setConstantRegisters(const FixedVector<WriteBarrier<Unknown>>& constants, const FixedVector<SourceCodeRepresentation>& constantsSourceCodeRepresentation, ScriptExecutable* topLevelExecutable)
891891
{
892892
VM& vm = *m_vm;
893893
auto scope = DECLARE_THROW_SCOPE(vm);
@@ -949,7 +949,7 @@ void CodeBlock::setNumParameters(int newValue)
949949
{
950950
m_numParameters = newValue;
951951

952-
m_argumentValueProfiles = RefCountedArray<ValueProfile>(Options::useJIT() ? newValue : 0);
952+
m_argumentValueProfiles = FixedVector<ValueProfile>(Options::useJIT() ? newValue : 0);
953953
}
954954

955955
CodeBlock* CodeBlock::specialOSREntryBlockOrNull()
@@ -1754,7 +1754,7 @@ CallLinkInfo* CodeBlock::getCallLinkInfoForBytecodeIndex(BytecodeIndex index)
17541754
return nullptr;
17551755
}
17561756

1757-
void CodeBlock::setRareCaseProfiles(RefCountedArray<RareCaseProfile>&& rareCaseProfiles)
1757+
void CodeBlock::setRareCaseProfiles(FixedVector<RareCaseProfile>&& rareCaseProfiles)
17581758
{
17591759
ConcurrentJSLocker locker(m_lock);
17601760
ensureJITData(locker).m_rareCaseProfiles = WTFMove(rareCaseProfiles);
@@ -3381,7 +3381,7 @@ void CodeBlock::insertBasicBlockBoundariesForControlFlowProfiler()
33813381
{
33823382
if (!unlinkedCodeBlock()->hasOpProfileControlFlowBytecodeOffsets())
33833383
return;
3384-
const RefCountedArray<InstructionStream::Offset>& bytecodeOffsets = unlinkedCodeBlock()->opProfileControlFlowBytecodeOffsets();
3384+
const FixedVector<InstructionStream::Offset>& bytecodeOffsets = unlinkedCodeBlock()->opProfileControlFlowBytecodeOffsets();
33853385
for (size_t i = 0, offsetsLength = bytecodeOffsets.size(); i < offsetsLength; i++) {
33863386
// Because op_profile_control_flow is emitted at the beginning of every basic block, finding
33873387
// the next op_profile_control_flow will give us the text range of a single basic block.

Source/JavaScriptCore/bytecode/CodeBlock.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
#include "Watchpoint.h"
7070
#include <wtf/Bag.h>
7171
#include <wtf/FastMalloc.h>
72-
#include <wtf/RefCountedArray.h>
72+
#include <wtf/FixedVector.h>
7373
#include <wtf/RefPtr.h>
7474
#include <wtf/SegmentedVector.h>
7575
#include <wtf/Vector.h>
@@ -277,7 +277,7 @@ class CodeBlock : public JSCell {
277277
Bag<CallLinkInfo> m_callLinkInfos;
278278
SentinelLinkedList<CallLinkInfo, PackedRawSentinelNode<CallLinkInfo>> m_incomingCalls;
279279
SentinelLinkedList<PolymorphicCallNode, PackedRawSentinelNode<PolymorphicCallNode>> m_incomingPolymorphicCalls;
280-
RefCountedArray<RareCaseProfile> m_rareCaseProfiles;
280+
FixedVector<RareCaseProfile> m_rareCaseProfiles;
281281
std::unique_ptr<PCToCodeOriginMap> m_pcToCodeOriginMap;
282282
std::unique_ptr<RegisterAtOffsetList> m_calleeSaveRegisters;
283283
JITCodeMap m_jitCodeMap;
@@ -341,7 +341,7 @@ class CodeBlock : public JSCell {
341341
void setCalleeSaveRegisters(RegisterSet);
342342
void setCalleeSaveRegisters(std::unique_ptr<RegisterAtOffsetList>);
343343

344-
void setRareCaseProfiles(RefCountedArray<RareCaseProfile>&&);
344+
void setRareCaseProfiles(FixedVector<RareCaseProfile>&&);
345345
RareCaseProfile* rareCaseProfileForBytecodeIndex(const ConcurrentJSLocker&, BytecodeIndex);
346346
unsigned rareCaseProfileCountForBytecodeIndex(const ConcurrentJSLocker&, BytecodeIndex);
347347

@@ -956,7 +956,7 @@ class CodeBlock : public JSCell {
956956

957957
void updateAllValueProfilePredictionsAndCountLiveness(unsigned& numberOfLiveNonArgumentValueProfiles, unsigned& numberOfSamplesInProfiles);
958958

959-
void setConstantRegisters(const RefCountedArray<WriteBarrier<Unknown>>& constants, const RefCountedArray<SourceCodeRepresentation>& constantsSourceCodeRepresentation, ScriptExecutable* topLevelExecutable);
959+
void setConstantRegisters(const FixedVector<WriteBarrier<Unknown>>& constants, const FixedVector<SourceCodeRepresentation>& constantsSourceCodeRepresentation, ScriptExecutable* topLevelExecutable);
960960

961961
void replaceConstant(VirtualRegister reg, JSValue value)
962962
{
@@ -1032,16 +1032,16 @@ class CodeBlock : public JSCell {
10321032
// for DFG code blocks.
10331033
CompressedLazyOperandValueProfileHolder m_lazyOperandValueProfiles;
10341034
#endif
1035-
RefCountedArray<ValueProfile> m_argumentValueProfiles;
1035+
FixedVector<ValueProfile> m_argumentValueProfiles;
10361036

10371037
// Constant Pool
10381038
COMPILE_ASSERT(sizeof(Register) == sizeof(WriteBarrier<Unknown>), Register_must_be_same_size_as_WriteBarrier_Unknown);
10391039
// TODO: This could just be a pointer to m_unlinkedCodeBlock's data, but the DFG mutates
10401040
// it, so we're stuck with it for now.
10411041
Vector<WriteBarrier<Unknown>> m_constantRegisters;
10421042
Vector<SourceCodeRepresentation> m_constantsSourceCodeRepresentation;
1043-
RefCountedArray<WriteBarrier<FunctionExecutable>> m_functionDecls;
1044-
RefCountedArray<WriteBarrier<FunctionExecutable>> m_functionExprs;
1043+
FixedVector<WriteBarrier<FunctionExecutable>> m_functionDecls;
1044+
FixedVector<WriteBarrier<FunctionExecutable>> m_functionExprs;
10451045

10461046
WriteBarrier<CodeBlock> m_alternative;
10471047

Source/JavaScriptCore/bytecode/Operands.h

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include "CallFrame.h"
2929
#include "VirtualRegister.h"
3030

31+
#include <wtf/FixedVector.h>
3132
#include <wtf/PrintStream.h>
3233
#include <wtf/Vector.h>
3334

@@ -134,39 +135,38 @@ static_assert(sizeof(Operand) == sizeof(uint64_t), "Operand::asBits() relies on
134135

135136
enum OperandsLikeTag { OperandsLike };
136137

137-
template<typename T>
138+
template<typename T, typename StorageArg = std::conditional_t<std::is_same_v<T, bool>, FastBitVector, Vector<T, 0, UnsafeVectorOverflow>>>
138139
class Operands {
139140
public:
140-
using Storage = std::conditional_t<std::is_same_v<T, bool>, FastBitVector, Vector<T, 0, UnsafeVectorOverflow>>;
141+
using Storage = StorageArg;
141142
using RefType = std::conditional_t<std::is_same_v<T, bool>, FastBitReference, T&>;
142143
using ConstRefType = std::conditional_t<std::is_same_v<T, bool>, bool, const T&>;
143144

144145
Operands() = default;
145146

146147
explicit Operands(size_t numArguments, size_t numLocals, size_t numTmps)
147-
: m_numArguments(numArguments)
148+
: m_values(numArguments + numLocals + numTmps)
149+
, m_numArguments(numArguments)
148150
, m_numLocals(numLocals)
149151
{
150-
size_t size = numArguments + numLocals + numTmps;
151-
m_values.grow(size);
152152
if (!WTF::VectorTraits<T>::needsInitialization)
153153
m_values.fill(T());
154154
}
155155

156156
explicit Operands(size_t numArguments, size_t numLocals, size_t numTmps, const T& initialValue)
157-
: m_numArguments(numArguments)
157+
: m_values(numArguments + numLocals + numTmps)
158+
, m_numArguments(numArguments)
158159
, m_numLocals(numLocals)
159160
{
160-
m_values.grow(numArguments + numLocals + numTmps);
161161
m_values.fill(initialValue);
162162
}
163163

164-
template<typename U>
165-
explicit Operands(OperandsLikeTag, const Operands<U>& other, const T& initialValue = T())
166-
: m_numArguments(other.numberOfArguments())
164+
template<typename U, typename V>
165+
explicit Operands(OperandsLikeTag, const Operands<U, V>& other, const T& initialValue = T())
166+
: m_values(other.size())
167+
, m_numArguments(other.numberOfArguments())
167168
, m_numLocals(other.numberOfLocals())
168169
{
169-
m_values.grow(other.size());
170170
m_values.fill(initialValue);
171171
}
172172

@@ -399,4 +399,7 @@ class Operands {
399399
unsigned m_numLocals { 0 };
400400
};
401401

402+
template<typename T>
403+
using FixedOperands = Operands<T, std::conditional_t<std::is_same_v<T, bool>, FastBitVector, FixedVector<T>>>;
404+
402405
} // namespace JSC

Source/JavaScriptCore/bytecode/OperandsInlines.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ inline void Operand::dump(PrintStream& out) const
3838
out.print(virtualRegister());
3939
}
4040

41-
template<typename T>
42-
void Operands<T>::dumpInContext(PrintStream& out, DumpContext* context) const
41+
template<typename T, typename U>
42+
void Operands<T, U>::dumpInContext(PrintStream& out, DumpContext* context) const
4343
{
4444
CommaPrinter comma(" ");
4545
for (size_t argumentIndex = numberOfArguments(); argumentIndex--;) {
@@ -59,8 +59,8 @@ void Operands<T>::dumpInContext(PrintStream& out, DumpContext* context) const
5959
}
6060
}
6161

62-
template<typename T>
63-
void Operands<T>::dump(PrintStream& out) const
62+
template<typename T, typename U>
63+
void Operands<T, U>::dump(PrintStream& out) const
6464
{
6565
CommaPrinter comma(" ");
6666
for (size_t argumentIndex = numberOfArguments(); argumentIndex--;) {

Source/JavaScriptCore/bytecode/PolyProtoAccessChain.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727

2828
#include "StructureIDTable.h"
2929
#include "VM.h"
30-
#include <wtf/RefCountedArray.h>
30+
#include <wtf/FixedVector.h>
3131
#include <wtf/Vector.h>
3232

3333
namespace JSC {
@@ -44,7 +44,7 @@ class PolyProtoAccessChain final : public ThreadSafeRefCounted<PolyProtoAccessCh
4444
static RefPtr<PolyProtoAccessChain> tryCreate(JSGlobalObject*, JSCell* base, const PropertySlot&);
4545
static RefPtr<PolyProtoAccessChain> tryCreate(JSGlobalObject*, JSCell* base, JSObject* target);
4646

47-
const RefCountedArray<StructureID>& chain() const { return m_chain; }
47+
const FixedVector<StructureID>& chain() const { return m_chain; }
4848

4949
void dump(Structure* baseStructure, PrintStream& out) const;
5050

@@ -82,7 +82,7 @@ class PolyProtoAccessChain final : public ThreadSafeRefCounted<PolyProtoAccessCh
8282

8383
// This does not include the base. We rely on AccessCase providing it for us. That said, this data
8484
// structure is tied to the base that it was created with.
85-
RefCountedArray<StructureID> m_chain;
85+
FixedVector<StructureID> m_chain;
8686
};
8787

8888
}

Source/JavaScriptCore/bytecode/PolymorphicAccess.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -748,7 +748,7 @@ AccessGenerationResult PolymorphicAccess::regenerate(const GCSafeConcurrentJSLoc
748748
m_stubRoutine = createJITStubRoutine(code, vm, codeBlock, doesCalls, cellsToMark, WTFMove(state.m_callLinkInfos), codeBlockThatOwnsExceptionHandlers, callSiteIndexForExceptionHandling);
749749
m_watchpoints = WTFMove(state.watchpoints);
750750
if (!state.weakReferences.isEmpty())
751-
m_weakReferences = RefCountedArray<WriteBarrier<JSCell>>(WTFMove(state.weakReferences));
751+
m_weakReferences = FixedVector<WriteBarrier<JSCell>>(WTFMove(state.weakReferences));
752752
if (PolymorphicAccessInternal::verbose)
753753
dataLog("Returning: ", code.code(), "\n");
754754

Source/JavaScriptCore/bytecode/PolymorphicAccess.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
#include "JSFunctionInlines.h"
3333
#include "MacroAssembler.h"
3434
#include "ScratchRegisterAllocator.h"
35-
#include <wtf/RefCountedArray.h>
35+
#include <wtf/FixedVector.h>
3636
#include <wtf/Vector.h>
3737

3838
namespace JSC {
@@ -188,7 +188,7 @@ class PolymorphicAccess {
188188
ListType m_list;
189189
RefPtr<JITStubRoutine> m_stubRoutine;
190190
std::unique_ptr<WatchpointsOnStructureStubInfo> m_watchpoints;
191-
RefCountedArray<WriteBarrier<JSCell>> m_weakReferences;
191+
FixedVector<WriteBarrier<JSCell>> m_weakReferences;
192192
};
193193

194194
struct AccessGenerationState {

Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ static void dumpLineColumnEntry(size_t index, const InstructionStream& instructi
159159

160160
void UnlinkedCodeBlock::dumpExpressionRangeInfo()
161161
{
162-
RefCountedArray<ExpressionRangeInfo>& expressionInfo = m_expressionInfo;
162+
FixedVector<ExpressionRangeInfo>& expressionInfo = m_expressionInfo;
163163

164164
size_t size = m_expressionInfo.size();
165165
dataLogF("UnlinkedCodeBlock %p expressionRangeInfo[%zu] {\n", this, size);
@@ -188,7 +188,7 @@ void UnlinkedCodeBlock::expressionRangeForBytecodeIndex(BytecodeIndex bytecodeIn
188188
return;
189189
}
190190

191-
const RefCountedArray<ExpressionRangeInfo>& expressionInfo = m_expressionInfo;
191+
const FixedVector<ExpressionRangeInfo>& expressionInfo = m_expressionInfo;
192192

193193
int low = 0;
194194
int high = expressionInfo.size();

0 commit comments

Comments
 (0)