Skip to content

Commit 530aca8

Browse files
committed
[JSC] Do not copy StringSwitchJumpTable
https://bugs.webkit.org/show_bug.cgi?id=224414 Reviewed by Keith Miller. Previously, we were copying UnlinkedStringJumpTable to CodeBlock's StringJumpTable because we embed CodeLocation pointer inside CodeBlock's StringJumpTable. This is copying a mostly identical hashtable to each CodeBlock even in DFG and FTL. This even prevents us from inlining op_switch_string in DFG and FTL because (1) we don't want to copy this string tables collected from each inlined CodeBlock into a new DFG / FTL CodeBlock and (2) we cannot ref/deref StringImpl inside DFG / FTL compilers so copying these tables in the compiler threads need additional "DesiredStringSwitchJumpTable" etc. In this patch, we stop copying StringSwitchJumpTable. We decouple CodeLocation pointers from the hashtable so that we can use UnlinkedStringJumpTable in UnlinkedCodeBlock. UnlinkedStringJumpTable's hashtable inclues m_indexInTable in each entry so that we can have array of CodeLocation pointers in CodeBlock's JITData to have JIT jump targets separately. This design prevents us from copying unnecessary hashtables, and even this paves the way to inlining switch_string in DFG and FTL. * bytecode/BytecodeDumper.cpp: (JSC::CodeBlockBytecodeDumper<Block>::dumpStringSwitchJumpTables): * bytecode/CodeBlock.cpp: (JSC::CodeBlock::finishCreation): (JSC::CodeBlock::shrinkToFit): * bytecode/CodeBlock.h: (JSC::CodeBlock::stringSwitchJumpTable): (JSC::CodeBlock::numberOfUnlinkedStringSwitchJumpTables const): (JSC::CodeBlock::unlinkedStringSwitchJumpTable): (JSC::CodeBlock::numberOfStringSwitchJumpTables const): Deleted. * bytecode/JumpTable.h: (JSC::StringJumpTable::ctiForValue const): (JSC::StringJumpTable::offsetForValue): Deleted. (JSC::StringJumpTable::ctiForValue): Deleted. (JSC::StringJumpTable::clear): Deleted. * bytecode/PreciseJumpTargetsInlines.h: * bytecode/UnlinkedCodeBlock.h: (JSC::UnlinkedStringJumpTable::offsetForValue const): (JSC::UnlinkedCodeBlock::numberOfUnlinkedStringSwitchJumpTables const): (JSC::UnlinkedCodeBlock::unlinkedStringSwitchJumpTable): (JSC::UnlinkedStringJumpTable::offsetForValue): Deleted. (JSC::UnlinkedCodeBlock::numberOfStringSwitchJumpTables const): Deleted. (JSC::UnlinkedCodeBlock::stringSwitchJumpTable): Deleted. * bytecode/UnlinkedCodeBlockGenerator.cpp: (JSC::UnlinkedCodeBlockGenerator::finalize): * bytecode/UnlinkedCodeBlockGenerator.h: (JSC::UnlinkedCodeBlockGenerator::numberOfUnlinkedStringSwitchJumpTables const): (JSC::UnlinkedCodeBlockGenerator::addUnlinkedStringSwitchJumpTable): (JSC::UnlinkedCodeBlockGenerator::unlinkedStringSwitchJumpTable): (JSC::UnlinkedCodeBlockGenerator::numberOfStringSwitchJumpTables const): Deleted. (JSC::UnlinkedCodeBlockGenerator::addStringSwitchJumpTable): Deleted. (JSC::UnlinkedCodeBlockGenerator::stringSwitchJumpTable): Deleted. * bytecompiler/BytecodeGenerator.cpp: (JSC::BytecodeGenerator::beginSwitch): (JSC::prepareJumpTableForStringSwitch): (JSC::BytecodeGenerator::endSwitch): * dfg/DFGByteCodeParser.cpp: (JSC::DFG::ByteCodeParser::parseBlock): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::link): * dfg/DFGOperations.cpp: (JSC::DFG::JSC_DEFINE_JIT_OPERATION): * ftl/FTLLowerDFGToB3.cpp: (JSC::FTL::DFG::LowerDFGToB3::switchStringSlow): * ftl/FTLOperations.cpp: (JSC::FTL::JSC_DEFINE_JIT_OPERATION): * jit/JIT.cpp: (JSC::JIT::link): * jit/JIT.h: (JSC::SwitchRecord::SwitchRecord): * jit/JITOpcodes.cpp: (JSC::JIT::emit_op_switch_string): * jit/JITOpcodes32_64.cpp: (JSC::JIT::emit_op_switch_string): * jit/JITOperations.cpp: (JSC::JSC_DEFINE_JIT_OPERATION): * llint/LLIntSlowPaths.cpp: (JSC::LLInt::LLINT_SLOW_PATH_DECL): * runtime/CachedTypes.cpp: (JSC::CachedStringJumpTable::encode): (JSC::CachedStringJumpTable::decode const): (JSC::CachedCodeBlockRareData::encode): (JSC::CachedCodeBlockRareData::decode const): Canonical link: https://commits.webkit.org/236408@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@275840 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 17c44dc commit 530aca8

