Skip to content

Commit 9a61a79

Browse files
StefanStojanovictargos
authored andcommitted
V8 v12.2 Windows patch (#13)
* Nightly patch * v12.1 patch * v12.2 patch
1 parent 676d38d commit 9a61a79

30 files changed

+121
-129
lines changed

deps/v8/src/builtins/builtins-collections-gen.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2782,10 +2782,9 @@ TNode<Word32T> WeakCollectionsBuiltinsAssembler::ShouldShrink(
27822782

27832783
TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::ValueIndexFromKeyIndex(
27842784
TNode<IntPtrT> key_index) {
2785-
return IntPtrAdd(
2786-
key_index,
2787-
IntPtrConstant(EphemeronHashTable::TodoShape::kEntryValueIndex -
2788-
EphemeronHashTable::kEntryKeyIndex));
2785+
return IntPtrAdd(key_index,
2786+
IntPtrConstant(EphemeronHashTable::ShapeT::kEntryValueIndex -
2787+
EphemeronHashTable::kEntryKeyIndex));
27892788
}
27902789

27912790
TF_BUILTIN(WeakMapConstructor, WeakCollectionsBuiltinsAssembler) {

deps/v8/src/codegen/code-stub-assembler.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9455,7 +9455,7 @@ void CodeStubAssembler::NameDictionaryLookup(
94559455
CAST(UnsafeLoadFixedArrayElement(dictionary, index));
94569456
GotoIf(TaggedEqual(current, undefined), if_not_found);
94579457
if (mode == kFindExisting) {
9458-
if (Dictionary::TodoShape::kMatchNeedsHoleCheck) {
9458+
if (Dictionary::ShapeT::kMatchNeedsHoleCheck) {
94599459
GotoIf(TaggedEqual(current, TheHoleConstant()), &next_probe);
94609460
}
94619461
current = LoadName<Dictionary>(current);

deps/v8/src/compiler/turboshaft/assembler.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3934,8 +3934,9 @@ class TSAssembler
39343934
: public Assembler<reducer_list<TurboshaftAssemblerOpInterface, Reducers...,
39353935
TSReducerBase>> {
39363936
public:
3937-
using Assembler<reducer_list<TurboshaftAssemblerOpInterface, Reducers...,
3938-
TSReducerBase>>::Assembler;
3937+
explicit TSAssembler(Graph& input_graph, Graph& output_graph,
3938+
Zone* phase_zone)
3939+
: Assembler(input_graph, output_graph, phase_zone) {}
39393940
};
39403941

39413942
#include "src/compiler/turboshaft/undef-assembler-macros.inc"

deps/v8/src/compiler/turboshaft/code-elimination-and-simplification-phase.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,8 @@ void CodeEliminationAndSimplificationPhase::Run(Zone* temp_zone) {
3232
// (which, for simplificy, doesn't use the Assembler helper
3333
// methods, but only calls Next::ReduceLoad/Store).
3434
DuplicationOptimizationReducer,
35-
ValueNumberingReducer>::Run(temp_zone);
35+
ValueNumberingReducer,
36+
VariableReducerHotfix>::Run<false>(temp_zone);
3637
}
3738

3839
} // namespace v8::internal::compiler::turboshaft

deps/v8/src/compiler/turboshaft/copying-phase.h

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ struct PaddingSpace {
3636
V8_EXPORT_PRIVATE std::ostream& operator<<(std::ostream& os,
3737
PaddingSpace padding);
3838

39+
template <class Next>
40+
class VariableReducerHotfix : public Next {
41+
public:
42+
void SetVariable(Variable var, OpIndex new_index) {}
43+
Variable NewLoopInvariantVariable(MaybeRegisterRepresentation rep) { return Variable(); }
44+
45+
OpIndex GetVariable(Variable var) { return OpIndex(); }
46+
OpIndex GetPredecessorValue(Variable var, int predecessor_index) { return OpIndex(); }
47+
};
48+
3949
template <typename Next>
4050
class ReducerBaseForwarder;
4151
template <typename Next>
@@ -46,6 +56,9 @@ class GraphVisitor : public Next {
4656
template <typename N>
4757
friend class ReducerBaseForwarder;
4858

59+
private:
60+
bool contains_variable_reducer_;
61+
4962
public:
5063
TURBOSHAFT_REDUCER_BOILERPLATE()
5164

@@ -66,7 +79,8 @@ class GraphVisitor : public Next {
6679
// `trace_reduction` is a template parameter to avoid paying for tracing at
6780
// runtime.
6881
template <bool trace_reduction>
69-
void VisitGraph() {
82+
void VisitGraph(bool contains_variable_reducer) {
83+
contains_variable_reducer_ = contains_variable_reducer;
7084
Asm().Analyze();
7185

7286
// Creating initial old-to-new Block mapping.
@@ -177,8 +191,7 @@ class GraphVisitor : public Next {
177191
DCHECK(old_index.valid());
178192
OpIndex result = op_mapping_[old_index];
179193

180-
if constexpr (reducer_list_contains<typename Next::ReducerList,
181-
VariableReducer>::value) {
194+
if (contains_variable_reducer_) {
182195
if (!result.valid()) {
183196
// {op_mapping} doesn't have a mapping for {old_index}. The assembler
184197
// should provide the mapping.
@@ -1294,8 +1307,7 @@ class GraphVisitor : public Next {
12941307
DCHECK(Asm().input_graph().BelongsToThisGraph(old_index));
12951308
DCHECK_IMPLIES(new_index.valid(),
12961309
Asm().output_graph().BelongsToThisGraph(new_index));
1297-
if constexpr (reducer_list_contains<typename Next::ReducerList,
1298-
VariableReducer>::value) {
1310+
if (contains_variable_reducer_) {
12991311
if (current_block_needs_variables_) {
13001312
MaybeVariable var = GetVariableFor(old_index);
13011313
if (!var.has_value()) {
@@ -1392,29 +1404,31 @@ class TSAssembler;
13921404
template <template <class> class... Reducers>
13931405
class CopyingPhaseImpl {
13941406
public:
1407+
template <bool contains_variable_reducer>
13951408
static void Run(Graph& input_graph, Zone* phase_zone,
13961409
bool trace_reductions = false) {
13971410
TSAssembler<GraphVisitor, Reducers...> phase(
13981411
input_graph, input_graph.GetOrCreateCompanion(), phase_zone);
13991412
#ifdef DEBUG
14001413
if (trace_reductions) {
1401-
phase.template VisitGraph<true>();
1414+
phase.template VisitGraph<true>(contains_variable_reducer);
14021415
} else {
1403-
phase.template VisitGraph<false>();
1416+
phase.template VisitGraph<false>(contains_variable_reducer);
14041417
}
14051418
#else
1406-
phase.template VisitGraph<false>();
1419+
phase.template VisitGraph<false>(contains_variable_reducer);
14071420
#endif // DEBUG
14081421
}
14091422
};
14101423

14111424
template <template <typename> typename... Reducers>
14121425
class CopyingPhase {
14131426
public:
1427+
template <bool contains_variable_reducer>
14141428
static void Run(Zone* phase_zone) {
14151429
PipelineData& data = PipelineData::Get();
14161430
Graph& input_graph = data.graph();
1417-
CopyingPhaseImpl<Reducers...>::Run(
1431+
CopyingPhaseImpl<Reducers...>::Run<contains_variable_reducer>(
14181432
input_graph, phase_zone, data.info()->turboshaft_trace_reduction());
14191433
}
14201434
};

deps/v8/src/compiler/turboshaft/csa-optimize-phase.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,23 @@ namespace v8::internal::compiler::turboshaft {
2525
void CsaLoadEliminationPhase::Run(Zone* temp_zone) {
2626
CopyingPhase<VariableReducer, MachineOptimizationReducer,
2727
RequiredOptimizationReducer,
28-
ValueNumberingReducer>::Run(temp_zone);
28+
ValueNumberingReducer>::Run<true>(temp_zone);
2929

3030
CopyingPhase<VariableReducer, LateLoadEliminationReducer,
3131
MachineOptimizationReducer, RequiredOptimizationReducer,
32-
ValueNumberingReducer>::Run(temp_zone);
32+
ValueNumberingReducer>::Run<true>(temp_zone);
3333
}
3434

3535
void CsaLateEscapeAnalysisPhase::Run(Zone* temp_zone) {
3636
CopyingPhase<VariableReducer, LateEscapeAnalysisReducer,
3737
MachineOptimizationReducer, RequiredOptimizationReducer,
38-
ValueNumberingReducer>::Run(temp_zone);
38+
ValueNumberingReducer>::Run<true>(temp_zone);
3939
}
4040

4141
void CsaBranchEliminationPhase::Run(Zone* temp_zone) {
4242
CopyingPhase<VariableReducer, MachineOptimizationReducer,
4343
BranchEliminationReducer, RequiredOptimizationReducer,
44-
ValueNumberingReducer>::Run(temp_zone);
44+
ValueNumberingReducer>::Run<true>(temp_zone);
4545
}
4646

4747
void CsaOptimizePhase::Run(Zone* temp_zone) {
@@ -51,7 +51,7 @@ void CsaOptimizePhase::Run(Zone* temp_zone) {
5151
CopyingPhase<VariableReducer, PretenuringPropagationReducer,
5252
MachineOptimizationReducer, MemoryOptimizationReducer,
5353
RequiredOptimizationReducer,
54-
ValueNumberingReducer>::Run(temp_zone);
54+
ValueNumberingReducer>::Run<true>(temp_zone);
5555
}
5656

5757
} // namespace v8::internal::compiler::turboshaft

deps/v8/src/compiler/turboshaft/debug-feature-lowering-phase.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ namespace v8::internal::compiler::turboshaft {
1111

1212
void DebugFeatureLoweringPhase::Run(Zone* temp_zone) {
1313
#ifdef V8_ENABLE_DEBUG_CODE
14-
turboshaft::CopyingPhase<turboshaft::DebugFeatureLoweringReducer>::Run(
14+
turboshaft::CopyingPhase<turboshaft::DebugFeatureLoweringReducer>::Run<false>(
1515
temp_zone);
1616
#endif
1717
}

deps/v8/src/compiler/turboshaft/int64-lowering-phase.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ void Int64LoweringPhase::Run(Zone* temp_zone) {
1616
#if V8_TARGET_ARCH_32_BIT
1717
turboshaft::CopyingPhase<
1818
turboshaft::Int64LoweringReducer, turboshaft::VariableReducer,
19-
turboshaft::RequiredOptimizationReducer>::Run(temp_zone);
19+
turboshaft::RequiredOptimizationReducer>::Run<true>(temp_zone);
2020
#else
2121
UNREACHABLE();
2222
#endif

deps/v8/src/compiler/turboshaft/loop-peeling-phase.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ void LoopPeelingPhase::Run(Zone* temp_zone) {
2323
turboshaft::VariableReducer,
2424
turboshaft::MachineOptimizationReducer,
2525
turboshaft::RequiredOptimizationReducer,
26-
turboshaft::ValueNumberingReducer>::Run(temp_zone);
26+
turboshaft::ValueNumberingReducer>::Run<true>(temp_zone);
2727
}
2828

2929
} // namespace v8::internal::compiler::turboshaft

deps/v8/src/compiler/turboshaft/loop-unrolling-phase.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ void LoopUnrollingPhase::Run(Zone* temp_zone) {
2222
turboshaft::VariableReducer,
2323
turboshaft::MachineOptimizationReducer,
2424
turboshaft::RequiredOptimizationReducer,
25-
turboshaft::ValueNumberingReducer>::Run(temp_zone);
25+
turboshaft::ValueNumberingReducer>::Run<true>(temp_zone);
2626
PipelineData::Get().clear_loop_unrolling_analyzer();
2727
}
2828
}

0 commit comments

Comments
 (0)