Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit fe09c30

Browse filesBrowse files
committed
Remove register preservation and restoration stub code
https://bugs.webkit.org/show_bug.cgi?id=149335 Reviewed by Mark Lam. Delete the register preservation and restoration thunks and related plumbing. Much of this change is removing the unneeded RegisterPreservationMode parameter from various functions. * CMakeLists.txt: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj: * JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters: * JavaScriptCore.xcodeproj/project.pbxproj: * bytecode/CallLinkInfo.h: (JSC::CallLinkInfo::isVarargsCallType): (JSC::CallLinkInfo::CallLinkInfo): (JSC::CallLinkInfo::isVarargs): (JSC::CallLinkInfo::isLinked): (JSC::CallLinkInfo::setUpCallFromFTL): (JSC::CallLinkInfo::registerPreservationMode): Deleted. * ftl/FTLJITCode.cpp: (JSC::FTL::JITCode::initializeAddressForCall): (JSC::FTL::JITCode::addressForCall): * ftl/FTLJITCode.h: * ftl/FTLOSREntry.cpp: (JSC::FTL::prepareOSREntry): * ftl/FTLOSRExitCompiler.cpp: (JSC::FTL::compileStub): * jit/JITCode.cpp: (JSC::JITCode::execute): (JSC::DirectJITCode::initializeCodeRef): (JSC::DirectJITCode::addressForCall): (JSC::NativeJITCode::initializeCodeRef): (JSC::NativeJITCode::addressForCall): (JSC::DirectJITCode::ensureWrappers): Deleted. * jit/JITCode.h: (JSC::JITCode::jitTypeFor): (JSC::JITCode::executableAddress): * jit/JITOperations.cpp: * jit/RegisterPreservationWrapperGenerator.cpp: Removed. * jit/RegisterPreservationWrapperGenerator.h: Removed. * jit/Repatch.cpp: (JSC::linkPolymorphicCall): * jit/ThunkGenerators.cpp: (JSC::virtualThunkFor): * jit/ThunkGenerators.h: * llint/LLIntSlowPaths.cpp: (JSC::LLInt::entryOSR): (JSC::LLInt::setUpCall): * runtime/Executable.cpp: (JSC::ExecutableBase::clearCode): (JSC::ScriptExecutable::installCode): (JSC::WebAssemblyExecutable::prepareForExecution): * runtime/Executable.h: (JSC::ExecutableBase::generatedJITCodeFor): (JSC::ExecutableBase::entrypointFor): (JSC::ExecutableBase::offsetOfJITCodeWithArityCheckFor): * runtime/RegisterPreservationMode.h: Removed. Canonical link: https://commits.webkit.org/167411@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@189967 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent 7a547e1 commit fe09c30
Copy full SHA for fe09c30

22 files changed

+103-531Lines changed: 103 additions & 531 deletions
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎Source/JavaScriptCore/CMakeLists.txt‎

