diff options
author | Michaël Zasso <targos@protonmail.com> | 2021-10-10 11:10:43 +0200 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2021-10-12 08:07:50 +0200 |
commit | 62719c5fd2ab7dee1ac4019c1715061d556ac457 (patch) | |
tree | 356fed3842e577ab58fd51d5cc02f071cf7ee216 /deps/v8/src/compiler/js-create-lowering.cc | |
parent | a784258444b052dfd31cca90db57b21dc38bb1eb (diff) | |
download | node-new-62719c5fd2ab7dee1ac4019c1715061d556ac457.tar.gz |
deps: update V8 to 9.5.172.19
PR-URL: https://github.com/nodejs/node/pull/40178
Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Reviewed-By: Jiawen Geng <technicalcute@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Diffstat (limited to 'deps/v8/src/compiler/js-create-lowering.cc')
-rw-r--r-- | deps/v8/src/compiler/js-create-lowering.cc | 59 |
1 files changed, 35 insertions, 24 deletions
diff --git a/deps/v8/src/compiler/js-create-lowering.cc b/deps/v8/src/compiler/js-create-lowering.cc index 414977eb7d..60c9017fc2 100644 --- a/deps/v8/src/compiler/js-create-lowering.cc +++ b/deps/v8/src/compiler/js-create-lowering.cc @@ -197,11 +197,11 @@ Reduction JSCreateLowering::ReduceJSCreateArguments(Node* node) { Node* const arguments_length = graph()->NewNode(simplified()->ArgumentsLength()); // Allocate the elements backing store. - Node* const elements = effect = - graph()->NewNode(simplified()->NewArgumentsElements( - CreateArgumentsType::kUnmappedArguments, - shared.internal_formal_parameter_count()), - arguments_length, effect); + Node* const elements = effect = graph()->NewNode( + simplified()->NewArgumentsElements( + CreateArgumentsType::kUnmappedArguments, + shared.internal_formal_parameter_count_without_receiver()), + arguments_length, effect); // Load the arguments object map. Node* const arguments_map = jsgraph()->Constant(native_context().strict_arguments_map()); @@ -222,14 +222,14 @@ Reduction JSCreateLowering::ReduceJSCreateArguments(Node* node) { Node* effect = NodeProperties::GetEffectInput(node); Node* const arguments_length = graph()->NewNode(simplified()->ArgumentsLength()); - Node* const rest_length = graph()->NewNode( - simplified()->RestLength(shared.internal_formal_parameter_count())); + Node* const rest_length = graph()->NewNode(simplified()->RestLength( + shared.internal_formal_parameter_count_without_receiver())); // Allocate the elements backing store. - Node* const elements = effect = - graph()->NewNode(simplified()->NewArgumentsElements( - CreateArgumentsType::kRestParameter, - shared.internal_formal_parameter_count()), - arguments_length, effect); + Node* const elements = effect = graph()->NewNode( + simplified()->NewArgumentsElements( + CreateArgumentsType::kRestParameter, + shared.internal_formal_parameter_count_without_receiver()), + arguments_length, effect); // Load the JSArray object map. Node* const jsarray_map = jsgraph()->Constant( native_context().js_array_packed_elements_map()); @@ -332,7 +332,8 @@ Reduction JSCreateLowering::ReduceJSCreateArguments(Node* node) { return Changed(node); } case CreateArgumentsType::kRestParameter: { - int start_index = shared.internal_formal_parameter_count(); + int start_index = + shared.internal_formal_parameter_count_without_receiver(); // Use inline allocation for all unmapped arguments objects within inlined // (i.e. non-outermost) frames, independent of the object size. Node* effect = NodeProperties::GetEffectInput(node); @@ -401,7 +402,8 @@ Reduction JSCreateLowering::ReduceJSCreateGeneratorObject(Node* node) { // Allocate a register file. SharedFunctionInfoRef shared = js_function.shared(); DCHECK(shared.HasBytecodeArray()); - int parameter_count_no_receiver = shared.internal_formal_parameter_count(); + int parameter_count_no_receiver = + shared.internal_formal_parameter_count_without_receiver(); int length = parameter_count_no_receiver + shared.GetBytecodeArray().register_count(); MapRef fixed_array_map = MakeRef(broker(), factory()->fixed_array_map()); @@ -466,9 +468,10 @@ Reduction JSCreateLowering::ReduceNewArray( // Constructing an Array via new Array(N) where N is an unsigned // integer, always creates a holey backing store. - ASSIGN_RETURN_NO_CHANGE_IF_DATA_MISSING( - initial_map, - initial_map.AsElementsKind(GetHoleyElementsKind(elements_kind))); + base::Optional<MapRef> maybe_initial_map = + initial_map.AsElementsKind(GetHoleyElementsKind(elements_kind)); + if (!maybe_initial_map.has_value()) return NoChange(); + initial_map = maybe_initial_map.value(); // Because CheckBounds performs implicit conversion from string to number, an // additional CheckNumber is required to behave correctly for calls with a @@ -525,8 +528,12 @@ Reduction JSCreateLowering::ReduceNewArray( if (NodeProperties::GetType(length).Max() > 0.0) { elements_kind = GetHoleyElementsKind(elements_kind); } - ASSIGN_RETURN_NO_CHANGE_IF_DATA_MISSING( - initial_map, initial_map.AsElementsKind(elements_kind)); + + base::Optional<MapRef> maybe_initial_map = + initial_map.AsElementsKind(elements_kind); + if (!maybe_initial_map.has_value()) return NoChange(); + initial_map = maybe_initial_map.value(); + DCHECK(IsFastElementsKind(elements_kind)); // Setup elements and properties. @@ -566,8 +573,11 @@ Reduction JSCreateLowering::ReduceNewArray( // Determine the appropriate elements kind. DCHECK(IsFastElementsKind(elements_kind)); - ASSIGN_RETURN_NO_CHANGE_IF_DATA_MISSING( - initial_map, initial_map.AsElementsKind(elements_kind)); + + base::Optional<MapRef> maybe_initial_map = + initial_map.AsElementsKind(elements_kind); + if (!maybe_initial_map.has_value()) return NoChange(); + initial_map = maybe_initial_map.value(); // Check {values} based on the {elements_kind}. These checks are guarded // by the {elements_kind} feedback on the {site}, so it's safe to just @@ -1479,7 +1489,8 @@ Node* JSCreateLowering::TryAllocateAliasedArguments( // If there is no aliasing, the arguments object elements are not special in // any way, we can just return an unmapped backing store instead. - int parameter_count = shared.internal_formal_parameter_count(); + int parameter_count = + shared.internal_formal_parameter_count_without_receiver(); if (parameter_count == 0) { return TryAllocateArguments(effect, control, frame_state); } @@ -1545,7 +1556,8 @@ Node* JSCreateLowering::TryAllocateAliasedArguments( const SharedFunctionInfoRef& shared, bool* has_aliased_arguments) { // If there is no aliasing, the arguments object elements are not // special in any way, we can just return an unmapped backing store. - int parameter_count = shared.internal_formal_parameter_count(); + int parameter_count = + shared.internal_formal_parameter_count_without_receiver(); if (parameter_count == 0) { return graph()->NewNode( simplified()->NewArgumentsElements( @@ -1713,7 +1725,6 @@ base::Optional<Node*> JSCreateLowering::TryAllocateFastLiteral( Type::Any(), MachineType::AnyTagged(), kFullWriteBarrier, - LoadSensitivity::kUnsafe, const_field_info}; // Note: the use of RawInobjectPropertyAt (vs. the higher-level |