Skip to content

Commit ec085c1

Browse files
gezalorewebkit-commit-queue
authored andcommitted
[JSC] Port EXTRA_CTI_THUNKS to all platforms
https://bugs.webkit.org/show_bug.cgi?id=233822 Patch by Geza Lore <glore@igalia.com> on 2022-03-01 Reviewed by Saam Barati. Source/JavaScriptCore: Port and enable all code paths under #ifdef ENABLE(EXTRA_CTI_THUNKS) on all platforms, and remove the now unused code paths. To port the extra thunks to all platforms, it was necessary to enable them to do function calls to C++ slow path operations, which on some platforms require passing arguments on the stack. To enable this, CCallHelpers::emitCTIThunkPrologue and CCallHelpers::emitCTIThunkEpilogue are introduced that allocate some additional stack space on platforms where this is necessary. Additionally, the thunks that require subsequent exception checking now tail call directly to the exception check thunk, rather than returning to the baseline code and do a separate call to the exception check thunk. This saves an extra call site in the generated baseline ops and reduces code size on all platforms (~1.5% reduction on x86_64). Also factored out the statically allocated register definitions for baseline ops into BaselineJITRegisters.h, as there are now quite a lot of them and some are somewhat elaborate. This necessitates moving the noOverlap and preferredArgumentGPR/preferredArgumentJSR constexpr functions out from their previous place, so these now live in GPRInfo.h Enabling the extra CTI thunks on ARMv7/Thumb-2 saves about 25% baseline code size, according to --dumpLinkBufferStats. * assembler/MacroAssembler.h: (JSC::MacroAssembler::subPtr): * assembler/MacroAssemblerARMv7.h: (JSC::MacroAssemblerARMv7::scratchRegister): * assembler/MacroAssemblerX86_64.h: (JSC::MacroAssemblerX86_64::sub64): * bytecode/PolymorphicAccess.cpp: (JSC::AccessGenerationState::emitExplicitExceptionHandler): * bytecode/StructureStubInfo.cpp: (JSC::StructureStubInfo::initializeFromUnlinkedStructureStubInfo): * dfg/DFGJITCompiler.cpp: (JSC::DFG::JITCompiler::link): (JSC::DFG::JITCompiler::compile): (JSC::DFG::JITCompiler::compileFunction): * dfg/DFGJITCompiler.h: * ftl/FTLCompile.cpp: (JSC::FTL::compile): * ftl/FTLLink.cpp: (JSC::FTL::link): * jit/CCallHelpers.h: (JSC::CCallHelpers::emitCTIThunkPrologue): (JSC::CCallHelpers::emitCTIThunkEpilogue): * jit/JIT.cpp: (JSC::JIT::emitSlowCaseCall): (JSC::JIT::privateCompileSlowCases): (JSC::JIT::compileAndLinkWithoutFinalizing): (JSC::JIT::link): * jit/JIT.h: * jit/JITArithmetic.cpp: (JSC::JIT::emitSlow_op_mod): (JSC::JIT::emit_op_mod): (JSC::JIT::emit_op_div): * jit/JITCall.cpp: (JSC::JIT::emit_op_iterator_open): (JSC::JIT::emit_op_iterator_next): (JSC::JIT::emitSlow_op_iterator_next): * jit/JITInlineCacheGenerator.cpp: (JSC::JITGetByIdGenerator::generateBaselineDataICFastPath): (JSC::JITGetByIdWithThisGenerator::generateBaselineDataICFastPath): (JSC::JITPutByIdGenerator::generateBaselineDataICFastPath): * jit/JITInlineCacheGenerator.h: * jit/JITOpcodes.cpp: (JSC::JIT::emit_op_jfalse): (JSC::JIT::valueIsFalseyGenerator): (JSC::JIT::emit_op_jtrue): (JSC::JIT::valueIsTruthyGenerator): (JSC::JIT::emit_op_throw): (JSC::JIT::op_throw_handlerGenerator): (JSC::JIT::emit_op_enter): (JSC::JIT::op_enter_handlerGenerator): (JSC::JIT::emitSlow_op_check_traps): (JSC::JIT::op_check_traps_handlerGenerator): * jit/JITPropertyAccess.cpp: (JSC::JIT::emit_op_get_by_val): (JSC::JIT::generateGetByValSlowCase): (JSC::JIT::slow_op_get_by_val_callSlowOperationThenCheckExceptionGenerator): (JSC::JIT::emit_op_get_private_name): (JSC::JIT::emitSlow_op_get_private_name): (JSC::JIT::slow_op_get_private_name_callSlowOperationThenCheckExceptionGenerator): (JSC::JIT::emit_op_set_private_brand): (JSC::JIT::emitSlow_op_set_private_brand): (JSC::JIT::emit_op_check_private_brand): (JSC::JIT::emitSlow_op_check_private_brand): (JSC::JIT::emit_op_put_by_val): (JSC::JIT::emitSlow_op_put_by_val): (JSC::JIT::slow_op_put_by_val_callSlowOperationThenCheckExceptionGenerator): (JSC::JIT::emit_op_put_private_name): (JSC::JIT::emitSlow_op_put_private_name): (JSC::JIT::slow_op_put_private_name_callSlowOperationThenCheckExceptionGenerator): (JSC::JIT::emit_op_del_by_id): (JSC::JIT::emitSlow_op_del_by_id): (JSC::JIT::slow_op_del_by_id_callSlowOperationThenCheckExceptionGenerator): (JSC::JIT::emit_op_del_by_val): (JSC::JIT::emitSlow_op_del_by_val): (JSC::JIT::slow_op_del_by_val_callSlowOperationThenCheckExceptionGenerator): (JSC::JIT::emit_op_try_get_by_id): (JSC::JIT::emitSlow_op_try_get_by_id): (JSC::JIT::emit_op_get_by_id_direct): (JSC::JIT::emitSlow_op_get_by_id_direct): (JSC::JIT::emit_op_get_by_id): (JSC::JIT::emitSlow_op_get_by_id): (JSC::JIT::slow_op_get_by_id_callSlowOperationThenCheckExceptionGenerator): (JSC::JIT::emit_op_get_by_id_with_this): (JSC::JIT::emitSlow_op_get_by_id_with_this): (JSC::JIT::slow_op_get_by_id_with_this_callSlowOperationThenCheckExceptionGenerator): (JSC::JIT::emit_op_put_by_id): (JSC::JIT::emitSlow_op_put_by_id): (JSC::JIT::slow_op_put_by_id_callSlowOperationThenCheckExceptionGenerator): (JSC::JIT::emitSlow_op_in_by_id): (JSC::JIT::emitSlow_op_in_by_val): (JSC::JIT::emitHasPrivateSlow): (JSC::JIT::emitSlow_op_has_private_name): (JSC::JIT::emitSlow_op_has_private_brand): (JSC::JIT::emitSlow_op_put_to_scope): (JSC::JIT::slow_op_put_to_scopeGenerator): (JSC::JIT::emit_op_get_property_enumerator): (JSC::JIT::emit_op_enumerator_next): (JSC::JIT::emit_enumerator_has_propertyImpl): (JSC::JIT::emit_op_enumerator_get_by_val): (JSC::JIT::emit_op_enumerator_in_by_val): (JSC::JIT::emit_op_enumerator_has_own_property): * jit/JITThunks.cpp: * jit/JITThunks.h: * jit/SlowPathCall.cpp: (JSC::JITSlowPathCall::call): (JSC::JITSlowPathCall::generateThunk): * jit/SlowPathCall.h: (JSC::JITSlowPathCall::JITSlowPathCall): * jit/ThunkGenerators.cpp: (JSC::handleExceptionGenerator): (JSC::checkExceptionGenerator): * jit/ThunkGenerators.h: Source/WTF: * wtf/PlatformEnable.h: Remove EXTRA_CTI_THUNKS define (now always on on all platforms) Canonical link: https://commits.webkit.org/247920@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@290647 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 5f5c03c commit ec085c1

