Commit 04941522 authored by Hai Dang's avatar Hai Dang Committed by Commit Bot

[cleanup] Use more LoadElementsKind in array generator.

Change-Id: Ic7d90d479b090670339200e4b6255fb1fb2441a5
Reviewed-on: https://chromium-review.googlesource.com/c/1288352Reviewed-by: 's avatarGeorg Neis <neis@chromium.org>
Commit-Queue: Hai Dang <dhai@google.com>
Cr-Commit-Position: refs/heads/master@{#56770}
parent a61acddf
...@@ -799,9 +799,7 @@ Node* ArrayBuiltinsAssembler::FindProcessor(Node* k_value, Node* k) { ...@@ -799,9 +799,7 @@ Node* ArrayBuiltinsAssembler::FindProcessor(Node* k_value, Node* k) {
BIND(&switch_on_elements_kind); BIND(&switch_on_elements_kind);
TNode<Smi> smi_len = CAST(len()); TNode<Smi> smi_len = CAST(len());
// Select by ElementsKind // Select by ElementsKind
Node* o_map = LoadMap(o()); Node* kind = LoadElementsKind(o());
Node* bit_field2 = LoadMapBitField2(o_map);
Node* kind = DecodeWord32<Map::ElementsKindBits>(bit_field2);
Branch(IsElementsKindGreaterThan(kind, HOLEY_ELEMENTS), Branch(IsElementsKindGreaterThan(kind, HOLEY_ELEMENTS),
&maybe_double_elements, &fast_elements); &maybe_double_elements, &fast_elements);
...@@ -1069,9 +1067,7 @@ TF_BUILTIN(ArrayPrototypePush, CodeStubAssembler) { ...@@ -1069,9 +1067,7 @@ TF_BUILTIN(ArrayPrototypePush, CodeStubAssembler) {
Increment(&arg_index); Increment(&arg_index);
// The runtime SetProperty call could have converted the array to dictionary // The runtime SetProperty call could have converted the array to dictionary
// mode, which must be detected to abort the fast-path. // mode, which must be detected to abort the fast-path.
Node* map = LoadMap(array_receiver); Node* kind = LoadElementsKind(array_receiver);
Node* bit_field2 = LoadMapBitField2(map);
Node* kind = DecodeWord32<Map::ElementsKindBits>(bit_field2);
GotoIf(Word32Equal(kind, Int32Constant(DICTIONARY_ELEMENTS)), GotoIf(Word32Equal(kind, Int32Constant(DICTIONARY_ELEMENTS)),
&default_label); &default_label);
...@@ -1115,9 +1111,7 @@ TF_BUILTIN(ArrayPrototypePush, CodeStubAssembler) { ...@@ -1115,9 +1111,7 @@ TF_BUILTIN(ArrayPrototypePush, CodeStubAssembler) {
Increment(&arg_index); Increment(&arg_index);
// The runtime SetProperty call could have converted the array to dictionary // The runtime SetProperty call could have converted the array to dictionary
// mode, which must be detected to abort the fast-path. // mode, which must be detected to abort the fast-path.
Node* map = LoadMap(array_receiver); Node* kind = LoadElementsKind(array_receiver);
Node* bit_field2 = LoadMapBitField2(map);
Node* kind = DecodeWord32<Map::ElementsKindBits>(bit_field2);
GotoIf(Word32Equal(kind, Int32Constant(DICTIONARY_ELEMENTS)), GotoIf(Word32Equal(kind, Int32Constant(DICTIONARY_ELEMENTS)),
&default_label); &default_label);
Goto(&object_push); Goto(&object_push);
...@@ -1633,8 +1627,8 @@ TF_BUILTIN(CloneFastJSArray, ArrayBuiltinsAssembler) { ...@@ -1633,8 +1627,8 @@ TF_BUILTIN(CloneFastJSArray, ArrayBuiltinsAssembler) {
TNode<JSArray> array = CAST(Parameter(Descriptor::kSource)); TNode<JSArray> array = CAST(Parameter(Descriptor::kSource));
CSA_ASSERT(this, CSA_ASSERT(this,
Word32Or(Word32BinaryNot(IsHoleyFastElementsKind( Word32Or(Word32BinaryNot(
LoadMapElementsKind(LoadMap(array)))), IsHoleyFastElementsKind(LoadElementsKind(array))),
Word32BinaryNot(IsNoElementsProtectorCellInvalid()))); Word32BinaryNot(IsNoElementsProtectorCellInvalid())));
ParameterMode mode = OptimalParameterMode(); ParameterMode mode = OptimalParameterMode();
...@@ -1653,8 +1647,8 @@ TF_BUILTIN(CloneFastJSArrayFillingHoles, ArrayBuiltinsAssembler) { ...@@ -1653,8 +1647,8 @@ TF_BUILTIN(CloneFastJSArrayFillingHoles, ArrayBuiltinsAssembler) {
TNode<JSArray> array = CAST(Parameter(Descriptor::kSource)); TNode<JSArray> array = CAST(Parameter(Descriptor::kSource));
CSA_ASSERT(this, CSA_ASSERT(this,
Word32Or(Word32BinaryNot(IsHoleyFastElementsKind( Word32Or(Word32BinaryNot(
LoadMapElementsKind(LoadMap(array)))), IsHoleyFastElementsKind(LoadElementsKind(array))),
Word32BinaryNot(IsNoElementsProtectorCellInvalid()))); Word32BinaryNot(IsNoElementsProtectorCellInvalid())));
ParameterMode mode = OptimalParameterMode(); ParameterMode mode = OptimalParameterMode();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment