Skip to content

Commit db55065

Browse files
committed
[JSC] Enable LLInt ASM interpreter on X64 and ARM64 in non JIT configuration
https://bugs.webkit.org/show_bug.cgi?id=189778 Reviewed by Keith Miller. .: ENABLE_SAMPLING_PROFILER does not depend on ENABLE_JIT now since it can be used with LLInt ASM interpreter. * Source/cmake/WebKitFeatures.cmake: Source/JavaScriptCore: LLInt ASM interpreter is 2x and 15% faster than CLoop interpreter on Linux and macOS respectively. We would like to enable it for non JIT configurations in X86_64 and ARM64. This patch enables LLInt for non JIT builds in X86_64 and ARM64 architectures. Previously, we switch LLInt ASM interpreter and CLoop by using ENABLE(JIT) configuration. But it is wrong in the new scenario since we have a build configuration that uses LLInt ASM interpreter and JIT is disabled. We introduce ENABLE(C_LOOP) option, which represents that we use CLoop. And we replace ENABLE(JIT) with ENABLE(C_LOOP) if the previous ENABLE(JIT) is essentially just related to LLInt ASM interpreter and not related to JIT. We also replace some ENABLE(JIT) configurations with ENABLE(ASSEMBLER). ENABLE(ASSEMBLER) is now enabled even if we disable JIT since MacroAssembler has machine register information that is used in LLInt ASM interpreter. * API/tests/PingPongStackOverflowTest.cpp: (testPingPongStackOverflow): * CMakeLists.txt: * JavaScriptCore.xcodeproj/project.pbxproj: * assembler/MaxFrameExtentForSlowPathCall.h: * bytecode/CallReturnOffsetToBytecodeOffset.h: Removed. It is no longer used. * bytecode/CodeBlock.cpp: (JSC::CodeBlock::finishCreation): * bytecode/CodeBlock.h: (JSC::CodeBlock::calleeSaveRegisters const): (JSC::CodeBlock::numberOfLLIntBaselineCalleeSaveRegisters): (JSC::CodeBlock::llintBaselineCalleeSaveSpaceAsVirtualRegisters): (JSC::CodeBlock::calleeSaveSpaceAsVirtualRegisters): * bytecode/Opcode.h: (JSC::padOpcodeName): * heap/Heap.cpp: (JSC::Heap::gatherJSStackRoots): (JSC::Heap::stopThePeriphery): * interpreter/CLoopStack.cpp: * interpreter/CLoopStack.h: * interpreter/CLoopStackInlines.h: * interpreter/EntryFrame.h: * interpreter/Interpreter.cpp: (JSC::Interpreter::Interpreter): (JSC::UnwindFunctor::copyCalleeSavesToEntryFrameCalleeSavesBuffer const): * interpreter/Interpreter.h: * interpreter/StackVisitor.cpp: (JSC::StackVisitor::Frame::calleeSaveRegisters): * interpreter/VMEntryRecord.h: * jit/ExecutableAllocator.h: * jit/FPRInfo.h: (WTF::printInternal): * jit/GPRInfo.cpp: * jit/GPRInfo.h: (WTF::printInternal): * jit/HostCallReturnValue.cpp: (JSC::getHostCallReturnValueWithExecState): Moved. They are used in LLInt ASM interpreter too. * jit/HostCallReturnValue.h: * jit/JITOperations.cpp: (JSC::getHostCallReturnValueWithExecState): Deleted. * jit/JITOperationsMSVC64.cpp: * jit/Reg.cpp: * jit/Reg.h: * jit/RegisterAtOffset.cpp: * jit/RegisterAtOffset.h: * jit/RegisterAtOffsetList.cpp: * jit/RegisterAtOffsetList.h: * jit/RegisterMap.h: * jit/RegisterSet.cpp: * jit/RegisterSet.h: * jit/TempRegisterSet.cpp: * jit/TempRegisterSet.h: * llint/LLIntCLoop.cpp: * llint/LLIntCLoop.h: * llint/LLIntData.cpp: (JSC::LLInt::initialize): (JSC::LLInt::Data::performAssertions): * llint/LLIntData.h: * llint/LLIntOfflineAsmConfig.h: * llint/LLIntOpcode.h: * llint/LLIntPCRanges.h: * llint/LLIntSlowPaths.cpp: (JSC::LLInt::LLINT_SLOW_PATH_DECL): * llint/LLIntSlowPaths.h: * llint/LLIntThunks.cpp: * llint/LowLevelInterpreter.cpp: * llint/LowLevelInterpreter.h: * runtime/JSCJSValue.h: * runtime/MachineContext.h: * runtime/SamplingProfiler.cpp: (JSC::SamplingProfiler::processUnverifiedStackTraces): Enable SamplingProfiler for LLInt ASM interpreter with non JIT configuration. * runtime/TestRunnerUtils.cpp: (JSC::optimizeNextInvocation): * runtime/VM.cpp: (JSC::VM::VM): (JSC::VM::getHostFunction): (JSC::VM::updateSoftReservedZoneSize): (JSC::sanitizeStackForVM): (JSC::VM::committedStackByteCount): * runtime/VM.h: * runtime/VMInlines.h: (JSC::VM::ensureStackCapacityFor): (JSC::VM::isSafeToRecurseSoft const): Source/WTF: This patch adds ENABLE(C_LOOP) which indicates we use CLoop as the interpreter. Previously, we used !ENABLE(JIT) for this configuration. But now, we have a build configuration that has LLInt ASM interpreter (not CLoop) and !ENABLE(JIT). We enable LLInt ASM interpreter for non JIT environment in X86_64 and ARM64 architectures. And we enable ENABLE(ASSEMBLER) for non JIT environment since it offers machine register information which is used for LLInt and SamplingProfiler. * wtf/Platform.h: Canonical link: https://commits.webkit.org/204834@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236381 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 2457d10 commit db55065