36 files changed

Lines changed: 1771 additions & 1989 deletions

Source/JavaScriptCore/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -843,6 +843,7 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
843843
jit/AssemblyHelpers.h
844844
jit/AssemblyHelpersSpoolers.h
845845
jit/BaselineJITCode.h
846+
jit/BaselineJITRegisters.h
846847
jit/CallFrameShuffleData.h
847848
jit/CCallHelpers.h
848849
jit/ExecutableAllocator.h

Source/JavaScriptCore/ChangeLog

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,149 @@
1+
2022-03-01 Geza Lore <glore@igalia.com>
2+
3+
[JSC] Port EXTRA_CTI_THUNKS to all platforms
4+
https://bugs.webkit.org/show_bug.cgi?id=233822
5+
6+
Reviewed by Saam Barati.
7+
8+
Port and enable all code paths under #ifdef ENABLE(EXTRA_CTI_THUNKS)
9+
on all platforms, and remove the now unused code paths.
10+
11+
To port the extra thunks to all platforms, it was necessary to enable
12+
them to do function calls to C++ slow path operations, which on some
13+
platforms require passing arguments on the stack. To enable this,
14+
CCallHelpers::emitCTIThunkPrologue and
15+
CCallHelpers::emitCTIThunkEpilogue are introduced that allocate some
16+
additional stack space on platforms where this is necessary.
17+
18+
Additionally, the thunks that require subsequent exception checking
19+
now tail call directly to the exception check thunk, rather than
20+
returning to the baseline code and do a separate call to the exception
21+
check thunk. This saves an extra call site in the generated baseline
22+
ops and reduces code size on all platforms (~1.5% reduction on x86_64).
23+
24+
Also factored out the statically allocated register definitions for
25+
baseline ops into BaselineJITRegisters.h, as there are now quite a lot
26+
of them and some are somewhat elaborate. This necessitates moving the
27+
noOverlap and preferredArgumentGPR/preferredArgumentJSR constexpr
28+
functions out from their previous place, so these now live in
29+
GPRInfo.h
30+
31+
Enabling the extra CTI thunks on ARMv7/Thumb-2 saves about 25%
32+
baseline code size, according to --dumpLinkBufferStats.
33+
34+
* assembler/MacroAssembler.h:
35+
(JSC::MacroAssembler::subPtr):
36+
* assembler/MacroAssemblerARMv7.h:
37+
(JSC::MacroAssemblerARMv7::scratchRegister):
38+
* assembler/MacroAssemblerX86_64.h:
39+
(JSC::MacroAssemblerX86_64::sub64):
40+
* bytecode/PolymorphicAccess.cpp:
41+
(JSC::AccessGenerationState::emitExplicitExceptionHandler):
42+
* bytecode/StructureStubInfo.cpp:
43+
(JSC::StructureStubInfo::initializeFromUnlinkedStructureStubInfo):
44+
* dfg/DFGJITCompiler.cpp:
45+
(JSC::DFG::JITCompiler::link):
46+
(JSC::DFG::JITCompiler::compile):
47+
(JSC::DFG::JITCompiler::compileFunction):
48+
* dfg/DFGJITCompiler.h:
49+
* ftl/FTLCompile.cpp:
50+
(JSC::FTL::compile):
51+
* ftl/FTLLink.cpp:
52+
(JSC::FTL::link):
53+
* jit/CCallHelpers.h:
54+
(JSC::CCallHelpers::emitCTIThunkPrologue):
55+
(JSC::CCallHelpers::emitCTIThunkEpilogue):
56+
* jit/JIT.cpp:
57+
(JSC::JIT::emitSlowCaseCall):
58+
(JSC::JIT::privateCompileSlowCases):
59+
(JSC::JIT::compileAndLinkWithoutFinalizing):
60+
(JSC::JIT::link):
61+
* jit/JIT.h:
62+
* jit/JITArithmetic.cpp:
63+
(JSC::JIT::emitSlow_op_mod):
64+
(JSC::JIT::emit_op_mod):
65+
(JSC::JIT::emit_op_div):
66+
* jit/JITCall.cpp:
67+
(JSC::JIT::emit_op_iterator_open):
68+
(JSC::JIT::emit_op_iterator_next):
69+
(JSC::JIT::emitSlow_op_iterator_next):
70+
* jit/JITInlineCacheGenerator.cpp:
71+
(JSC::JITGetByIdGenerator::generateBaselineDataICFastPath):
72+
(JSC::JITGetByIdWithThisGenerator::generateBaselineDataICFastPath):
73+
(JSC::JITPutByIdGenerator::generateBaselineDataICFastPath):
74+
* jit/JITInlineCacheGenerator.h:
75+
* jit/JITOpcodes.cpp:
76+
(JSC::JIT::emit_op_jfalse):
77+
(JSC::JIT::valueIsFalseyGenerator):
78+
(JSC::JIT::emit_op_jtrue):
79+
(JSC::JIT::valueIsTruthyGenerator):
80+
(JSC::JIT::emit_op_throw):
81+
(JSC::JIT::op_throw_handlerGenerator):
82+
(JSC::JIT::emit_op_enter):
83+
(JSC::JIT::op_enter_handlerGenerator):
84+
(JSC::JIT::emitSlow_op_check_traps):
85+
(JSC::JIT::op_check_traps_handlerGenerator):
86+
* jit/JITPropertyAccess.cpp:
87+
(JSC::JIT::emit_op_get_by_val):
88+
(JSC::JIT::generateGetByValSlowCase):
89+
(JSC::JIT::slow_op_get_by_val_callSlowOperationThenCheckExceptionGenerator):
90+
(JSC::JIT::emit_op_get_private_name):
91+
(JSC::JIT::emitSlow_op_get_private_name):
92+
(JSC::JIT::slow_op_get_private_name_callSlowOperationThenCheckExceptionGenerator):
93+
(JSC::JIT::emit_op_set_private_brand):
94+
(JSC::JIT::emitSlow_op_set_private_brand):
95+
(JSC::JIT::emit_op_check_private_brand):
96+
(JSC::JIT::emitSlow_op_check_private_brand):
97+
(JSC::JIT::emit_op_put_by_val):
98+
(JSC::JIT::emitSlow_op_put_by_val):
99+
(JSC::JIT::slow_op_put_by_val_callSlowOperationThenCheckExceptionGenerator):
100+
(JSC::JIT::emit_op_put_private_name):
101+
(JSC::JIT::emitSlow_op_put_private_name):
102+
(JSC::JIT::slow_op_put_private_name_callSlowOperationThenCheckExceptionGenerator):
103+
(JSC::JIT::emit_op_del_by_id):
104+
(JSC::JIT::emitSlow_op_del_by_id):
105+
(JSC::JIT::slow_op_del_by_id_callSlowOperationThenCheckExceptionGenerator):
106+
(JSC::JIT::emit_op_del_by_val):
107+
(JSC::JIT::emitSlow_op_del_by_val):
108+
(JSC::JIT::slow_op_del_by_val_callSlowOperationThenCheckExceptionGenerator):
109+
(JSC::JIT::emit_op_try_get_by_id):
110+
(JSC::JIT::emitSlow_op_try_get_by_id):
111+
(JSC::JIT::emit_op_get_by_id_direct):
112+
(JSC::JIT::emitSlow_op_get_by_id_direct):
113+
(JSC::JIT::emit_op_get_by_id):
114+
(JSC::JIT::emitSlow_op_get_by_id):
115+
(JSC::JIT::slow_op_get_by_id_callSlowOperationThenCheckExceptionGenerator):
116+
(JSC::JIT::emit_op_get_by_id_with_this):
117+
(JSC::JIT::emitSlow_op_get_by_id_with_this):
118+
(JSC::JIT::slow_op_get_by_id_with_this_callSlowOperationThenCheckExceptionGenerator):
119+
(JSC::JIT::emit_op_put_by_id):
120+
(JSC::JIT::emitSlow_op_put_by_id):
121+
(JSC::JIT::slow_op_put_by_id_callSlowOperationThenCheckExceptionGenerator):
122+
(JSC::JIT::emitSlow_op_in_by_id):
123+
(JSC::JIT::emitSlow_op_in_by_val):
124+
(JSC::JIT::emitHasPrivateSlow):
125+
(JSC::JIT::emitSlow_op_has_private_name):
126+
(JSC::JIT::emitSlow_op_has_private_brand):
127+
(JSC::JIT::emitSlow_op_put_to_scope):
128+
(JSC::JIT::slow_op_put_to_scopeGenerator):
129+
(JSC::JIT::emit_op_get_property_enumerator):
130+
(JSC::JIT::emit_op_enumerator_next):
131+
(JSC::JIT::emit_enumerator_has_propertyImpl):
132+
(JSC::JIT::emit_op_enumerator_get_by_val):
133+
(JSC::JIT::emit_op_enumerator_in_by_val):
134+
(JSC::JIT::emit_op_enumerator_has_own_property):
135+
* jit/JITThunks.cpp:
136+
* jit/JITThunks.h:
137+
* jit/SlowPathCall.cpp:
138+
(JSC::JITSlowPathCall::call):
139+
(JSC::JITSlowPathCall::generateThunk):
140+
* jit/SlowPathCall.h:
141+
(JSC::JITSlowPathCall::JITSlowPathCall):
142+
* jit/ThunkGenerators.cpp:
143+
(JSC::handleExceptionGenerator):
144+
(JSC::checkExceptionGenerator):
145+
* jit/ThunkGenerators.h:
146+
1147
2022-02-28 Devin Rousso <drousso@apple.com>
2148