22 files changed

Lines changed: 189 additions & 132 deletions

‎Source/JavaScriptCore/ChangeLog‎

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,85 @@
1+
2021-04-11 Yusuke Suzuki <ysuzuki@apple.com>
2+
3+
[JSC] Do not copy StringSwitchJumpTable
4+
https://bugs.webkit.org/show_bug.cgi?id=224414
5+
6+
Reviewed by Keith Miller.
7+
8+
Previously, we were copying UnlinkedStringJumpTable to CodeBlock's StringJumpTable because we embed CodeLocation pointer
9+
inside CodeBlock's StringJumpTable. This is copying a mostly identical hashtable to each CodeBlock even in DFG and FTL. This
10+
even prevents us from inlining op_switch_string in DFG and FTL because (1) we don't want to copy this string tables collected from
11+
each inlined CodeBlock into a new DFG / FTL CodeBlock and (2) we cannot ref/deref StringImpl inside DFG / FTL compilers so copying
12+
these tables in the compiler threads need additional "DesiredStringSwitchJumpTable" etc.
13+
14+
In this patch, we stop copying StringSwitchJumpTable. We decouple CodeLocation pointers from the hashtable so that we can use
15+
UnlinkedStringJumpTable in UnlinkedCodeBlock. UnlinkedStringJumpTable's hashtable inclues m_indexInTable in each entry so that
16+
we can have array of CodeLocation pointers in CodeBlock's JITData to have JIT jump targets separately. This design prevents us
17+
from copying unnecessary hashtables, and even this paves the way to inlining switch_string in DFG and FTL.
18+
19+
* bytecode/BytecodeDumper.cpp:
20+
(JSC::CodeBlockBytecodeDumper<Block>::dumpStringSwitchJumpTables):
21+
* bytecode/CodeBlock.cpp:
22+
(JSC::CodeBlock::finishCreation):
23+
(JSC::CodeBlock::shrinkToFit):
24+
* bytecode/CodeBlock.h:
25+
(JSC::CodeBlock::stringSwitchJumpTable):
26+
(JSC::CodeBlock::numberOfUnlinkedStringSwitchJumpTables const):
27+
(JSC::CodeBlock::unlinkedStringSwitchJumpTable):
28+
(JSC::CodeBlock::numberOfStringSwitchJumpTables const): Deleted.
29+
* bytecode/JumpTable.h:
30+
(JSC::StringJumpTable::ctiForValue const):
31+
(JSC::StringJumpTable::offsetForValue): Deleted.
32+
(JSC::StringJumpTable::ctiForValue): Deleted.
33+
(JSC::StringJumpTable::clear): Deleted.
34+
* bytecode/PreciseJumpTargetsInlines.h:
35+
* bytecode/UnlinkedCodeBlock.h:
36+
(JSC::UnlinkedStringJumpTable::offsetForValue const):
37+
(JSC::UnlinkedCodeBlock::numberOfUnlinkedStringSwitchJumpTables const):
38+
(JSC::UnlinkedCodeBlock::unlinkedStringSwitchJumpTable):
39+
(JSC::UnlinkedStringJumpTable::offsetForValue): Deleted.
40+
(JSC::UnlinkedCodeBlock::numberOfStringSwitchJumpTables const): Deleted.
41+
(JSC::UnlinkedCodeBlock::stringSwitchJumpTable): Deleted.
42+
* bytecode/UnlinkedCodeBlockGenerator.cpp:
43+
(JSC::UnlinkedCodeBlockGenerator::finalize):
44+
* bytecode/UnlinkedCodeBlockGenerator.h:
45+
(JSC::UnlinkedCodeBlockGenerator::numberOfUnlinkedStringSwitchJumpTables const):
46+
(JSC::UnlinkedCodeBlockGenerator::addUnlinkedStringSwitchJumpTable):
47+
(JSC::UnlinkedCodeBlockGenerator::unlinkedStringSwitchJumpTable):
48+
(JSC::UnlinkedCodeBlockGenerator::numberOfStringSwitchJumpTables const): Deleted.
49+
(JSC::UnlinkedCodeBlockGenerator::addStringSwitchJumpTable): Deleted.
50+
(JSC::UnlinkedCodeBlockGenerator::stringSwitchJumpTable): Deleted.
51+
* bytecompiler/BytecodeGenerator.cpp:
52+
(JSC::BytecodeGenerator::beginSwitch):
53+
(JSC::prepareJumpTableForStringSwitch):
54+
(JSC::BytecodeGenerator::endSwitch):
55+
* dfg/DFGByteCodeParser.cpp:
56+
(JSC::DFG::ByteCodeParser::parseBlock):
57+
* dfg/DFGJITCompiler.cpp:
58+
(JSC::DFG::JITCompiler::link):
59+
* dfg/DFGOperations.cpp:
60+
(JSC::DFG::JSC_DEFINE_JIT_OPERATION):
61+
* ftl/FTLLowerDFGToB3.cpp:
62+
(JSC::FTL::DFG::LowerDFGToB3::switchStringSlow):
63+
* ftl/FTLOperations.cpp:
64+
(JSC::FTL::JSC_DEFINE_JIT_OPERATION):
65+
* jit/JIT.cpp:
66+
(JSC::JIT::link):
67+
* jit/JIT.h:
68+
(JSC::SwitchRecord::SwitchRecord):
69+
* jit/JITOpcodes.cpp:
70+
(JSC::JIT::emit_op_switch_string):
71+
* jit/JITOpcodes32_64.cpp:
72+
(JSC::JIT::emit_op_switch_string):
73+
* jit/JITOperations.cpp:
74+
(JSC::JSC_DEFINE_JIT_OPERATION):
75+
* llint/LLIntSlowPaths.cpp:
76+
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
77+
* runtime/CachedTypes.cpp:
78+
(JSC::CachedStringJumpTable::encode):
79+
(JSC::CachedStringJumpTable::decode const):
80+
(JSC::CachedCodeBlockRareData::encode):
81+
(JSC::CachedCodeBlockRareData::decode const):
82+
183
2021-04-10 Yusuke Suzuki <ysuzuki@apple.com>
284