60 files changed

Lines changed: 413 additions & 304 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎ChangeLog‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
2018-09-21 Yusuke Suzuki <yusukesuzuki@slowstart.org>
2+
3+
[JSC] Enable LLInt ASM interpreter on X64 and ARM64 in non JIT configuration
4+
https://bugs.webkit.org/show_bug.cgi?id=189778
5+
6+
Reviewed by Keith Miller.
7+
8+
ENABLE_SAMPLING_PROFILER does not depend on ENABLE_JIT now since it can be
9+
used with LLInt ASM interpreter.
10+
11+
* Source/cmake/WebKitFeatures.cmake:
12+
113
2018-09-21 Mike Gorse <mgorse@suse.com>
214

315
Build tools should work when the /usr/bin/python is python3

‎Source/JavaScriptCore/API/tests/PingPongStackOverflowTest.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ int testPingPongStackOverflow()
127127

128128
Options::softReservedZoneSize() = 128 * KB;
129129
Options::reservedZoneSize() = 64 * KB;
130-
#if ENABLE(JIT)
130+
#if ENABLE(C_LOOP)
131131
// Normally, we want to disable the LLINT to force the use of JITted code which is necessary for
132132
// reproducing the regression in https://bugs.webkit.org/show_bug.cgi?id=148749. However, we only
133133
// want to do this if the LLINT isn't the only available execution engine.

‎Source/JavaScriptCore/CMakeLists.txt‎

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,9 @@ else ()
231231
endif ()
232232

233233
if (NOT ENABLE_JIT)
234-
set(OFFLINE_ASM_BACKEND "C_LOOP")
234+
if (ENABLE_C_LOOP)
235+
set(OFFLINE_ASM_BACKEND "C_LOOP")
236+
endif ()
235237
endif ()
236238
endif ()
237239

