Skip to content

Commit 957a838

Browse files
Unreviewed, reverting r283083 and r283088.
https://bugs.webkit.org/show_bug.cgi?id=230806 Windows pors are crashing Reverted changesets: "Build an unlinked baseline JIT" https://bugs.webkit.org/show_bug.cgi?id=229223 https://commits.webkit.org/r283083 "Make byte codes with arithmetic profiles switch to using an index instead of a pointer in metadata" https://bugs.webkit.org/show_bug.cgi?id=230798 https://commits.webkit.org/r283088 Canonical link: https://commits.webkit.org/242147@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@283089 268f45cc-cd09-0410-ab3c-d52691b4dbfc
1 parent d1cb45f commit 957a838

106 files changed

Lines changed: 2415 additions & 3663 deletions

File tree

Some content is hidden

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

‎Source/JavaScriptCore/CMakeLists.txt‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,6 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
611611
builtins/BuiltinNames.h
612612
builtins/BuiltinUtils.h
613613

614-
bytecode/ArithProfile.h
615614
bytecode/ArrayAllocationProfile.h
616615
bytecode/ArrayProfile.h
617616
bytecode/BytecodeConventions.h
@@ -838,7 +837,6 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
838837

839838
jit/AssemblyHelpers.h
840839
jit/AssemblyHelpersSpoolers.h
841-
jit/BaselineJITCode.h
842840
jit/CCallHelpers.h
843841
jit/ExecutableAllocator.h
844842
jit/ExecutableMemoryHandle.h
@@ -877,7 +875,6 @@ set(JavaScriptCore_PRIVATE_FRAMEWORK_HEADERS
877875
parser/ParserError.h
878876
parser/ParserModes.h
879877
parser/ParserTokens.h
880-
parser/ResultType.h
881878
parser/SourceCode.h
882879
parser/SourceProvider.h
883880
parser/SourceProviderCache.h

‎Source/JavaScriptCore/ChangeLog‎

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,21 @@
1+
2021-09-26 Commit Queue <commit-queue@webkit.org>
2+
3+
Unreviewed, reverting r283083 and r283088.
4+
https://bugs.webkit.org/show_bug.cgi?id=230806
5+
6+
Windows pors are crashing
7+
8+
Reverted changesets:
9+
10+
"Build an unlinked baseline JIT"
11+
https://bugs.webkit.org/show_bug.cgi?id=229223
12+
https://commits.webkit.org/r283083
13+
14+
"Make byte codes with arithmetic profiles switch to using an
15+
index instead of a pointer in metadata"
16+
https://bugs.webkit.org/show_bug.cgi?id=230798
17+
https://commits.webkit.org/r283088
18+
119
2021-09-26 Saam Barati <sbarati@apple.com>
220

321
Make byte codes with arithmetic profiles switch to using an index instead of a pointer in metadata

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

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,6 @@
900900
52CD0F5D2242F569004A18A5 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 51F0EB6105C86C6B00E6DF1B /* Foundation.framework */; };
901901
52CD0F5E2242F569004A18A5 /* JavaScriptCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 932F5BD90822A1C700736975 /* JavaScriptCore.framework */; };
902902
52CD0F682242F71C004A18A5 /* testdfg.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52CD0F672242F71C004A18A5 /* testdfg.cpp */; };
903-
52DD000826E039B90054E408 /* BaselineJITCode.h in Headers */ = {isa = PBXBuildFile; fileRef = 52DD000626E039B30054E408 /* BaselineJITCode.h */; settings = {ATTRIBUTES = (Private, ); }; };
904903
52EED7942492B870008F4C93 /* FunctionAllowlist.h in Headers */ = {isa = PBXBuildFile; fileRef = 52EED7932492B868008F4C93 /* FunctionAllowlist.h */; };
905904
52F6C35E1E71EB080081F4CC /* WebAssemblyWrapperFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = 52F6C35C1E71EB080081F4CC /* WebAssemblyWrapperFunction.h */; };
906905
530A66B91FA3E78B0026A545 /* UnifiedSource3-mm.mm in Sources */ = {isa = PBXBuildFile; fileRef = 530A66B11FA3E77A0026A545 /* UnifiedSource3-mm.mm */; };
@@ -1221,7 +1220,7 @@
12211220
79872C48221BBAF3008C6969 /* JSBaseInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 79872C47221BBAED008C6969 /* JSBaseInternal.h */; };
12221221
799EF7C41C56ED96002B0534 /* B3PCToOriginMap.h in Headers */ = {isa = PBXBuildFile; fileRef = 799EF7C31C56ED96002B0534 /* B3PCToOriginMap.h */; settings = {ATTRIBUTES = (Private, ); }; };
12231222
79A090801D768465008B889B /* HashMapImpl.h in Headers */ = {isa = PBXBuildFile; fileRef = 79A0907E1D768465008B889B /* HashMapImpl.h */; settings = {ATTRIBUTES = (Private, ); }; };
1224-
79A228361D35D71F00D8E067 /* ArithProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 79A228341D35D71E00D8E067 /* ArithProfile.h */; settings = {ATTRIBUTES = (Private, ); }; };
1223+
79A228361D35D71F00D8E067 /* ArithProfile.h in Headers */ = {isa = PBXBuildFile; fileRef = 79A228341D35D71E00D8E067 /* ArithProfile.h */; };
12251224
79ABB17E1E5CCB570045B9A6 /* AirDisassembler.h in Headers */ = {isa = PBXBuildFile; fileRef = 79ABB17C1E5CCB570045B9A6 /* AirDisassembler.h */; settings = {ATTRIBUTES = (Private, ); }; };
12261225
79AC30FF1F99536400484FD7 /* ObjectAllocationProfileInlines.h in Headers */ = {isa = PBXBuildFile; fileRef = 79AC30FE1F99536300484FD7 /* ObjectAllocationProfileInlines.h */; };
12271226
79AF0BE41D3EFD4C00E95FA5 /* JITMathICInlineResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 79AF0BE31D3EFD4C00E95FA5 /* JITMathICInlineResult.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -3675,8 +3674,6 @@
36753674
52CD0F642242F569004A18A5 /* testdfg */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = testdfg; sourceTree = BUILT_PRODUCTS_DIR; };
36763675
52CD0F672242F71C004A18A5 /* testdfg.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = testdfg.cpp; path = dfg/testdfg.cpp; sourceTree = "<group>"; };
36773676
52D1308F221CE03A009C836C /* foo.js */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.javascript; path = foo.js; sourceTree = "<group>"; };
3678-
52DD000626E039B30054E408 /* BaselineJITCode.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = BaselineJITCode.h; sourceTree = "<group>"; };
3679-
52DD000726E039B40054E408 /* BaselineJITCode.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = BaselineJITCode.cpp; sourceTree = "<group>"; };
36803677
52EED7922492B868008F4C93 /* FunctionAllowlist.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = FunctionAllowlist.cpp; sourceTree = "<group>"; };
36813678
52EED7932492B868008F4C93 /* FunctionAllowlist.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FunctionAllowlist.h; sourceTree = "<group>"; };
36823679
52F6C35B1E71EB080081F4CC /* WebAssemblyWrapperFunction.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebAssemblyWrapperFunction.cpp; path = js/WebAssemblyWrapperFunction.cpp; sourceTree = "<group>"; };
@@ -6279,8 +6276,6 @@
62796276
6B767E7A26791F270017F8D1 /* AssemblyHelpersSpoolers.h */,
62806277
723998F6265DBCDB0057867F /* BaselineJITPlan.cpp */,
62816278
723998F5265DBCDB0057867F /* BaselineJITPlan.h */,
6282-
52DD000726E039B40054E408 /* BaselineJITCode.cpp */,
6283-
52DD000626E039B30054E408 /* BaselineJITCode.h */,
62846279
0F64B26F1A784BAF006E4E66 /* BinarySwitch.cpp */,
62856280
0F64B2701A784BAF006E4E66 /* BinarySwitch.h */,
62866281
65B8392D1BACA9D30044E824 /* CachedRecovery.cpp */,
@@ -9735,7 +9730,6 @@
97359730
0F2017821DCADD4200EA5950 /* DFGFlowMap.h in Headers */,
97369731
0F9D339717FFC4E60073C2BC /* DFGFlushedAt.h in Headers */,
97379732
A7D89CF817A0B8CC00773AD8 /* DFGFlushFormat.h in Headers */,
9738-
52DD000826E039B90054E408 /* BaselineJITCode.h in Headers */,
97399733
0F2DD8151AB3D8BE00BBB8E8 /* DFGForAllKills.h in Headers */,
97409734
0F69CC89193AC60A0045759E /* DFGFrozenValue.h in Headers */,
97419735
E386FD7E26E867B800E4C28B /* TemporalPlainTime.h in Headers */,