Copy file name to clipboardExpand all lines: Source/JavaScriptCore/CMakeLists.txt
-1Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,6 @@ set(JavaScriptCore_SOURCES
387387
jit/Reg.cpp
388388
jit/RegisterAtOffset.cpp
389389
jit/RegisterAtOffsetList.cpp
390-
jit/RegisterPreservationWrapperGenerator.cpp
391390
jit/RegisterSet.cpp
392391
jit/Repatch.cpp
393392
jit/ScratchRegisterAllocator.cpp
Collapse file

‎Source/JavaScriptCore/ChangeLog‎

Copy file name to clipboardExpand all lines: Source/JavaScriptCore/ChangeLog
+62Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,65 @@
1+
2015-09-18 Michael Saboff <msaboff@apple.com>
2+
3+
Remove register preservation and restoration stub code
4+
https://bugs.webkit.org/show_bug.cgi?id=149335
5+
6+
Reviewed by Mark Lam.
7+
8+
Delete the register preservation and restoration thunks and related plumbing.
9+
10+
Much of this change is removing the unneeded RegisterPreservationMode parameter
11+
from various functions.
12+
13+
* CMakeLists.txt:
14+
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj:
15+
* JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters:
16+
* JavaScriptCore.xcodeproj/project.pbxproj:
17+
* bytecode/CallLinkInfo.h:
18+
(JSC::CallLinkInfo::isVarargsCallType):
19+
(JSC::CallLinkInfo::CallLinkInfo):
20+
(JSC::CallLinkInfo::isVarargs):
21+
(JSC::CallLinkInfo::isLinked):
22+
(JSC::CallLinkInfo::setUpCallFromFTL):
23+
(JSC::CallLinkInfo::registerPreservationMode): Deleted.
24+
* ftl/FTLJITCode.cpp:
25+
(JSC::FTL::JITCode::initializeAddressForCall):
26+
(JSC::FTL::JITCode::addressForCall):
27+
* ftl/FTLJITCode.h:
28+
* ftl/FTLOSREntry.cpp:
29+
(JSC::FTL::prepareOSREntry):
30+
* ftl/FTLOSRExitCompiler.cpp:
31+
(JSC::FTL::compileStub):
32+
* jit/JITCode.cpp:
33+
(JSC::JITCode::execute):
34+
(JSC::DirectJITCode::initializeCodeRef):
35+
(JSC::DirectJITCode::addressForCall):
36+
(JSC::NativeJITCode::initializeCodeRef):
37+
(JSC::NativeJITCode::addressForCall):
38+
(JSC::DirectJITCode::ensureWrappers): Deleted.
39+
* jit/JITCode.h:
40+
(JSC::JITCode::jitTypeFor):
41+
(JSC::JITCode::executableAddress):
42+
* jit/JITOperations.cpp:
43+
* jit/RegisterPreservationWrapperGenerator.cpp: Removed.
44+
* jit/RegisterPreservationWrapperGenerator.h: Removed.
45+
* jit/Repatch.cpp:
46+
(JSC::linkPolymorphicCall):
47+
* jit/ThunkGenerators.cpp:
48+
(JSC::virtualThunkFor):
49+
* jit/ThunkGenerators.h:
50+
* llint/LLIntSlowPaths.cpp:
51+
(JSC::LLInt::entryOSR):
52+
(JSC::LLInt::setUpCall):
53+
* runtime/Executable.cpp:
54+
(JSC::ExecutableBase::clearCode):
55+
(JSC::ScriptExecutable::installCode):
56+
(JSC::WebAssemblyExecutable::prepareForExecution):
57+
* runtime/Executable.h:
58+
(JSC::ExecutableBase::generatedJITCodeFor):
59+
(JSC::ExecutableBase::entrypointFor):
60+
(JSC::ExecutableBase::offsetOfJITCodeWithArityCheckFor):
61+
* runtime/RegisterPreservationMode.h: Removed.
62+
163
2015-09-17 Joseph Pecoraro <pecoraro@apple.com>
264

365
Web Inspector: Remove unused canClearBrowserCookies / canClearBrowserCache protocol methods
Collapse file

‎Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj‎

Copy file name to clipboardExpand all lines: Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj
-2Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,6 @@
649649
<ClCompile Include="..\jit\Reg.cpp" />
650650
<ClCompile Include="..\jit\RegisterAtOffset.cpp" />
651651
<ClCompile Include="..\jit\RegisterAtOffsetList.cpp" />
652-
<ClCompile Include="..\jit\RegisterPreservationWrapperGenerator.cpp" />
653652
<ClCompile Include="..\jit\RegisterSet.cpp" />
654653
<ClCompile Include="..\jit\Repatch.cpp" />
655654
<ClCompile Include="..\jit\ScratchRegisterAllocator.cpp" />
@@ -1451,7 +1450,6 @@
14511450
<ClInclude Include="..\jit\RegisterAtOffset.h" />
14521451
<ClInclude Include="..\jit\RegisterAtOffsetList.h" />
14531452
<ClInclude Include="..\jit\RegisterMap.h" />
1454-
<ClInclude Include="..\jit\RegisterPreservationWrapperGenerator.h" />
14551453
<ClInclude Include="..\jit\RegisterSet.h" />
14561454
<ClInclude Include="..\jit\Repatch.h" />
14571455
<ClInclude Include="..\jit\ScratchRegisterAllocator.h" />
Collapse file

‎Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters‎

Copy file name to clipboardExpand all lines: Source/JavaScriptCore/JavaScriptCore.vcxproj/JavaScriptCore.vcxproj.filters
-6Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,9 +1497,6 @@
14971497
<ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\InspectorProtocolObjects.cpp">
14981498
<Filter>Derived Sources</Filter>
14991499
</ClCompile>
1500-
<ClCompile Include="..\jit\RegisterPreservationWrapperGenerator.cpp">
1501-
<Filter>jit</Filter>
1502-
</ClCompile>
15031500
<ClCompile Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSCBuiltins.cpp">
15041501
<Filter>Derived Sources</Filter>
15051502
</ClCompile>
@@ -4040,9 +4037,6 @@
40404037
<Filter>runtime</Filter>
40414038
</ClInclude>
40424039
<ClInclude Include="$(ConfigurationBuildDir)\obj$(PlatformArchitecture)\$(ProjectName)\DerivedSources\JSDataViewPrototype.lut.h" />
4043-
<ClInclude Include="..\jit\RegisterPreservationWrapperGenerator.h">
4044-
<Filter>jit</Filter>
4045-
</ClInclude>
40464040
<ClInclude Include="..\ftl\FTLAbbreviatedTypes.h">
40474041
<Filter>ftl</Filter>
40484042
</ClInclude>
Collapse file

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

Copy file name to clipboardExpand all lines: Source/JavaScriptCore/JavaScriptCore.xcodeproj/project.pbxproj
-12Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -378,9 +378,6 @@
378378
0F6B1CB5185FC9E900845D97 /* FTLJSCall.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F6B1CB3185FC9E900845D97 /* FTLJSCall.cpp */; };
379379
0F6B1CB6185FC9E900845D97 /* FTLJSCall.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6B1CB4185FC9E900845D97 /* FTLJSCall.h */; settings = {ATTRIBUTES = (Private, ); }; };
380380
0F6B1CB91861244C00845D97 /* ArityCheckMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6B1CB71861244C00845D97 /* ArityCheckMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
381-
0F6B1CBA1861244C00845D97 /* RegisterPreservationMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6B1CB81861244C00845D97 /* RegisterPreservationMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
382-
0F6B1CBD1861246A00845D97 /* RegisterPreservationWrapperGenerator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F6B1CBB1861246A00845D97 /* RegisterPreservationWrapperGenerator.cpp */; };
383-
0F6B1CBE1861246A00845D97 /* RegisterPreservationWrapperGenerator.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6B1CBC1861246A00845D97 /* RegisterPreservationWrapperGenerator.h */; settings = {ATTRIBUTES = (Private, ); }; };
384381
0F6B1CC51862C47800845D97 /* FTLUnwindInfo.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F6B1CC11862C47800845D97 /* FTLUnwindInfo.cpp */; };
385382
0F6B1CC61862C47800845D97 /* FTLUnwindInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F6B1CC21862C47800845D97 /* FTLUnwindInfo.h */; settings = {ATTRIBUTES = (Private, ); }; };
386383
0F6C73501AC9F99F00BE1682 /* VariableWriteFireDetail.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 0F6C734E1AC9F99F00BE1682 /* VariableWriteFireDetail.cpp */; };
@@ -2209,9 +2206,6 @@
22092206
0F6B1CB3185FC9E900845D97 /* FTLJSCall.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FTLJSCall.cpp; path = ftl/FTLJSCall.cpp; sourceTree = "<group>"; };
22102207
0F6B1CB4185FC9E900845D97 /* FTLJSCall.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLJSCall.h; path = ftl/FTLJSCall.h; sourceTree = "<group>"; };
22112208
0F6B1CB71861244C00845D97 /* ArityCheckMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ArityCheckMode.h; sourceTree = "<group>"; };
2212-
0F6B1CB81861244C00845D97 /* RegisterPreservationMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterPreservationMode.h; sourceTree = "<group>"; };
2213-
0F6B1CBB1861246A00845D97 /* RegisterPreservationWrapperGenerator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RegisterPreservationWrapperGenerator.cpp; sourceTree = "<group>"; };
2214-
0F6B1CBC1861246A00845D97 /* RegisterPreservationWrapperGenerator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RegisterPreservationWrapperGenerator.h; sourceTree = "<group>"; };
22152209
0F6B1CC11862C47800845D97 /* FTLUnwindInfo.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FTLUnwindInfo.cpp; path = ftl/FTLUnwindInfo.cpp; sourceTree = "<group>"; };
22162210
0F6B1CC21862C47800845D97 /* FTLUnwindInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FTLUnwindInfo.h; path = ftl/FTLUnwindInfo.h; sourceTree = "<group>"; };
22172211
0F6C734E1AC9F99F00BE1682 /* VariableWriteFireDetail.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = VariableWriteFireDetail.cpp; sourceTree = "<group>"; };
@@ -4157,8 +4151,6 @@
41574151
6540C79C1B82D99D000F6B79 /* RegisterAtOffsetList.cpp */,
41584152
6540C79D1B82D99D000F6B79 /* RegisterAtOffsetList.h */,
41594153
623A37EB1B87A7BD00754209 /* RegisterMap.h */,
4160-
0F6B1CBB1861246A00845D97 /* RegisterPreservationWrapperGenerator.cpp */,
4161-
0F6B1CBC1861246A00845D97 /* RegisterPreservationWrapperGenerator.h */,
41624154
0FC3141418146D7000033232 /* RegisterSet.cpp */,
41634155
0FC314101814559100033232 /* RegisterSet.h */,
41644156
0F24E54917EE274900ABB217 /* Repatch.cpp */,
@@ -4949,7 +4941,6 @@
49494941
F692A87C0255597D01FF60F7 /* RegExpObject.h */,
49504942
BCD202BF0E1706A7002C7E82 /* RegExpPrototype.cpp */,
49514943
BCD202C00E1706A7002C7E82 /* RegExpPrototype.h */,
4952-
0F6B1CB81861244C00845D97 /* RegisterPreservationMode.h */,
49534944
0FB7F39115ED8E3800F167B2 /* Reject.h */,
49544945
70B0A9D01A9B66200001306A /* RuntimeFlags.h */,
49554946
527773DD1AAF83AC00BDE7E8 /* RuntimeType.cpp */,
@@ -6745,8 +6736,6 @@
67456736
BCD202C40E1706A7002C7E82 /* RegExpPrototype.h in Headers */,
67466737
BC18C45D0E16F5CD00B34460 /* Register.h in Headers */,
67476738
969A072B0ED1CE6900F1F681 /* RegisterID.h in Headers */,
6748-
0F6B1CBA1861244C00845D97 /* RegisterPreservationMode.h in Headers */,
6749-
0F6B1CBE1861246A00845D97 /* RegisterPreservationWrapperGenerator.h in Headers */,
67506739
0FC314121814559100033232 /* RegisterSet.h in Headers */,
67516740
0F50AF3C193E8B3900674EE8 /* DFGStructureClobberState.h in Headers */,
67526741
A57D23EE1891B5540031C7FA /* RegularExpression.h in Headers */,
@@ -7926,7 +7915,6 @@
79267915
8642C512151C083D0046D4EF /* RegExpMatchesArray.cpp in Sources */,
79277916
14280843107EC0930013E7B2 /* RegExpObject.cpp in Sources */,
79287917
14280844107EC0930013E7B2 /* RegExpPrototype.cpp in Sources */,
7929-
0F6B1CBD1861246A00845D97 /* RegisterPreservationWrapperGenerator.cpp in Sources */,
79307918
0FC3141518146D7000033232 /* RegisterSet.cpp in Sources */,
79317919
A57D23ED1891B5540031C7FA /* RegularExpression.cpp in Sources */,
79327920
E33F50781B84225700413856 /* JSInternalPromiseConstructor.cpp in Sources */,
Collapse file