@@ -264,7 +266,7 @@ add_dependencies(LLIntOffsetsExtractor JavaScriptCoreForwardingHeaders)
264266
# LLIntOffsetsExtractor matches, no output is generated. To make this target consistent and avoid
265267
# running this command for every build, we artificially update LLIntAssembly.h's mtime (using touch)
266268
# after every asm.rb run.
267-
if (MSVC AND ENABLE_JIT)
269+
if (MSVC AND NOT ENABLE_C_LOOP)
268270
set(LLIntOutput LowLevelInterpreterWin.asm)
269271
set(OFFLINE_ASM_ARGS --assembler=MASM)
270272
else ()
@@ -284,7 +286,7 @@ add_custom_command(
284286
# the .cpp files below is similar to the one in the previous comment. However, since these .cpp
285287
# files are used to build JavaScriptCore itself, we can just add LLIntAssembly.h to JSC_HEADERS
286288
# since it is used in the add_library() call at the end of this file.
287-
if (MSVC AND ENABLE_JIT)
289+
if (MSVC AND NOT ENABLE_C_LOOP)
288290
enable_language(ASM_MASM)
289291
if (CMAKE_SIZEOF_VOID_P EQUAL 4)
290292
# Win32 needs /safeseh with assembly, but Win64 does not.
@@ -1182,7 +1184,7 @@ add_custom_command(
11821184
list(APPEND JavaScriptCore_HEADERS ${DERIVED_SOURCES_JAVASCRIPTCORE_DIR}/InjectedScriptSource.h)
11831185

11841186
if (WTF_CPU_X86_64)
1185-
if (MSVC AND ENABLE_JIT)
1187+
if (MSVC AND NOT ENABLE_C_LOOP)
11861188
add_custom_command(
11871189
OUTPUT ${DERIVED_SOURCES_DIR}/JITStubsMSVC64.obj
11881190
MAIN_DEPENDENCY ${JAVASCRIPTCORE_DIR}/jit/JITStubsMSVC64.asm

‎Source/JavaScriptCore/ChangeLog‎

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,111 @@
1+
2018-09-21 Yusuke Suzuki <yusukesuzuki@slowstart.org>
2+
3+
[JSC] Enable LLInt ASM interpreter on X64 and ARM64 in non JIT configuration
4+
https://bugs.webkit.org/show_bug.cgi?id=189778
5+
6+
Reviewed by Keith Miller.
7+
8+
LLInt ASM interpreter is 2x and 15% faster than CLoop interpreter on
9+
Linux and macOS respectively. We would like to enable it for non JIT
10+
configurations in X86_64 and ARM64.
11+
12+
This patch enables LLInt for non JIT builds in X86_64 and ARM64 architectures.
13+
Previously, we switch LLInt ASM interpreter and CLoop by using ENABLE(JIT)
14+
configuration. But it is wrong in the new scenario since we have a build
15+
configuration that uses LLInt ASM interpreter and JIT is disabled. We introduce
16+
ENABLE(C_LOOP) option, which represents that we use CLoop. And we replace
17+
ENABLE(JIT) with ENABLE(C_LOOP) if the previous ENABLE(JIT) is essentially just
18+
related to LLInt ASM interpreter and not related to JIT.
19+
20+
We also replace some ENABLE(JIT) configurations with ENABLE(ASSEMBLER).
21+
ENABLE(ASSEMBLER) is now enabled even if we disable JIT since MacroAssembler
22+
has machine register information that is used in LLInt ASM interpreter.
23+
24+
* API/tests/PingPongStackOverflowTest.cpp:
25+
(testPingPongStackOverflow):
26+
* CMakeLists.txt:
27+
* JavaScriptCore.xcodeproj/project.pbxproj:
28+
* assembler/MaxFrameExtentForSlowPathCall.h:
29+
* bytecode/CallReturnOffsetToBytecodeOffset.h: Removed. It is no longer used.
30+
* bytecode/CodeBlock.cpp:
31+
(JSC::CodeBlock::finishCreation):
32+
* bytecode/CodeBlock.h:
33+
(JSC::CodeBlock::calleeSaveRegisters const):
34+
(JSC::CodeBlock::numberOfLLIntBaselineCalleeSaveRegisters):
35+
(JSC::CodeBlock::llintBaselineCalleeSaveSpaceAsVirtualRegisters):
36+
(JSC::CodeBlock::calleeSaveSpaceAsVirtualRegisters):
37+
* bytecode/Opcode.h:
38+
(JSC::padOpcodeName):
39+
* heap/Heap.cpp:
40+
(JSC::Heap::gatherJSStackRoots):
41+
(JSC::Heap::stopThePeriphery):
42+
* interpreter/CLoopStack.cpp:
43+
* interpreter/CLoopStack.h:
44+
* interpreter/CLoopStackInlines.h:
45+
* interpreter/EntryFrame.h:
46+
* interpreter/Interpreter.cpp:
47+
(JSC::Interpreter::Interpreter):
48+
(JSC::UnwindFunctor::copyCalleeSavesToEntryFrameCalleeSavesBuffer const):
49+
* interpreter/Interpreter.h:
50+
* interpreter/StackVisitor.cpp:
51+
(JSC::StackVisitor::Frame::calleeSaveRegisters):
52+
* interpreter/VMEntryRecord.h:
53+
* jit/ExecutableAllocator.h:
54+
* jit/FPRInfo.h:
55+
(WTF::printInternal):
56+
* jit/GPRInfo.cpp:
57+
* jit/GPRInfo.h:
58+
(WTF::printInternal):
59+
* jit/HostCallReturnValue.cpp:
60+
(JSC::getHostCallReturnValueWithExecState): Moved. They are used in LLInt ASM interpreter too.
61+
* jit/HostCallReturnValue.h:
62+
* jit/JITOperations.cpp:
63+
(JSC::getHostCallReturnValueWithExecState): Deleted.
64+
* jit/JITOperationsMSVC64.cpp:
65+
* jit/Reg.cpp:
66+
* jit/Reg.h:
67+
* jit/RegisterAtOffset.cpp:
68+
* jit/RegisterAtOffset.h:
69+
* jit/RegisterAtOffsetList.cpp:
70+
* jit/RegisterAtOffsetList.h:
71+
* jit/RegisterMap.h:
72+
* jit/RegisterSet.cpp:
73+
* jit/RegisterSet.h:
74+
* jit/TempRegisterSet.cpp:
75+
* jit/TempRegisterSet.h:
76+
* llint/LLIntCLoop.cpp:
77+
* llint/LLIntCLoop.h:
78+
* llint/LLIntData.cpp:
79+
(JSC::LLInt::initialize):
80+
(JSC::LLInt::Data::performAssertions):
81+
* llint/LLIntData.h:
82+
* llint/LLIntOfflineAsmConfig.h:
83+
* llint/LLIntOpcode.h:
84+
* llint/LLIntPCRanges.h:
85+
* llint/LLIntSlowPaths.cpp:
86+
(JSC::LLInt::LLINT_SLOW_PATH_DECL):
87+
* llint/LLIntSlowPaths.h:
88+
* llint/LLIntThunks.cpp:
89+
* llint/LowLevelInterpreter.cpp:
90+
* llint/LowLevelInterpreter.h:
91+
* runtime/JSCJSValue.h:
92+
* runtime/MachineContext.h:
93+
* runtime/SamplingProfiler.cpp:
94+
(JSC::SamplingProfiler::processUnverifiedStackTraces): Enable SamplingProfiler
95+
for LLInt ASM interpreter with non JIT configuration.
96+
* runtime/TestRunnerUtils.cpp:
97+
(JSC::optimizeNextInvocation):
98+
* runtime/VM.cpp:
99+
(JSC::VM::VM):
100+
(JSC::VM::getHostFunction):
101+
(JSC::VM::updateSoftReservedZoneSize):
102+
(JSC::sanitizeStackForVM):
103+
(JSC::VM::committedStackByteCount):
104+
* runtime/VM.h:
105+
* runtime/VMInlines.h:
106+
(JSC::VM::ensureStackCapacityFor):
107+
(JSC::VM::isSafeToRecurseSoft const):
108+
1109
2018-09-21 Keith Miller <keith_miller@apple.com>
2110

3111
Add Promise SPI

‎Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@
109109
0F0B83A914BCF56200885B4F /* HandlerInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83A814BCF55E00885B4F /* HandlerInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
110110
0F0B83AB14BCF5BB00885B4F /* ExpressionRangeInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83AA14BCF5B900885B4F /* ExpressionRangeInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
111111
0F0B83B114BCF71800885B4F /* CallLinkInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83AF14BCF71400885B4F /* CallLinkInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
112-
0F0B83B914BCF95F00885B4F /* CallReturnOffsetToBytecodeOffset.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0B83B814BCF95B00885B4F /* CallReturnOffsetToBytecodeOffset.h */; settings = {ATTRIBUTES = (Private, ); }; };
113112
0F0CAEFC1EC4DA6B00970D12 /* JSHeapFinalizerPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0CAEFA1EC4DA6200970D12 /* JSHeapFinalizerPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
114113
0F0CAEFF1EC4DA8800970D12 /* HeapFinalizerCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0CAEFE1EC4DA8500970D12 /* HeapFinalizerCallback.h */; settings = {ATTRIBUTES = (Private, ); }; };
115114
0F0CD4C215F1A6070032F1C0 /* PutDirectIndexMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0CD4C015F1A6040032F1C0 /* PutDirectIndexMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -2012,7 +2011,6 @@
20122011
0F0B83AA14BCF5B900885B4F /* ExpressionRangeInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExpressionRangeInfo.h; sourceTree = "<group>"; };
20132012
0F0B83AE14BCF71400885B4F /* CallLinkInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CallLinkInfo.cpp; sourceTree = "<group>"; };
20142013
0F0B83AF14BCF71400885B4F /* CallLinkInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallLinkInfo.h; sourceTree = "<group>"; };
2015-
0F0B83B814BCF95B00885B4F /* CallReturnOffsetToBytecodeOffset.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CallReturnOffsetToBytecodeOffset.h; sourceTree = "<group>"; };
20162014
0F0CAEF91EC4DA6200970D12 /* JSHeapFinalizerPrivate.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHeapFinalizerPrivate.cpp; sourceTree = "<group>"; };
20172015
0F0CAEFA1EC4DA6200970D12 /* JSHeapFinalizerPrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHeapFinalizerPrivate.h; sourceTree = "<group>"; };
20182016
0F0CAEFD1EC4DA8500970D12 /* HeapFinalizerCallback.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = HeapFinalizerCallback.cpp; sourceTree = "<group>"; };
@@ -7634,7 +7632,6 @@
76347632
0F93329414CA7DC10085F3C6 /* CallLinkStatus.h */,
76357633
627673211B680C1E00FD9F2E /* CallMode.cpp */,
76367634
627673221B680C1E00FD9F2E /* CallMode.h */,
7637-
0F0B83B814BCF95B00885B4F /* CallReturnOffsetToBytecodeOffset.h */,
76387635
0F3B7E2419A11B8000D9BC56 /* CallVariant.cpp */,
76397636
0F3B7E2519A11B8000D9BC56 /* CallVariant.h */,
76407637
969A07900ED1D3AE00F1F681 /* CodeBlock.cpp */,
@@ -8483,7 +8480,6 @@
84838480
0F0B83B114BCF71800885B4F /* CallLinkInfo.h in Headers */,
84848481
0F93329E14CA7DC50085F3C6 /* CallLinkStatus.h in Headers */,
84858482
627673241B680C1E00FD9F2E /* CallMode.h in Headers */,
8486-
0F0B83B914BCF95F00885B4F /* CallReturnOffsetToBytecodeOffset.h in Headers */,
84878483
0F3B7E2B19A11B8000D9BC56 /* CallVariant.h in Headers */,
84888484
FE80C1971D775CDD008510C0 /* CatchScope.h in Headers */,
84898485
0F24E54217EA9F5900ABB217 /* CCallHelpers.h in Headers */,

‎Source/JavaScriptCore/assembler/MaxFrameExtentForSlowPathCall.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ namespace JSC {
3535
// that can be used for outgoing args when calling a slow path C function
3636
// from JS code.
3737

38-
#if !ENABLE(JIT)
38+
#if !ENABLE(ASSEMBLER)
3939
static const size_t maxFrameExtentForSlowPathCall = 0;
4040

4141
#elif CPU(X86_64) && OS(WINDOWS)
@@ -69,7 +69,7 @@ static const size_t maxFrameExtentForSlowPathCall = 40;
6969

7070
COMPILE_ASSERT(!(maxFrameExtentForSlowPathCall % sizeof(Register)), extent_must_be_in_multiples_of_registers);
7171

72-
#if ENABLE(JIT)
72+
#if ENABLE(ASSEMBLER)
7373
// Make sure that cfr - maxFrameExtentForSlowPathCall bytes will make the stack pointer aligned
7474
COMPILE_ASSERT((maxFrameExtentForSlowPathCall % 16) == 16 - sizeof(CallerFrameAndPC), extent_must_align_stack_from_callframe_pointer);
7575
#endif

‎Source/JavaScriptCore/bytecode/CallReturnOffsetToBytecodeOffset.h‎

Lines changed: 0 additions & 54 deletions
This file was deleted.

‎Source/JavaScriptCore/bytecode/CodeBlock.cpp‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
#include <wtf/StringPrintStream.h>
9090
#include <wtf/text/UniquedStringImpl.h>
9191

92-
#if ENABLE(JIT)
92+
#if ENABLE(ASSEMBLER)
9393
#include "RegisterAtOffsetList.h"
9494
#endif
9595

@@ -509,7 +509,7 @@ bool CodeBlock::finishCreation(VM& vm, ScriptExecutable* ownerExecutable, Unlink
509509
if (size_t size = unlinkedCodeBlock->numberOfObjectAllocationProfiles())
510510
m_objectAllocationProfiles = RefCountedArray<ObjectAllocationProfile>(size);
511511

512-
#if ENABLE(JIT)
512+
#if !ENABLE(C_LOOP)
513513
setCalleeSaveRegisters(RegisterSet::llintBaselineCalleeSaveRegisters());
514514
#endif
515515

@@ -2145,7 +2145,7 @@ unsigned CodeBlock::reoptimizationRetryCounter() const
21452145
#endif // ENABLE(JIT)
21462146
}
21472147

2148-
#if ENABLE(JIT)
2148+
#if !ENABLE(C_LOOP)
21492149
void CodeBlock::setCalleeSaveRegisters(RegisterSet calleeSaveRegisters)
21502150
{
21512151
m_calleeSaveRegisters = std::make_unique<RegisterAtOffsetList>(calleeSaveRegisters);
@@ -2172,6 +2172,9 @@ size_t CodeBlock::calleeSaveSpaceAsVirtualRegisters()
21722172
{
21732173
return roundCalleeSaveSpaceAsVirtualRegisters(m_calleeSaveRegisters->size());
21742174
}
2175+
#endif
2176+
2177+
#if ENABLE(JIT)
21752178

21762179
void CodeBlock::countReoptimization()
21772180
{

‎Source/JavaScriptCore/bytecode/CodeBlock.h‎

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -645,11 +645,23 @@ class CodeBlock : public JSCell {
645645
// to avoid thrashing.
646646
JS_EXPORT_PRIVATE unsigned reoptimizationRetryCounter() const;
647647
void countReoptimization();
648-
#if ENABLE(JIT)
648+
649+
#if !ENABLE(C_LOOP)
650+
void setCalleeSaveRegisters(RegisterSet);
651+
void setCalleeSaveRegisters(std::unique_ptr<RegisterAtOffsetList>);
652+
653+
RegisterAtOffsetList* calleeSaveRegisters() const { return m_calleeSaveRegisters.get(); }
654+
649655
static unsigned numberOfLLIntBaselineCalleeSaveRegisters() { return RegisterSet::llintBaselineCalleeSaveRegisters().numberOfSetRegisters(); }
650656
static size_t llintBaselineCalleeSaveSpaceAsVirtualRegisters();
651657
size_t calleeSaveSpaceAsVirtualRegisters();
658+
#else
659+
static unsigned numberOfLLIntBaselineCalleeSaveRegisters() { return 0; }
660+
static size_t llintBaselineCalleeSaveSpaceAsVirtualRegisters() { return 0; };
661+
size_t calleeSaveSpaceAsVirtualRegisters() { return 0; }
662+
#endif
652663

664+
#if ENABLE(JIT)
653665
unsigned numberOfDFGCompiles();
654666

655667
int32_t codeTypeThresholdMultiplier() const;
@@ -739,14 +751,7 @@ class CodeBlock : public JSCell {
739751
bool shouldReoptimizeNow();
740752
bool shouldReoptimizeFromLoopNow();
741753

742-
void setCalleeSaveRegisters(RegisterSet);
743-
void setCalleeSaveRegisters(std::unique_ptr<RegisterAtOffsetList>);
744-
745-
RegisterAtOffsetList* calleeSaveRegisters() const { return m_calleeSaveRegisters.get(); }
746754
#else // No JIT
747-
static unsigned numberOfLLIntBaselineCalleeSaveRegisters() { return 0; }
748-
static size_t llintBaselineCalleeSaveSpaceAsVirtualRegisters() { return 0; };
749-
size_t calleeSaveSpaceAsVirtualRegisters() { return 0; }
750755
void optimizeAfterWarmUp() { }
751756
unsigned numberOfDFGCompiles() { return 0; }
752757
#endif
@@ -965,8 +970,10 @@ class CodeBlock : public JSCell {
965970
SentinelLinkedList<LLIntCallLinkInfo, BasicRawSentinelNode<LLIntCallLinkInfo>> m_incomingLLIntCalls;
966971
StructureWatchpointMap m_llintGetByIdWatchpointMap;
967972
PoisonedRefPtr<CodeBlockPoison, JITCode> m_jitCode;
968-
#if ENABLE(JIT)
973+
#if !ENABLE(C_LOOP)
969974
std::unique_ptr<RegisterAtOffsetList> m_calleeSaveRegisters;
975+
#endif
976+
#if ENABLE(JIT)
970977
PoisonedBag<CodeBlockPoison, StructureStubInfo> m_stubInfos;
971978
PoisonedBag<CodeBlockPoison, JITAddIC> m_addICs;
972979
PoisonedBag<CodeBlockPoison, JITMulIC> m_mulICs;

‎Source/JavaScriptCore/bytecode/Opcode.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ namespace JSC {
5858
#undef OPCODE_ID_ENUM
5959

6060
const int maxOpcodeLength = 9;
61-
#if !ENABLE(JIT)
61+
#if ENABLE(C_LOOP)
6262
const int numOpcodeIDs = NUMBER_OF_BYTECODE_IDS + NUMBER_OF_CLOOP_BYTECODE_HELPER_IDS + NUMBER_OF_BYTECODE_HELPER_IDS;
6363
#else
6464
const int numOpcodeIDs = NUMBER_OF_BYTECODE_IDS + NUMBER_OF_BYTECODE_HELPER_IDS;

0 commit comments

Comments
 (0)