| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 11e94b9 commit c563a1c
17 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -37,7 +37,7 @@ | |||
| 37 | 37 | ||
| 38 | 38 | # Reset this number to 0 on major V8 upgrades. | |
| 39 | 39 | # Increment by one for each non-official patch applied to deps/v8. | |
| 40 | - 'v8_embedder_string': '-node.6', | ||
| 40 | + 'v8_embedder_string': '-node.7', | ||
| 41 | 41 | ||
| 42 | 42 | ##### V8 defaults for Node.js ##### | |
| 43 | 43 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2782,10 +2782,9 @@ TNode<Word32T> WeakCollectionsBuiltinsAssembler::ShouldShrink( | |||
| 2782 | 2782 | ||
| 2783 | 2783 | TNode<IntPtrT> WeakCollectionsBuiltinsAssembler::ValueIndexFromKeyIndex( | |
| 2784 | 2784 | 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)); | ||
| 2789 | 2788 | } | |
| 2790 | 2789 | ||
| 2791 | 2790 | TF_BUILTIN(WeakMapConstructor, WeakCollectionsBuiltinsAssembler) { | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9505,7 +9505,7 @@ void CodeStubAssembler::NameDictionaryLookup( | |||
| 9505 | 9505 | CAST(UnsafeLoadFixedArrayElement(dictionary, index)); | |
| 9506 | 9506 | GotoIf(TaggedEqual(current, undefined), if_not_found_with_insertion_index); | |
| 9507 | 9507 | if (mode == kFindExisting) { | |
| 9508 | - if (Dictionary::TodoShape::kMatchNeedsHoleCheck) { | ||
| 9508 | + if (Dictionary::ShapeT::kMatchNeedsHoleCheck) { | ||
| 9509 | 9509 | GotoIf(TaggedEqual(current, TheHoleConstant()), &next_probe); | |
| 9510 | 9510 | } | |
| 9511 | 9511 | current = LoadName<Dictionary>(current); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1547,7 +1547,7 @@ class V8_EXPORT_PRIVATE CodeStubAssembler | |||
| 1547 | 1547 | TNode<Smi> LoadFixedArrayBaseLength(TNode<FixedArrayBase> array); | |
| 1548 | 1548 | template <typename Array> | |
| 1549 | 1549 | TNode<Smi> LoadArrayCapacity(TNode<Array> array) { | |
| 1550 | - return LoadObjectField<Smi>(array, Array::Shape::kCapacityOffset); | ||
| 1550 | + return LoadObjectField<Smi>(array, Array::ShapeT::kCapacityOffset); | ||
| 1551 | 1551 | } | |
| 1552 | 1552 | // Load the length of a fixed array base instance. | |
| 1553 | 1553 | TNode<IntPtrT> LoadAndUntagFixedArrayBaseLength(TNode<FixedArrayBase> array); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1121,8 +1121,7 @@ class TurboshaftAssemblerOpInterface | |||
| 1121 | 1121 | ||
| 1122 | 1122 | template <typename... Args> | |
| 1123 | 1123 | explicit TurboshaftAssemblerOpInterface(Args... args) | |
| 1124 | - : GenericAssemblerOpInterface<Next>(args...), | ||
| 1125 | - matcher_(Asm().output_graph()) {} | ||
| 1124 | + : matcher_(Asm().output_graph()) {} | ||
| 1126 | 1125 | ||
| 1127 | 1126 | const OperationMatcher& matcher() const { return matcher_; } | |
| 1128 | 1127 | ||
@@ -2245,11 +2244,11 @@ class TurboshaftAssemblerOpInterface | |||
| 2245 | 2244 | ||
| 2246 | 2245 | // Helpers to read the most common fields. | |
| 2247 | 2246 | // TODO(nicohartmann@): Strengthen this to `V<HeapObject>`. | |
| 2248 | - V<Map> LoadMapField(V<Object> object) { | ||
| 2249 | - return LoadField<Map>(object, AccessBuilder::ForMap()); | ||
| 2247 | + V<v8::internal::Map> LoadMapField(V<Object> object) { | ||
| 2248 | + return LoadField<v8::internal::Map>(object, AccessBuilder::ForMap()); | ||
| 2250 | 2249 | } | |
| 2251 | 2250 | ||
| 2252 | - V<Word32> LoadInstanceTypeField(V<Map> map) { | ||
| 2251 | + V<Word32> LoadInstanceTypeField(V<v8::internal::Map> map) { | ||
| 2253 | 2252 | return LoadField<Word32>(map, AccessBuilder::ForMapInstanceType()); | |
| 2254 | 2253 | } | |
| 2255 | 2254 | ||
@@ -2849,7 +2848,7 @@ class TurboshaftAssemblerOpInterface | |||
| 2849 | 2848 | V<Object> CallRuntime_TransitionElementsKind(Isolate* isolate, | |
| 2850 | 2849 | V<Context> context, | |
| 2851 | 2850 | V<HeapObject> object, | |
| 2852 | - V<Map> target_map) { | ||
| 2851 | + V<v8::internal::Map> target_map) { | ||
| 2853 | 2852 | return CallRuntime<typename RuntimeCallDescriptor::TransitionElementsKind>( | |
| 2854 | 2853 | isolate, context, {object, target_map}); | |
| 2855 | 2854 | } | |
@@ -3267,8 +3266,8 @@ class TurboshaftAssemblerOpInterface | |||
| 3267 | 3266 | ||
| 3268 | 3267 | void TransitionAndStoreArrayElement( | |
| 3269 | 3268 | V<Object> array, V<WordPtr> index, OpIndex value, | |
| 3270 | - TransitionAndStoreArrayElementOp::Kind kind, MaybeHandle<Map> fast_map, | ||
| 3271 | - MaybeHandle<Map> double_map) { | ||
| 3269 | + TransitionAndStoreArrayElementOp::Kind kind, MaybeHandle<v8::internal::Map> fast_map, | ||
| 3270 | + MaybeHandle<v8::internal::Map> double_map) { | ||
| 3272 | 3271 | ReduceIfReachableTransitionAndStoreArrayElement(array, index, value, kind, | |
| 3273 | 3272 | fast_map, double_map); | |
| 3274 | 3273 | } | |
@@ -3281,17 +3280,17 @@ class TurboshaftAssemblerOpInterface | |||
| 3281 | 3280 | } | |
| 3282 | 3281 | ||
| 3283 | 3282 | V<Word32> CompareMaps(V<HeapObject> heap_object, | |
| 3284 | - const ZoneRefSet<Map>& maps) { | ||
| 3283 | + const ZoneRefSet<v8::internal::Map>& maps) { | ||
| 3285 | 3284 | return ReduceIfReachableCompareMaps(heap_object, maps); | |
| 3286 | 3285 | } | |
| 3287 | 3286 | ||
| 3288 | 3287 | void CheckMaps(V<HeapObject> heap_object, OpIndex frame_state, | |
| 3289 | - const ZoneRefSet<Map>& maps, CheckMapsFlags flags, | ||
| 3288 | + const ZoneRefSet<v8::internal::Map>& maps, CheckMapsFlags flags, | ||
| 3290 | 3289 | const FeedbackSource& feedback) { | |
| 3291 | 3290 | ReduceIfReachableCheckMaps(heap_object, frame_state, maps, flags, feedback); | |
| 3292 | 3291 | } | |
| 3293 | 3292 | ||
| 3294 | - void AssumeMap(V<HeapObject> heap_object, const ZoneRefSet<Map>& maps) { | ||
| 3293 | + void AssumeMap(V<HeapObject> heap_object, const ZoneRefSet<v8::internal::Map>& maps) { | ||
| 3295 | 3294 | ReduceIfReachableAssumeMap(heap_object, maps); | |
| 3296 | 3295 | } | |
| 3297 | 3296 | ||
@@ -3400,16 +3399,16 @@ class TurboshaftAssemblerOpInterface | |||
| 3400 | 3399 | return ReduceIfReachableAssertNotNull(object, type, trap_id); | |
| 3401 | 3400 | } | |
| 3402 | 3401 | ||
| 3403 | - V<Map> RttCanon(V<FixedArray> rtts, uint32_t type_index) { | ||
| 3402 | + V<v8::internal::Map> RttCanon(V<FixedArray> rtts, uint32_t type_index) { | ||
| 3404 | 3403 | return ReduceIfReachableRttCanon(rtts, type_index); | |
| 3405 | 3404 | } | |
| 3406 | 3405 | ||
| 3407 | - V<Word32> WasmTypeCheck(V<Tagged> object, OptionalV<Map> rtt, | ||
| 3406 | + V<Word32> WasmTypeCheck(V<Tagged> object, OptionalV<v8::internal::Map> rtt, | ||
| 3408 | 3407 | WasmTypeCheckConfig config) { | |
| 3409 | 3408 | return ReduceIfReachableWasmTypeCheck(object, rtt, config); | |
| 3410 | 3409 | } | |
| 3411 | 3410 | ||
| 3412 | - V<Tagged> WasmTypeCast(V<Tagged> object, OptionalV<Map> rtt, | ||
| 3411 | + V<Tagged> WasmTypeCast(V<Tagged> object, OptionalV<v8::internal::Map> rtt, | ||
| 3413 | 3412 | WasmTypeCheckConfig config) { | |
| 3414 | 3413 | return ReduceIfReachableWasmTypeCast(object, rtt, config); | |
| 3415 | 3414 | } | |
@@ -3454,12 +3453,12 @@ class TurboshaftAssemblerOpInterface | |||
| 3454 | 3453 | return ReduceIfReachableArrayLength(array, null_check); | |
| 3455 | 3454 | } | |
| 3456 | 3455 | ||
| 3457 | - V<HeapObject> WasmAllocateArray(V<Map> rtt, ConstOrV<Word32> length, | ||
| 3456 | + V<HeapObject> WasmAllocateArray(V<v8::internal::Map> rtt, ConstOrV<Word32> length, | ||
| 3458 | 3457 | const wasm::ArrayType* array_type) { | |
| 3459 | 3458 | return ReduceIfReachableWasmAllocateArray(rtt, resolve(length), array_type); | |
| 3460 | 3459 | } | |
| 3461 | 3460 | ||
| 3462 | - V<HeapObject> WasmAllocateStruct(V<Map> rtt, | ||
| 3461 | + V<HeapObject> WasmAllocateStruct(V<v8::internal::Map> rtt, | ||
| 3463 | 3462 | const wasm::StructType* struct_type) { | |
| 3464 | 3463 | return ReduceIfReachableWasmAllocateStruct(rtt, struct_type); | |
| 3465 | 3464 | } | |
@@ -4044,8 +4043,14 @@ class TSAssembler | |||
| 4044 | 4043 | : public Assembler<reducer_list<TurboshaftAssemblerOpInterface, Reducers..., | |
| 4045 | 4044 | TSReducerBase>> { | |
| 4046 | 4045 | public: | |
| 4047 | - using Assembler<reducer_list<TurboshaftAssemblerOpInterface, Reducers..., | ||
| 4048 | - TSReducerBase>>::Assembler; | ||
| 4046 | + #ifdef _WIN32 | ||
| 4047 | + explicit TSAssembler(Graph& input_graph, Graph& output_graph, | ||
| 4048 | + Zone* phase_zone) | ||
| 4049 | + : Assembler(input_graph, output_graph, phase_zone) {} | ||
| 4050 | + #else | ||
| 4051 | + using Assembler<reducer_list<TurboshaftAssemblerOpInterface, Reducers..., | ||
| 4052 | + TSReducerBase>>::Assembler; | ||
| 4053 | + #endif | ||
| 4049 | 4054 | }; | |
| 4050 | 4055 | ||
| 4051 | 4056 | #include "src/compiler/turboshaft/undef-assembler-macros.inc" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1349,53 +1349,23 @@ class MachineOptimizationReducer : public Next { | |||
| 1349 | 1349 | if (matcher.MatchConstantShiftRightArithmeticShiftOutZeros( | |
| 1350 | 1350 | left, &x, rep_w, &k1) && | |
| 1351 | 1351 | matcher.MatchIntegralWordConstant(right, rep_w, &k2) && | |
| 1352 | - CountLeadingSignBits(k2, rep_w) > k1) { | ||
| 1353 | - if (matcher.Get(left).saturated_use_count.IsZero()) { | ||
| 1354 | - return __ Comparison( | ||
| 1355 | - x, __ WordConstant(base::bits::Unsigned(k2) << k1, rep_w), kind, | ||
| 1356 | - rep_w); | ||
| 1357 | - } else if constexpr (reducer_list_contains< | ||
| 1358 | - ReducerList, ValueNumberingReducer>::value) { | ||
| 1359 | - // If the shift has uses, we only apply the transformation if the | ||
| 1360 | - // result would be GVNed away. | ||
| 1361 | - OpIndex rhs = | ||
| 1362 | - __ WordConstant(base::bits::Unsigned(k2) << k1, rep_w); | ||
| 1363 | - static_assert(ComparisonOp::input_count == 2); | ||
| 1364 | - static_assert(sizeof(ComparisonOp) == 8); | ||
| 1365 | - base::SmallVector<OperationStorageSlot, 32> storage; | ||
| 1366 | - ComparisonOp* cmp = | ||
| 1367 | - CreateOperation<ComparisonOp>(storage, x, rhs, kind, rep_w); | ||
| 1368 | - if (__ WillGVNOp(*cmp)) { | ||
| 1369 | - return __ Comparison(x, rhs, kind, rep_w); | ||
| 1370 | - } | ||
| 1371 | - } | ||
| 1352 | + CountLeadingSignBits(k2, rep_w) > k1 && | ||
| 1353 | + matcher.Get(left).saturated_use_count.IsZero()) { | ||
| 1354 | + return __ Comparison( | ||
| 1355 | + x, __ WordConstant(base::bits::Unsigned(k2) << k1, rep_w), kind, | ||
| 1356 | + rep_w); | ||
| 1372 | 1357 | } | |
| 1373 | 1358 | // k2 </<= (x >> k1) => (k2 << k1) </<= x if shifts reversible | |
| 1374 | 1359 | // Only perform the transformation if the shift is not used yet, to | |
| 1375 | 1360 | // avoid keeping both the shift and x alive. | |
| 1376 | 1361 | if (matcher.MatchConstantShiftRightArithmeticShiftOutZeros( | |
| 1377 | 1362 | right, &x, rep_w, &k1) && | |
| 1378 | 1363 | matcher.MatchIntegralWordConstant(left, rep_w, &k2) && | |
| 1379 | - CountLeadingSignBits(k2, rep_w) > k1) { | ||
| 1380 | - if (matcher.Get(right).saturated_use_count.IsZero()) { | ||
| 1381 | - return __ Comparison( | ||
| 1382 | - __ WordConstant(base::bits::Unsigned(k2) << k1, rep_w), x, kind, | ||
| 1383 | - rep_w); | ||
| 1384 | - } else if constexpr (reducer_list_contains< | ||
| 1385 | - ReducerList, ValueNumberingReducer>::value) { | ||
| 1386 | - // If the shift has uses, we only apply the transformation if the | ||
| 1387 | - // result would be GVNed away. | ||
| 1388 | - OpIndex lhs = | ||
| 1389 | - __ WordConstant(base::bits::Unsigned(k2) << k1, rep_w); | ||
| 1390 | - static_assert(ComparisonOp::input_count == 2); | ||
| 1391 | - static_assert(sizeof(ComparisonOp) == 8); | ||
| 1392 | - base::SmallVector<OperationStorageSlot, 32> storage; | ||
| 1393 | - ComparisonOp* cmp = | ||
| 1394 | - CreateOperation<ComparisonOp>(storage, lhs, x, kind, rep_w); | ||
| 1395 | - if (__ WillGVNOp(*cmp)) { | ||
| 1396 | - return __ Comparison(lhs, x, kind, rep_w); | ||
| 1397 | - } | ||
| 1398 | - } | ||
| 1364 | + CountLeadingSignBits(k2, rep_w) > k1 && | ||
| 1365 | + matcher.Get(right).saturated_use_count.IsZero()) { | ||
| 1366 | + return __ Comparison( | ||
| 1367 | + __ WordConstant(base::bits::Unsigned(k2) << k1, rep_w), x, kind, | ||
| 1368 | + rep_w); | ||
| 1399 | 1369 | } | |
| 1400 | 1370 | } | |
| 1401 | 1371 | // Map 64bit to 32bit comparisons. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,18 +32,18 @@ class SimplifiedLoweringReducer : public Next { | |||
| 32 | 32 | OpIndex ig_index, const SpeculativeNumberBinopOp& op) { | |
| 33 | 33 | DCHECK_EQ(op.kind, SpeculativeNumberBinopOp::Kind::kSafeIntegerAdd); | |
| 34 | 34 | ||
| 35 | - OpIndex frame_state = Map(op.frame_state()); | ||
| 36 | - V<Word32> left = ProcessInput(Map(op.left()), Rep::Word32(), | ||
| 35 | + OpIndex frame_state = MapImpl(op.frame_state()); | ||
| 36 | + V<Word32> left = ProcessInput(MapImpl(op.left()), Rep::Word32(), | ||
| 37 | 37 | CheckKind::kSigned32, frame_state); | |
| 38 | - V<Word32> right = ProcessInput(Map(op.right()), Rep::Word32(), | ||
| 38 | + V<Word32> right = ProcessInput(MapImpl(op.right()), Rep::Word32(), | ||
| 39 | 39 | CheckKind::kSigned32, frame_state); | |
| 40 | 40 | ||
| 41 | 41 | V<Word32> result = __ OverflowCheckedBinop( | |
| 42 | 42 | left, right, OverflowCheckedBinopOp::Kind::kSignedAdd, | |
| 43 | 43 | WordRepresentation::Word32()); | |
| 44 | 44 | ||
| 45 | 45 | V<Word32> overflow = __ Projection(result, 1, Rep::Word32()); | |
| 46 | - __ DeoptimizeIf(overflow, Map(op.frame_state()), | ||
| 46 | + __ DeoptimizeIf(overflow, MapImpl(op.frame_state()), | ||
| 47 | 47 | DeoptimizeReason::kOverflow, FeedbackSource{}); | |
| 48 | 48 | return __ Projection(result, 0, Rep::Word32()); | |
| 49 | 49 | } | |
@@ -52,10 +52,10 @@ class SimplifiedLoweringReducer : public Next { | |||
| 52 | 52 | base::SmallVector<OpIndex, 8> return_values; | |
| 53 | 53 | for (OpIndex input : ret.return_values()) { | |
| 54 | 54 | return_values.push_back( | |
| 55 | - ProcessInput(Map(input), Rep::Tagged(), CheckKind::kNone, {})); | ||
| 55 | + ProcessInput(MapImpl(input), Rep::Tagged(), CheckKind::kNone, {})); | ||
| 56 | 56 | } | |
| 57 | 57 | ||
| 58 | - __ Return(Map(ret.pop_count()), base::VectorOf(return_values)); | ||
| 58 | + __ Return(MapImpl(ret.pop_count()), base::VectorOf(return_values)); | ||
| 59 | 59 | return OpIndex::Invalid(); | |
| 60 | 60 | } | |
| 61 | 61 | ||
@@ -94,7 +94,7 @@ class SimplifiedLoweringReducer : public Next { | |||
| 94 | 94 | } | |
| 95 | 95 | } | |
| 96 | 96 | ||
| 97 | - inline OpIndex Map(OpIndex ig_index) { return __ MapToNewGraph(ig_index); } | ||
| 97 | + inline OpIndex MapImpl(OpIndex ig_index) { return __ MapToNewGraph(ig_index); } | ||
| 98 | 98 | }; | |
| 99 | 99 | ||
| 100 | 100 | #include "src/compiler/turboshaft/undef-assembler-macros.inc" | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,9 +55,11 @@ namespace v8::internal::compiler::turboshaft { | |||
| 55 | 55 | // with constant inputs introduced by `VariableReducer` need to be eliminated. | |
| 56 | 56 | template <class AfterNext> | |
| 57 | 57 | class VariableReducer : public RequiredOptimizationReducer<AfterNext> { | |
| 58 | + protected: | ||
| 58 | 59 | using Next = RequiredOptimizationReducer<AfterNext>; | |
| 59 | 60 | using Snapshot = SnapshotTable<OpIndex, VariableData>::Snapshot; | |
| 60 | 61 | ||
| 62 | + private: | ||
| 61 | 63 | struct GetActiveLoopVariablesIndex { | |
| 62 | 64 | IntrusiveSetIndex& operator()(Variable var) const { | |
| 63 | 65 | return var.data().active_loop_variables_index; | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -3570,7 +3570,7 @@ void Heap::RightTrimArray(Tagged<Array> object, int new_capacity, | |||
| 3570 | 3570 | } | |
| 3571 | 3571 | ||
| 3572 | 3572 | const int bytes_to_trim = | |
| 3573 | - (old_capacity - new_capacity) * Array::Shape::kElementSize; | ||
| 3573 | + (old_capacity - new_capacity) * Array::HotfixShape::kElementSize; | ||
| 3574 | 3574 | ||
| 3575 | 3575 | // Calculate location of new array end. | |
| 3576 | 3576 | const int old_size = Array::SizeFor(old_capacity); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,8 +32,7 @@ class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE) Dictionary | |||
| 32 | 32 | using DerivedHashTable = HashTable<Derived, Shape>; | |
| 33 | 33 | ||
| 34 | 34 | public: | |
| 35 | - using TodoShape = Shape; | ||
| 36 | - using Key = typename TodoShape::Key; | ||
| 35 | + using Key = typename Shape::Key; | ||
| 37 | 36 | inline Tagged<Object> ValueAt(InternalIndex entry); | |
| 38 | 37 | inline Tagged<Object> ValueAt(PtrComprCageBase cage_base, | |
| 39 | 38 | InternalIndex entry); | |
@@ -126,7 +125,7 @@ class EXPORT_TEMPLATE_DECLARE(V8_EXPORT_PRIVATE) Dictionary | |||
| 126 | 125 | Key key, Handle<Object> value, | |
| 127 | 126 | PropertyDetails details); | |
| 128 | 127 | ||
| 129 | - OBJECT_CONSTRUCTORS(Dictionary, HashTable<Derived, TodoShape>); | ||
| 128 | + OBJECT_CONSTRUCTORS(Dictionary, HashTable<Derived, Shape>); | ||
| 130 | 129 | }; | |
| 131 | 130 | ||
| 132 | 131 | #define EXTERN_DECLARE_DICTIONARY(DERIVED, SHAPE) \ | |
| Back | FazBrowse Home | New Git URL |
0 commit comments