‎Source/JavaScriptCore/Sources.txt‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,6 @@ interpreter/ShadowChicken.cpp
619619
interpreter/StackVisitor.cpp
620620

621621
jit/AssemblyHelpers.cpp
622-
jit/BaselineJITCode.cpp
623622
jit/BaselineJITPlan.cpp
624623
jit/BinarySwitch.cpp
625624
jit/CCallHelpers.cpp

‎Source/JavaScriptCore/bytecode/AccessCase.cpp‎

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -202,15 +202,15 @@ RefPtr<AccessCase> AccessCase::fromStructureStubInfo(
202202
switch (stubInfo.cacheType()) {
203203
case CacheType::GetByIdSelf:
204204
RELEASE_ASSERT(stubInfo.hasConstantIdentifier);
205-
return ProxyableAccessCase::create(vm, owner, Load, identifier, stubInfo.byIdSelfOffset, stubInfo.inlineAccessBaseStructure(vm));
205+
return ProxyableAccessCase::create(vm, owner, Load, identifier, stubInfo.u.byIdSelf.offset, stubInfo.m_inlineAccessBaseStructure.get());
206206

207207
case CacheType::PutByIdReplace:
208208
RELEASE_ASSERT(stubInfo.hasConstantIdentifier);
209-
return AccessCase::create(vm, owner, Replace, identifier, stubInfo.byIdSelfOffset, stubInfo.inlineAccessBaseStructure(vm));
209+
return AccessCase::create(vm, owner, Replace, identifier, stubInfo.u.byIdSelf.offset, stubInfo.m_inlineAccessBaseStructure.get());
210210

211211
case CacheType::InByIdSelf:
212212
RELEASE_ASSERT(stubInfo.hasConstantIdentifier);
213-
return AccessCase::create(vm, owner, InHit, identifier, stubInfo.byIdSelfOffset, stubInfo.inlineAccessBaseStructure(vm));
213+
return AccessCase::create(vm, owner, InHit, identifier, stubInfo.u.byIdSelf.offset, stubInfo.m_inlineAccessBaseStructure.get());
214214

215215
case CacheType::ArrayLength:
216216
RELEASE_ASSERT(stubInfo.hasConstantIdentifier);
@@ -1985,10 +1985,14 @@ void AccessCase::generateImpl(AccessGenerationState& state)
19851985
// Stuff for custom getters/setters.
19861986
CCallHelpers::Call operationCall;
19871987

1988-
19891988
// This also does the necessary calculations of whether or not we're an
19901989
// exception handling call site.
1991-
AccessGenerationState::SpillState spillState = state.preserveLiveRegistersToStackForCall();
1990+
RegisterSet extraRegistersToPreserve;
1991+
#if CPU(ARM64)
1992+
if (codeBlock->useDataIC())
1993+
extraRegistersToPreserve.set(ARM64Registers::lr);
1994+
#endif
1995+
AccessGenerationState::SpillState spillState = state.preserveLiveRegistersToStackForCall(extraRegistersToPreserve);
19921996

19931997
auto restoreLiveRegistersFromStackForCall = [&](AccessGenerationState::SpillState& spillState, bool callHasReturnValue) {
19941998
RegisterSet dontRestore;
@@ -2075,7 +2079,8 @@ void AccessCase::generateImpl(AccessGenerationState& state)
20752079
ASSERT(!(numberOfRegsForCall % stackAlignmentRegisters()));
20762080
unsigned numberOfBytesForCall = numberOfRegsForCall * sizeof(Register) - sizeof(CallerFrameAndPC);
20772081

2078-
unsigned alignedNumberOfBytesForCall = WTF::roundUpToMultipleOf(stackAlignmentBytes(), numberOfBytesForCall);
2082+
unsigned alignedNumberOfBytesForCall =
2083+
WTF::roundUpToMultipleOf(stackAlignmentBytes(), numberOfBytesForCall);
20792084

20802085
jit.subPtr(
20812086
CCallHelpers::TrustedImm32(alignedNumberOfBytesForCall),
@@ -2133,7 +2138,6 @@ void AccessCase::generateImpl(AccessGenerationState& state)
21332138

21342139
int stackPointerOffset = (codeBlock->stackPointerOffset() * sizeof(Register)) - state.preservedReusedRegisterState.numberOfBytesPreserved - spillState.numberOfStackBytesUsedForRegisterPreservation;
21352140
jit.addPtr(CCallHelpers::TrustedImm32(stackPointerOffset), GPRInfo::callFrameRegister, CCallHelpers::stackPointerRegister);
2136-
21372141
bool callHasReturnValue = isGetter();
21382142
restoreLiveRegistersFromStackForCall(spillState, callHasReturnValue);
21392143

@@ -2260,7 +2264,12 @@ void AccessCase::generateImpl(AccessGenerationState& state)
22602264

22612265
jit.loadPtr(CCallHelpers::Address(baseGPR, JSProxy::targetOffset()), scratchGPR);
22622266

2263-
auto spillState = state.preserveLiveRegistersToStackForCallWithoutExceptions();
2267+
RegisterSet extraRegistersToPreserve;
2268+
#if CPU(ARM64)
2269+
if (codeBlock->useDataIC())
2270+
extraRegistersToPreserve.set(ARM64Registers::lr);
2271+
#endif
2272+
auto spillState = state.preserveLiveRegistersToStackForCallWithoutExceptions(extraRegistersToPreserve);
22642273

22652274
jit.setupArguments<decltype(operationWriteBarrierSlowPath)>(CCallHelpers::TrustedImmPtr(&vm), scratchGPR);
22662275
jit.prepareCallOperation(vm);
@@ -2355,6 +2364,10 @@ void AccessCase::generateImpl(AccessGenerationState& state)
23552364
RegisterSet extraRegistersToPreserve;
23562365
extraRegistersToPreserve.set(baseGPR);
23572366
extraRegistersToPreserve.set(valueRegs);
2367+
#if CPU(ARM64)
2368+
if (codeBlock->useDataIC())
2369+
extraRegistersToPreserve.set(ARM64Registers::lr);
2370+
#endif
23582371
AccessGenerationState::SpillState spillState = state.preserveLiveRegistersToStackForCall(extraRegistersToPreserve);
23592372

23602373
jit.store32(

‎Source/JavaScriptCore/bytecode/BytecodeList.rb‎

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@
6464

6565
:ValueProfile,
6666
:ValueProfileAndVirtualRegisterBuffer,
67+
:UnaryArithProfile,
68+
:BinaryArithProfile,
6769
:ArrayProfile,
6870
:ArrayAllocationProfile,
6971
:ObjectAllocationProfile,
@@ -287,8 +289,10 @@
287289
dst: VirtualRegister,
288290
lhs: VirtualRegister,
289291
rhs: VirtualRegister,
290-
profileIndex: unsigned,
291292
operandTypes: OperandTypes,
293+
},
294+
metadata: {
295+
arithProfile: BinaryArithProfile
292296
}
293297

294298
op_group :ValueProfiledBinaryOp,
@@ -347,7 +351,9 @@
347351
],
348352
args: {
349353
srcDst: VirtualRegister,
350-
profileIndex: unsigned,
354+
},
355+
metadata: {
356+
arithProfile: UnaryArithProfile
351357
}
352358

353359
op :to_object,
@@ -377,8 +383,10 @@
377383
args: {
378384
dst: VirtualRegister,
379385
operand: VirtualRegister,
380-
profileIndex: unsigned,
381386
resultType: ResultType,
387+
},
388+
metadata: {
389+
arithProfile: UnaryArithProfile,
382390
}
383391

384392
op :not,

‎Source/JavaScriptCore/bytecode/BytecodeOperandsForCheckpoint.h‎

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -73,28 +73,6 @@ ValueProfile* valueProfileForImpl(BytecodeMetadata& metadata, unsigned checkpoin
7373
return &metadata.m_profile;
7474
}
7575

76-
template <typename Bytecode>
77-
uintptr_t valueProfileOffsetFor(unsigned checkpointIndex)
78-
{
79-
UNUSED_PARAM(checkpointIndex);
80-
if constexpr (Bytecode::opcodeID == op_iterator_open) {
81-
switch (checkpointIndex) {
82-
case OpIteratorOpen::symbolCall: return Bytecode::Metadata::offsetOfIteratorProfile();
83-
case OpIteratorOpen::getNext: return Bytecode::Metadata::offsetOfNextProfile();
84-
default: RELEASE_ASSERT_NOT_REACHED();
85-
}
86-
87-
} else if constexpr (Bytecode::opcodeID == op_iterator_next) {
88-
switch (checkpointIndex) {
89-
case OpIteratorNext::computeNext: return Bytecode::Metadata::offsetOfNextResultProfile();
90-
case OpIteratorNext::getDone: return Bytecode::Metadata::offsetOfDoneProfile();
91-
case OpIteratorNext::getValue: return Bytecode::Metadata::offsetOfValueProfile();
92-
default: RELEASE_ASSERT_NOT_REACHED();
93-
}
94-
} else
95-
return Bytecode::Metadata::offsetOfProfile();
96-
}
97-
9876
template<typename BytecodeMetadata>
9977
bool hasValueProfileFor(BytecodeMetadata& metadata, unsigned checkpointIndex)
10078
{

0 commit comments

Comments
 (0)