385
[JSC] B3 reduce-double-to-float should reduce only when constant double is canonical one to reduced float value

‎Source/JavaScriptCore/bytecode/BytecodeDumper.cpp‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -196,15 +196,13 @@ void CodeBlockBytecodeDumper<Block>::dumpSwitchJumpTables()
196196
template<class Block>
197197
void CodeBlockBytecodeDumper<Block>::dumpStringSwitchJumpTables()
198198
{
199-
if (unsigned count = this->block()->numberOfStringSwitchJumpTables()) {
199+
if (unsigned count = this->block()->numberOfUnlinkedStringSwitchJumpTables()) {
200200
this->m_out.printf("\nString Switch Jump Tables:\n");
201201
unsigned i = 0;
202202
do {
203203
this->m_out.printf(" %1d = {\n", i);
204-
const auto& stringSwitchJumpTable = this->block()->stringSwitchJumpTable(i);
205-
auto end = stringSwitchJumpTable.offsetTable.end();
206-
for (auto iter = stringSwitchJumpTable.offsetTable.begin(); iter != end; ++iter)
207-
this->m_out.printf("\t\t\"%s\" => %04d\n", iter->key->utf8().data(), iter->value.branchOffset);
204+
for (const auto& entry : this->block()->unlinkedStringSwitchJumpTable(i).m_offsetTable)
205+
this->m_out.printf("\t\t\"%s\" => %04d\n", entry.key->utf8().data(), entry.value.m_branchOffset);
208206
this->m_out.printf(" }\n");
209207
++i;
210208
} while (i < count);

‎Source/JavaScriptCore/bytecode/CodeBlock.cpp‎

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,6 @@ void CodeBlock::finishCreation(VM& vm, CopyParsedBlockTag, CodeBlock& other)
327327

328328
m_rareData->m_exceptionHandlers = other.m_rareData->m_exceptionHandlers;
329329
m_rareData->m_switchJumpTables = other.m_rareData->m_switchJumpTables;
330-
m_rareData->m_stringSwitchJumpTables = other.m_rareData->m_stringSwitchJumpTables;
331330
}
332331
}
333332

@@ -419,7 +418,7 @@ bool CodeBlock::finishCreation(VM& vm, ScriptExecutable* ownerExecutable, Unlink
419418
m_functionExprs[i].set(vm, this, unlinkedExecutable->link(vm, topLevelExecutable, ownerExecutable->source(), WTF::nullopt, NoIntrinsic, ownerExecutable->isInsideOrdinaryFunction()));
420419
}
421420

422-
if (unlinkedCodeBlock->hasRareData()) {
421+
if (unlinkedCodeBlock->numberOfExceptionHandlers() || unlinkedCodeBlock->numberOfSwitchJumpTables()) {
423422
createRareDataIfNecessary();
424423

425424
if (size_t count = unlinkedCodeBlock->numberOfExceptionHandlers()) {
@@ -436,19 +435,6 @@ bool CodeBlock::finishCreation(VM& vm, ScriptExecutable* ownerExecutable, Unlink
436435
}
437436
}
438437

439-
if (size_t count = unlinkedCodeBlock->numberOfStringSwitchJumpTables()) {
440-
m_rareData->m_stringSwitchJumpTables.resizeToFit(count);
441-
for (size_t i = 0; i < count; i++) {
442-
UnlinkedStringJumpTable::StringOffsetTable::iterator ptr = unlinkedCodeBlock->stringSwitchJumpTable(i).offsetTable.begin();
443-
UnlinkedStringJumpTable::StringOffsetTable::iterator end = unlinkedCodeBlock->stringSwitchJumpTable(i).offsetTable.end();
444-
for (; ptr != end; ++ptr) {
445-
OffsetLocation offset;
446-
offset.branchOffset = ptr->value.branchOffset;
447-
m_rareData->m_stringSwitchJumpTables[i].offsetTable.add(ptr->key, offset);
448-
}
449-
}
450-
}
451-
452438
if (size_t count = unlinkedCodeBlock->numberOfSwitchJumpTables()) {
453439
m_rareData->m_switchJumpTables.resizeToFit(count);
454440
for (size_t i = 0; i < count; i++) {
@@ -2141,10 +2127,8 @@ void CodeBlock::shrinkToFit(const ConcurrentJSLocker&, ShrinkMode shrinkMode)
21412127
m_constantsSourceCodeRepresentation.shrinkToFit();
21422128

21432129
if (shrinkMode == ShrinkMode::EarlyShrink) {
2144-
if (m_rareData) {
2130+
if (m_rareData)
21452131
m_rareData->m_switchJumpTables.shrinkToFit();
2146-
m_rareData->m_stringSwitchJumpTables.shrinkToFit();
2147-
}
21482132
} // else don't shrink these, because we would have already pointed pointers into these tables.
21492133
}
21502134

‎Source/JavaScriptCore/bytecode/CodeBlock.h‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ class CodeBlock : public JSCell {
278278
SentinelLinkedList<CallLinkInfo, PackedRawSentinelNode<CallLinkInfo>> m_incomingCalls;
279279
SentinelLinkedList<PolymorphicCallNode, PackedRawSentinelNode<PolymorphicCallNode>> m_incomingPolymorphicCalls;
280280
FixedVector<RareCaseProfile> m_rareCaseProfiles;
281+
FixedVector<StringJumpTable> m_stringSwitchJumpTables;
281282
std::unique_ptr<PCToCodeOriginMap> m_pcToCodeOriginMap;
282283
std::unique_ptr<RegisterAtOffsetList> m_calleeSaveRegisters;
283284
JITCodeMap m_jitCodeMap;
@@ -630,8 +631,15 @@ class CodeBlock : public JSCell {
630631
}
631632
#endif
632633

633-
size_t numberOfStringSwitchJumpTables() const { return m_rareData ? m_rareData->m_stringSwitchJumpTables.size() : 0; }
634-
StringJumpTable& stringSwitchJumpTable(int tableIndex) { RELEASE_ASSERT(m_rareData); return m_rareData->m_stringSwitchJumpTables[tableIndex]; }
634+
#if ENABLE(JIT)
635+
StringJumpTable& stringSwitchJumpTable(int tableIndex)
636+
{
637+
RELEASE_ASSERT(m_jitData);
638+
return m_jitData->m_stringSwitchJumpTables[tableIndex];
639+
}
640+
#endif
641+
size_t numberOfUnlinkedStringSwitchJumpTables() const { return m_unlinkedCode->numberOfUnlinkedStringSwitchJumpTables(); }
642+
const UnlinkedStringJumpTable& unlinkedStringSwitchJumpTable(int tableIndex) { return m_unlinkedCode->unlinkedStringSwitchJumpTable(tableIndex); }
635643

636644
DirectEvalCodeCache& directEvalCodeCache() { createRareDataIfNecessary(); return m_rareData->m_directEvalCodeCache; }
637645

@@ -883,7 +891,6 @@ class CodeBlock : public JSCell {
883891

884892
// Jump Tables
885893
Vector<SimpleJumpTable> m_switchJumpTables;
886-
Vector<StringJumpTable> m_stringSwitchJumpTables;
887894

888895
Vector<std::unique_ptr<ValueProfileAndVirtualRegisterBuffer>> m_catchProfiles;
889896

‎Source/JavaScriptCore/bytecode/JumpTable.h‎

Lines changed: 9 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -30,51 +30,27 @@
3030
#pragma once
3131

3232
#include "CodeLocation.h"
33+
#include "UnlinkedCodeBlock.h"
3334
#include <wtf/RobinHoodHashMap.h>
3435
#include <wtf/Vector.h>
3536
#include <wtf/text/StringImpl.h>
3637

3738
namespace JSC {
3839

39-
struct OffsetLocation {
40-
int32_t branchOffset;
4140
#if ENABLE(JIT)
42-
CodeLocationLabel<JSSwitchPtrTag> ctiOffset;
43-
#endif
44-
};
45-
4641
struct StringJumpTable {
47-
using StringOffsetTable = MemoryCompactLookupOnlyRobinHoodHashMap<RefPtr<StringImpl>, OffsetLocation>;
48-
StringOffsetTable offsetTable;
49-
#if ENABLE(JIT)
50-
CodeLocationLabel<JSSwitchPtrTag> ctiDefault; // FIXME: it should not be necessary to store this.
51-
#endif
42+
FixedVector<CodeLocationLabel<JSSwitchPtrTag>> m_ctiOffsets;
43+
CodeLocationLabel<JSSwitchPtrTag> m_ctiDefault; // FIXME: it should not be necessary to store this.
5244

53-
inline int32_t offsetForValue(StringImpl* value, int32_t defaultOffset)
45+
inline CodeLocationLabel<JSSwitchPtrTag> ctiForValue(const UnlinkedStringJumpTable& unlinkedTable, StringImpl* value) const
5446
{
55-
StringOffsetTable::const_iterator end = offsetTable.end();
56-
StringOffsetTable::const_iterator loc = offsetTable.find(value);
57-
if (loc == end)
58-
return defaultOffset;
59-
return loc->value.branchOffset;
60-
}
61-
62-
#if ENABLE(JIT)
63-
inline CodeLocationLabel<JSSwitchPtrTag> ctiForValue(StringImpl* value)
64-
{
65-
StringOffsetTable::const_iterator end = offsetTable.end();
66-
StringOffsetTable::const_iterator loc = offsetTable.find(value);
67-
if (loc == end)
68-
return ctiDefault;
69-
return loc->value.ctiOffset;
70-
}
71-
#endif
72-
73-
void clear()
74-
{
75-
offsetTable.clear();
47+
auto loc = unlinkedTable.m_offsetTable.find(value);
48+
if (loc == unlinkedTable.m_offsetTable.end())
49+
return m_ctiDefault;
50+
return m_ctiOffsets[loc->value.m_indexInTable];
7651
}
7752
};
53+
#endif
7854

7955
struct SimpleJumpTable {
8056
// FIXME: The two Vectors can be combined into one Vector<OffsetLocation>

‎Source/JavaScriptCore/bytecode/PreciseJumpTargetsInlines.h‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,9 @@ namespace JSC {
7777
} \
7878
case op_switch_string: { \
7979
auto bytecode = instruction->as<OpSwitchString>(); \
80-
auto& table = codeBlock->stringSwitchJumpTable(bytecode.m_tableIndex); \
81-
auto iter = table.offsetTable.begin(); \
82-
auto end = table.offsetTable.end(); \
83-
for (; iter != end; ++iter) \
84-
SWITCH_CASE(iter->value.branchOffset); \
80+
auto& table = codeBlock->unlinkedStringSwitchJumpTable(bytecode.m_tableIndex); \
81+
for (auto& entry : table.m_offsetTable) \
82+
SWITCH_CASE(entry.value.m_branchOffset); \
8583
SWITCH_DEFAULT_OFFSET(OpSwitchString); \
8684
break; \
8785
} \

‎Source/JavaScriptCore/bytecode/UnlinkedCodeBlock.h‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,19 @@ typedef unsigned UnlinkedLLIntCallLinkInfo;
7777

7878
struct UnlinkedStringJumpTable {
7979
struct OffsetLocation {
80-
int32_t branchOffset;
80+
int32_t m_branchOffset;
81+
unsigned m_indexInTable;
8182
};
8283

8384
using StringOffsetTable = MemoryCompactLookupOnlyRobinHoodHashMap<RefPtr<StringImpl>, OffsetLocation>;
84-
StringOffsetTable offsetTable;
85+
StringOffsetTable m_offsetTable;
8586

86-
inline int32_t offsetForValue(StringImpl* value, int32_t defaultOffset)
87+
inline int32_t offsetForValue(StringImpl* value, int32_t defaultOffset) const
8788
{
88-
StringOffsetTable::const_iterator end = offsetTable.end();
89-
StringOffsetTable::const_iterator loc = offsetTable.find(value);
90-
if (loc == end)
89+
auto loc = m_offsetTable.find(value);
90+
if (loc == m_offsetTable.end())
9191
return defaultOffset;
92-
return loc->value.branchOffset;
92+
return loc->value.m_branchOffset;
9393
}
9494

9595
};
@@ -188,8 +188,8 @@ class UnlinkedCodeBlock : public JSCell {
188188
size_t numberOfSwitchJumpTables() const { return m_rareData ? m_rareData->m_switchJumpTables.size() : 0; }
189189
UnlinkedSimpleJumpTable& switchJumpTable(int tableIndex) { ASSERT(m_rareData); return m_rareData->m_switchJumpTables[tableIndex]; }
190190

191-
size_t numberOfStringSwitchJumpTables() const { return m_rareData ? m_rareData->m_stringSwitchJumpTables.size() : 0; }
192-
UnlinkedStringJumpTable& stringSwitchJumpTable(int tableIndex) { ASSERT(m_rareData); return m_rareData->m_stringSwitchJumpTables[tableIndex]; }
191+
size_t numberOfUnlinkedStringSwitchJumpTables() const { return m_rareData ? m_rareData->m_unlinkedStringSwitchJumpTables.size() : 0; }
192+
const UnlinkedStringJumpTable& unlinkedStringSwitchJumpTable(int tableIndex) { ASSERT(m_rareData); return m_rareData->m_unlinkedStringSwitchJumpTables[tableIndex]; }
193193

194194
UnlinkedFunctionExecutable* functionDecl(int index) { return m_functionDecls[index].get(); }
195195
size_t numberOfFunctionDecls() { return m_functionDecls.size(); }
@@ -400,7 +400,7 @@ class UnlinkedCodeBlock : public JSCell {
400400

401401
// Jump Tables
402402
FixedVector<UnlinkedSimpleJumpTable> m_switchJumpTables;
403-
FixedVector<UnlinkedStringJumpTable> m_stringSwitchJumpTables;
403+
FixedVector<UnlinkedStringJumpTable> m_unlinkedStringSwitchJumpTables;
404404

405405
FixedVector<ExpressionRangeInfo::FatPosition> m_expressionInfoFatPositions;
406406

‎Source/JavaScriptCore/bytecode/UnlinkedCodeBlockGenerator.cpp‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ void UnlinkedCodeBlockGenerator::finalize(std::unique_ptr<InstructionStream> ins
133133
if (!m_codeBlock->m_rareData) {
134134
if (!m_exceptionHandlers.isEmpty()
135135
|| !m_switchJumpTables.isEmpty()
136-
|| !m_stringSwitchJumpTables.isEmpty()
136+
|| !m_unlinkedStringSwitchJumpTables.isEmpty()
137137
|| !m_expressionInfoFatPositions.isEmpty()
138138
|| !m_typeProfilerInfoMap.isEmpty()
139139
|| !m_opProfileControlFlowBytecodeOffsets.isEmpty()
@@ -144,7 +144,7 @@ void UnlinkedCodeBlockGenerator::finalize(std::unique_ptr<InstructionStream> ins
144144
if (m_codeBlock->m_rareData) {
145145
m_codeBlock->m_rareData->m_exceptionHandlers = WTFMove(m_exceptionHandlers);
146146
m_codeBlock->m_rareData->m_switchJumpTables = WTFMove(m_switchJumpTables);
147-
m_codeBlock->m_rareData->m_stringSwitchJumpTables = WTFMove(m_stringSwitchJumpTables);
147+
m_codeBlock->m_rareData->m_unlinkedStringSwitchJumpTables = WTFMove(m_unlinkedStringSwitchJumpTables);
148148
m_codeBlock->m_rareData->m_expressionInfoFatPositions = WTFMove(m_expressionInfoFatPositions);
149149
m_codeBlock->m_rareData->m_typeProfilerInfoMap = WTFMove(m_typeProfilerInfoMap);
150150
m_codeBlock->m_rareData->m_opProfileControlFlowBytecodeOffsets = WTFMove(m_opProfileControlFlowBytecodeOffsets);

‎Source/JavaScriptCore/bytecode/UnlinkedCodeBlockGenerator.h‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ class UnlinkedCodeBlockGenerator {
9494
UnlinkedSimpleJumpTable& addSwitchJumpTable() { m_switchJumpTables.append(UnlinkedSimpleJumpTable()); return m_switchJumpTables.last(); }
9595
UnlinkedSimpleJumpTable& switchJumpTable(int tableIndex) { return m_switchJumpTables[tableIndex]; }
9696

97-
size_t numberOfStringSwitchJumpTables() const { return m_stringSwitchJumpTables.size(); }
98-
UnlinkedStringJumpTable& addStringSwitchJumpTable() { m_stringSwitchJumpTables.append(UnlinkedStringJumpTable()); return m_stringSwitchJumpTables.last(); }
99-
UnlinkedStringJumpTable& stringSwitchJumpTable(int tableIndex) { return m_stringSwitchJumpTables[tableIndex]; }
97+
size_t numberOfUnlinkedStringSwitchJumpTables() const { return m_unlinkedStringSwitchJumpTables.size(); }
98+
UnlinkedStringJumpTable& addUnlinkedStringSwitchJumpTable() { m_unlinkedStringSwitchJumpTables.append(UnlinkedStringJumpTable()); return m_unlinkedStringSwitchJumpTables.last(); }
99+
UnlinkedStringJumpTable& unlinkedStringSwitchJumpTable(int tableIndex) { return m_unlinkedStringSwitchJumpTables[tableIndex]; }
100100

101101
size_t numberOfExceptionHandlers() const { return m_exceptionHandlers.size(); }
102102
UnlinkedHandlerInfo& exceptionHandler(int index) { return m_exceptionHandlers[index]; }
@@ -205,7 +205,7 @@ class UnlinkedCodeBlockGenerator {
205205
// In RareData.
206206
Vector<UnlinkedHandlerInfo> m_exceptionHandlers;
207207
Vector<UnlinkedSimpleJumpTable> m_switchJumpTables;
208-
Vector<UnlinkedStringJumpTable> m_stringSwitchJumpTables;
208+
Vector<UnlinkedStringJumpTable> m_unlinkedStringSwitchJumpTables;
209209
Vector<ExpressionRangeInfo::FatPosition> m_expressionInfoFatPositions;
210210
HashMap<unsigned, UnlinkedCodeBlock::RareData::TypeProfilerExpressionRange> m_typeProfilerInfoMap;
211211
Vector<InstructionStream::Offset> m_opProfileControlFlowBytecodeOffsets;

0 commit comments

Comments
 (0)