3149
Web Inspector: [Flexbox] Add options to show each area's CSS `order` and/or DOM index in the parent flex container

Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,6 +1203,7 @@
12031203
72131BFA26587EF2007114CF /* JITPlanStage.h in Headers */ = {isa = PBXBuildFile; fileRef = 72131BF626587EF2007114CF /* JITPlanStage.h */; };
12041204
72131BFC26587EFA007114CF /* JITWorklistInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 72131BFB26587EFA007114CF /* JITWorklistInlines.h */; };
12051205
723998F7265DBCDB0057867F /* BaselineJITPlan.h in Headers */ = {isa = PBXBuildFile; fileRef = 723998F5265DBCDB0057867F /* BaselineJITPlan.h */; };
1206+
724000F7282DBCDB1057867F /* BaselineJITRegisters.h in Headers */ = {isa = PBXBuildFile; fileRef = 724009F5278DBCDB0057867F /* BaselineJITRegisters.h */; settings = {ATTRIBUTES = (Private, ); }; };
12061207
726B91B026581653008E6F82 /* JITWorklistThread.h in Headers */ = {isa = PBXBuildFile; fileRef = 726B91A826581652008E6F82 /* JITWorklistThread.h */; };
12071208
726B91B326581653008E6F82 /* JITCompilationMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 726B91AB26581653008E6F82 /* JITCompilationMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
12081209
726B91B726581653008E6F82 /* JITPlan.h in Headers */ = {isa = PBXBuildFile; fileRef = 726B91AF26581653008E6F82 /* JITPlan.h */; };
@@ -4244,6 +4245,7 @@
42444245
72131BFB26587EFA007114CF /* JITWorklistInlines.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITWorklistInlines.h; sourceTree = "<group>"; };
42454246
723998F5265DBCDB0057867F /* BaselineJITPlan.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaselineJITPlan.h; sourceTree = "<group>"; };
42464247
723998F6265DBCDB0057867F /* BaselineJITPlan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = BaselineJITPlan.cpp; sourceTree = "<group>"; };
4248+
724009F5278DBCDB0057867F /* BaselineJITRegisters.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BaselineJITRegisters.h; sourceTree = "<group>"; };
42474249
726B91A826581652008E6F82 /* JITWorklistThread.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITWorklistThread.h; sourceTree = "<group>"; };
42484250
726B91AA26581653008E6F82 /* JITPlan.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JITPlan.cpp; sourceTree = "<group>"; };
42494251
726B91AB26581653008E6F82 /* JITCompilationMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JITCompilationMode.h; sourceTree = "<group>"; };
@@ -6493,6 +6495,7 @@
64936495
52DD000626E039B30054E408 /* BaselineJITCode.h */,
64946496
723998F6265DBCDB0057867F /* BaselineJITPlan.cpp */,
64956497
723998F5265DBCDB0057867F /* BaselineJITPlan.h */,
6498+
724009F5278DBCDB0057867F /* BaselineJITRegisters.h */,
64966499
0F64B26F1A784BAF006E4E66 /* BinarySwitch.cpp */,
64976500
0F64B2701A784BAF006E4E66 /* BinarySwitch.h */,
64986501
65B8392D1BACA9D30044E824 /* CachedRecovery.cpp */,
@@ -9841,6 +9844,7 @@
98419844
0F2C63B21E60AE4700C13839 /* B3Width.h in Headers */,
98429845
52DD000826E039B90054E408 /* BaselineJITCode.h in Headers */,
98439846
723998F7265DBCDB0057867F /* BaselineJITPlan.h in Headers */,
9847+
724000F7282DBCDB1057867F /* BaselineJITRegisters.h in Headers */,
98449848
52678F8F1A031009006A306D /* BasicBlockLocation.h in Headers */,
98459849
147B83AC0E6DB8C9004775A4 /* BatchedTransitionOptimizer.h in Headers */,
98469850
E35E89FD25C50F870071EE1E /* BigInt64Array.h in Headers */,

