| Index: src/code-stub-assembler.cc
|
| diff --git a/src/code-stub-assembler.cc b/src/code-stub-assembler.cc
|
| index 766d331333bd837b614f0a7429fadb990985d08e..66354e6e9641f191b9cf1ecacac0de1ab8f4e20e 100644
|
| --- a/src/code-stub-assembler.cc
|
| +++ b/src/code-stub-assembler.cc
|
| @@ -8850,20 +8850,31 @@ compiler::Node* CodeStubAssembler::CreateArrayIterator(
|
| // There are only two key iterator maps, branch depending on whether or not
|
| // the receiver is a TypedArray or not.
|
|
|
| - Label if_isarray(this), if_istypedarray(this), if_isgeneric(this);
|
| - Label* kInstanceTypeHandlers[] = {&if_isarray, &if_istypedarray};
|
| -
|
| - static int32_t kInstanceType[] = {JS_ARRAY_TYPE, JS_TYPED_ARRAY_TYPE};
|
| + Label if_istypedarray(this), if_isgeneric(this);
|
|
|
| - Switch(array_type, &if_isgeneric, kInstanceType, kInstanceTypeHandlers,
|
| - arraysize(kInstanceType));
|
| + Branch(Word32Equal(array_type, Int32Constant(JS_TYPED_ARRAY_TYPE)),
|
| + &if_istypedarray, &if_isgeneric);
|
|
|
| - Bind(&if_isarray);
|
| + Bind(&if_isgeneric);
|
| {
|
| - var_map_index.Bind(
|
| - IntPtrConstant(Context::FAST_ARRAY_KEY_ITERATOR_MAP_INDEX));
|
| - var_array_map.Bind(array_map);
|
| - Goto(&allocate_iterator);
|
| + Label if_isfast(this), if_isslow(this);
|
| + BranchIfFastJSArray(array, context, &if_isfast, &if_isslow);
|
| +
|
| + Bind(&if_isfast);
|
| + {
|
| + var_map_index.Bind(
|
| + IntPtrConstant(Context::FAST_ARRAY_KEY_ITERATOR_MAP_INDEX));
|
| + var_array_map.Bind(array_map);
|
| + Goto(&allocate_iterator);
|
| + }
|
| +
|
| + Bind(&if_isslow);
|
| + {
|
| + var_map_index.Bind(
|
| + IntPtrConstant(Context::GENERIC_ARRAY_KEY_ITERATOR_MAP_INDEX));
|
| + var_array_map.Bind(UndefinedConstant());
|
| + Goto(&allocate_iterator);
|
| + }
|
| }
|
|
|
| Bind(&if_istypedarray);
|
| @@ -8873,14 +8884,6 @@ compiler::Node* CodeStubAssembler::CreateArrayIterator(
|
| var_array_map.Bind(UndefinedConstant());
|
| Goto(&allocate_iterator);
|
| }
|
| -
|
| - Bind(&if_isgeneric);
|
| - {
|
| - var_map_index.Bind(
|
| - IntPtrConstant(Context::GENERIC_ARRAY_KEY_ITERATOR_MAP_INDEX));
|
| - var_array_map.Bind(UndefinedConstant());
|
| - Goto(&allocate_iterator);
|
| - }
|
| } else {
|
| Label if_istypedarray(this), if_isgeneric(this);
|
| Branch(Word32Equal(array_type, Int32Constant(JS_TYPED_ARRAY_TYPE)),
|
|
|