‎Source/JavaScriptCore/bytecode/CallLinkInfo.h‎

Copy file name to clipboardExpand all lines: Source/JavaScriptCore/bytecode/CallLinkInfo.h
+1-9Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,7 @@ class CallLinkInfo : public BasicRawSentinelNode<CallLinkInfo> {
7373
}
7474

7575
CallLinkInfo()
76-
: m_registerPreservationMode(static_cast<unsigned>(RegisterPreservationNotRequired))
77-
, m_hasSeenShouldRepatch(false)
76+
: m_hasSeenShouldRepatch(false)
7877
, m_hasSeenClosure(false)
7978
, m_clearedByGC(false)
8079
, m_allowStubs(true)
@@ -135,11 +134,6 @@ class CallLinkInfo : public BasicRawSentinelNode<CallLinkInfo> {
135134
return isVarargsCallType(static_cast<CallType>(m_callType));
136135
}
137136

138-
RegisterPreservationMode registerPreservationMode() const
139-
{
140-
return static_cast<RegisterPreservationMode>(m_registerPreservationMode);
141-
}
142-
143137
bool isLinked() { return m_stub || m_callee; }
144138
void unlink(VM&);
145139

@@ -169,7 +163,6 @@ class CallLinkInfo : public BasicRawSentinelNode<CallLinkInfo> {
169163
CodeLocationNearCall callReturnLocation, CodeLocationDataLabelPtr hotPathBegin,
170164
CodeLocationNearCall hotPathOther, unsigned calleeGPR)
171165
{
172-
m_registerPreservationMode = static_cast<unsigned>(RegisterPreservationNotRequired);
173166
m_callType = callType;
174167
m_codeOrigin = codeOrigin;
175168
m_callReturnLocation = callReturnLocation;
@@ -346,7 +339,6 @@ class CallLinkInfo : public BasicRawSentinelNode<CallLinkInfo> {
346339
WriteBarrier<JSFunction> m_lastSeenCallee;
347340
RefPtr<PolymorphicCallStubRoutine> m_stub;
348341
RefPtr<JITStubRoutine> m_slowStub;
349-
unsigned m_registerPreservationMode : 1; // Real type is RegisterPreservationMode
350342
bool m_hasSeenShouldRepatch : 1;
351343
bool m_hasSeenClosure : 1;
352344
bool m_clearedByGC : 1;
Collapse file

‎Source/JavaScriptCore/ftl/FTLJITCode.cpp‎

Copy file name to clipboardExpand all lines: Source/JavaScriptCore/ftl/FTLJITCode.cpp
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ void JITCode::initializeAddressForCall(CodePtr address)
7575
m_addressForCall = address;
7676
}
7777

78-
JITCode::CodePtr JITCode::addressForCall(VM&, ExecutableBase*, ArityCheckMode arityCheck, RegisterPreservationMode)
78+
JITCode::CodePtr JITCode::addressForCall(ArityCheckMode arityCheck)
7979
{
8080
switch (arityCheck) {
8181
case ArityCheckNotRequired:
Collapse file

‎Source/JavaScriptCore/ftl/FTLJITCode.h‎

Copy file name to clipboardExpand all lines: Source/JavaScriptCore/ftl/FTLJITCode.h
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ class JITCode : public JSC::JITCode {
5858
JITCode();
5959
~JITCode();
6060

61-
CodePtr addressForCall(VM&, ExecutableBase*, ArityCheckMode, RegisterPreservationMode) override;
61+
CodePtr addressForCall(ArityCheckMode) override;
6262
void* executableAddressAtOffset(size_t offset) override;
6363
void* dataAddressAtOffset(size_t offset) override;
6464
unsigned offsetOf(void* pointerIntoCode) override;
Collapse file

‎Source/JavaScriptCore/ftl/FTLOSREntry.cpp‎

Copy file name to clipboardExpand all lines: Source/JavaScriptCore/ftl/FTLOSREntry.cpp
+1-3Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,7 @@ void* prepareOSREntry(
100100

101101
exec->setCodeBlock(entryCodeBlock);
102102

103-
void* result = entryCode->addressForCall(
104-
vm, executable, ArityCheckNotRequired,
105-
RegisterPreservationNotRequired).executableAddress();
103+
void* result = entryCode->addressForCall(ArityCheckNotRequired).executableAddress();
106104
if (Options::verboseOSR())
107105
dataLog(" Entry will succeed, going to address", RawPointer(result), "\n");
108106

Collapse file

‎Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp‎

Copy file name to clipboardExpand all lines: Source/JavaScriptCore/ftl/FTLOSRExitCompiler.cpp
+5-33Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
#include "MaxFrameExtentForSlowPathCall.h"
4141
#include "OperandsInlines.h"
4242
#include "JSCInlines.h"
43-
#include "RegisterPreservationWrapperGenerator.h"
4443

4544
namespace JSC { namespace FTL {
4645

@@ -379,9 +378,6 @@ static void compileStub(
379378
// old frame, and finally we save the various callee-save registers into where the
380379
// restoration thunk would restore them from.
381380

382-
ptrdiff_t offset = registerPreservationOffset();
383-
RegisterSet toSave = registersToPreserve();
384-
385381
// Before we start messing with the frame, we need to set aside any registers that the
386382
// FTL code was preserving.
387383
for (unsigned i = codeBlock->calleeSaveRegisters()->size(); i--;) {
@@ -397,26 +393,16 @@ static void compileStub(
397393
// Let's say that the FTL function had failed its arity check. In that case, the stack will
398394
// contain some extra stuff.
399395
//
400-
// First we compute the padded stack space:
396+
// We compute the padded stack space:
401397
//
402398
// paddedStackSpace = roundUp(codeBlock->numParameters - regT2 + 1)
403399
//
404-
// The stack will have regT2 + CallFrameHeaderSize stuff, but above it there will be
405-
// paddedStackSpace gunk used by the arity check fail restoration thunk. When that happens
406-
// we want to make the stack look like this, from higher addresses down:
400+
// The stack will have regT2 + CallFrameHeaderSize stuff.
401+
// We want to make the stack look like this, from higher addresses down:
407402
//
408-
// - register preservation return PC
409-
// - preserved registers
410-
// - arity check fail return PC
411403
// - argument padding
412404
// - actual arguments
413405
// - call frame header
414-
//
415-
// So that the actual call frame header appears to return to the arity check fail return
416-
// PC, and that then returns to the register preservation thunk. The arity check thunk that
417-
// we return to will have the padding size encoded into it. It will then know to return
418-
// into the register preservation thunk, which uses the argument count to figure out where
419-
// registers are preserved.
420406

421407
// This code assumes that we're dealing with FunctionCode.
422408
RELEASE_ASSERT(codeBlock->codeType() == FunctionCode);
@@ -436,7 +422,6 @@ static void compileStub(
436422

437423
// First set up SP so that our data doesn't get clobbered by signals.
438424
unsigned conservativeStackDelta =
439-
registerPreservationOffset() +
440425
(exit.m_values.numberOfLocals() + baselineCodeBlock->calleeSaveSpaceAsVirtualRegisters()) * sizeof(Register) +
441426
maxFrameExtentForSlowPathCall;
442427
conservativeStackDelta = WTF::roundUpToMultipleOf(
@@ -445,25 +430,12 @@ static void compileStub(
445430
MacroAssembler::TrustedImm32(-conservativeStackDelta),
446431
MacroAssembler::framePointerRegister, MacroAssembler::stackPointerRegister);
447432
jit.checkStackPointerAlignment();
448-
449-
jit.subPtr(
450-
MacroAssembler::TrustedImm32(registerPreservationOffset()),
451-
MacroAssembler::framePointerRegister);
452-
453-
// Copy the old frame data into its new location.
454-
jit.add32(MacroAssembler::TrustedImm32(JSStack::CallFrameHeaderSize), GPRInfo::regT2);
455-
jit.move(MacroAssembler::framePointerRegister, GPRInfo::regT1);
456-
MacroAssembler::Label loop = jit.label();
457-
jit.sub32(MacroAssembler::TrustedImm32(1), GPRInfo::regT2);
458-
jit.load64(MacroAssembler::Address(GPRInfo::regT1, offset), GPRInfo::regT0);
459-
jit.store64(GPRInfo::regT0, GPRInfo::regT1);
460-
jit.addPtr(MacroAssembler::TrustedImm32(sizeof(Register)), GPRInfo::regT1);
461-
jit.branchTest32(MacroAssembler::NonZero, GPRInfo::regT2).linkTo(loop, &jit);
462433

434+
RegisterSet allFTLCalleeSaves = RegisterSet::ftlCalleeSaveRegisters();
463435
RegisterAtOffsetList* baselineCalleeSaves = baselineCodeBlock->calleeSaveRegisters();
464436

465437
for (Reg reg = Reg::first(); reg <= Reg::last(); reg = reg.next()) {
466-
if (!toSave.get(reg) || !reg.isGPR())
438+
if (!allFTLCalleeSaves.get(reg) || !reg.isGPR())
467439
continue;
468440
unsigned unwindIndex = codeBlock->calleeSaveRegisters()->indexOf(reg);
469441
RegisterAtOffset* baselineRegisterOffset = baselineCalleeSaves->find(reg);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.