Source/JavaScriptCore/assembler/MacroAssembler.h

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -674,12 +674,22 @@ class MacroAssembler : public MacroAssemblerBase {
674674
{
675675
sub32(src, dest);
676676
}
677-
677+
678+
void subPtr(RegisterID left, RegisterID right, RegisterID dest)
679+
{
680+
sub32(left, right, dest);
681+
}
682+
678683
void subPtr(TrustedImm32 imm, RegisterID dest)
679684
{
680685
sub32(imm, dest);
681686
}
682-
687+
688+
void subPtr(RegisterID left, TrustedImm32 right, RegisterID dest)
689+
{
690+
sub32(left, right, dest);
691+
}
692+
683693
void subPtr(TrustedImmPtr imm, RegisterID dest)
684694
{
685695
sub32(TrustedImm32(imm), dest);
@@ -1007,12 +1017,22 @@ class MacroAssembler : public MacroAssemblerBase {
10071017
{
10081018
sub64(src, dest);
10091019
}
1010-
1020+
1021+
void subPtr(RegisterID left, RegisterID right, RegisterID dest)
1022+
{
1023+
sub64(left, right, dest);
1024+
}
1025+
10111026
void subPtr(TrustedImm32 imm, RegisterID dest)
10121027
{
10131028
sub64(imm, dest);
10141029
}
1015-
1030+
1031+
void subPtr(RegisterID left, TrustedImm32 right, RegisterID dest)
1032+
{
1033+
sub64(left, right, dest);
1034+
}
1035+
10161036
void subPtr(TrustedImmPtr imm, RegisterID dest)
10171037
{
10181038
sub64(TrustedImm64(imm), dest);

Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class MacroAssemblerARMv7 : public AbstractMacroAssembler<Assembler> {
5959
static constexpr unsigned numGPRs = std::initializer_list<int>({ FOR_EACH_GP_REGISTER(DUMMY_REGISTER_VALUE) }).size();
6060
static constexpr unsigned numFPRs = std::initializer_list<int>({ FOR_EACH_FP_REGISTER(DUMMY_REGISTER_VALUE) }).size();
6161
#undef DUMMY_REGISTER_VALUE
62-
RegisterID scratchRegister() { return addressTempRegister; }
62+
static constexpr RegisterID scratchRegister() { return addressTempRegister; }
6363

6464
MacroAssemblerARMv7()
6565
: m_makeJumpPatchable(false)

Source/JavaScriptCore/assembler/MacroAssemblerX86_64.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -804,7 +804,13 @@ class MacroAssemblerX86_64 : public MacroAssemblerX86Common {
804804
else
805805
m_assembler.subq_ir(imm.m_value, dest);
806806
}
807-
807+
808+
void sub64(RegisterID a, TrustedImm32 imm, RegisterID dest)
809+
{
810+
move(a, dest);
811+
sub64(imm, dest);
812+
}
813+
808814
void sub64(TrustedImm64 imm, RegisterID dest)
809815
{
810816
if (imm.m_value == 1)

Source/JavaScriptCore/bytecode/CallLinkInfo.h

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525

2626
#pragma once
2727

28+
#include "BaselineJITRegisters.h"
2829
#include "CallFrameShuffleData.h"
2930
#include "CallMode.h"
3031
#include "CodeLocation.h"
@@ -47,14 +48,6 @@ enum OpcodeID : unsigned;
4748
struct CallFrameShuffleData;
4849
struct UnlinkedCallLinkInfo;
4950

50-
#if ENABLE(JIT)
51-
namespace BaselineCallRegisters {
52-
constexpr JSValueRegs calleeJSR { JSRInfo::jsRegT10 };
53-
constexpr GPRReg calleeGPR { GPRInfo::regT0 };
54-
constexpr GPRReg callLinkInfoGPR { GPRInfo::regT2 };
55-
}
56-
#endif
57-
5851
class CallLinkInfo : public PackedRawSentinelNode<CallLinkInfo> {
5952
public:
6053
friend class LLIntOffsetsExtractor;
@@ -462,9 +455,9 @@ class BaselineCallLinkInfo final : public CallLinkInfo {
462455
}
463456

464457
#if ENABLE(JIT)
465-
static constexpr GPRReg calleeGPR() { return BaselineCallRegisters::calleeGPR; }
466-
static constexpr GPRReg callLinkInfoGPR() { return BaselineCallRegisters::callLinkInfoGPR; }
467-
void setCallLinkInfoGPR(GPRReg callLinkInfoGPR) { RELEASE_ASSERT(callLinkInfoGPR == BaselineCallRegisters::callLinkInfoGPR); }
458+
static constexpr GPRReg calleeGPR() { return BaselineJITRegisters::Call::calleeGPR; }
459+
static constexpr GPRReg callLinkInfoGPR() { return BaselineJITRegisters::Call::callLinkInfoGPR; }
460+
void setCallLinkInfoGPR(GPRReg callLinkInfoGPR) { RELEASE_ASSERT(callLinkInfoGPR == BaselineJITRegisters::Call::callLinkInfoGPR); }
468461
#endif
469462
};
470463

Source/JavaScriptCore/bytecode/PolymorphicAccess.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -233,23 +233,12 @@ void AccessGenerationState::emitExplicitExceptionHandler()
233233
linkBuffer.link(jumpToOSRExitExceptionHandler, originalHandler.nativeCode);
234234
});
235235
} else {
236-
#if ENABLE(EXTRA_CTI_THUNKS)
237236
CCallHelpers::Jump jumpToExceptionHandler = jit->jump();
238237
VM* vm = &m_vm;
239238
jit->addLinkTask(
240239
[=] (LinkBuffer& linkBuffer) {
241240
linkBuffer.link(jumpToExceptionHandler, CodeLocationLabel(vm->getCTIStub(handleExceptionGenerator).retaggedCode<NoPtrTag>()));
242241
});
243-
#else
244-
jit->setupArguments<decltype(operationLookupExceptionHandler)>(CCallHelpers::TrustedImmPtr(&m_vm));
245-
jit->prepareCallOperation(m_vm);
246-
CCallHelpers::Call lookupExceptionHandlerCall = jit->call(OperationPtrTag);
247-
jit->addLinkTask(
248-
[=] (LinkBuffer& linkBuffer) {
249-
linkBuffer.link(lookupExceptionHandlerCall, FunctionPtr<OperationPtrTag>(operationLookupExceptionHandler));
250-
});
251-
jit->jumpToExceptionHandler(m_vm);
252-
#endif
253242
}
254243
}
255244

0 commit comments

Comments
 (0)