[stubs] Fix bug in ArrayPush builtin that only surfaces on MIPS debug

The v8 waterfall currently doesn't run MIPS tests in the debug configuration,
so although there are tests that would have found them, they currently are
not running in the standard CI setup. A bug has been fixed to add the debug
configuration of MIPS & MIPS64, too.

Review-Url: https://codereview.chromium.org/2654263002
Cr-Commit-Position: refs/heads/master@{#42727}
This commit is contained in:
danno 2017-01-27 00:48:28 -08:00 committed by Commit bot
parent 9be4934d6f
commit fd918b595b

View File

@ -270,6 +270,15 @@ void Builtins::Generate_FastArrayPush(compiler::CodeAssemblerState* state) {
assembler.CallRuntime(Runtime::kSetProperty, context, receiver, length, arg,
assembler.SmiConstant(STRICT));
assembler.Increment(arg_index);
// The runtime SetProperty call could have converted the array to dictionary
// mode, which must be detected to abort the fast-path.
Node* map = assembler.LoadMap(receiver);
Node* bit_field2 = assembler.LoadMapBitField2(map);
Node* kind = assembler.DecodeWord32<Map::ElementsKindBits>(bit_field2);
assembler.GotoIf(assembler.Word32Equal(
kind, assembler.Int32Constant(DICTIONARY_ELEMENTS)),
&default_label);
assembler.GotoIfNotNumber(arg, &object_push);
assembler.Goto(&double_push);
}
@ -310,6 +319,14 @@ void Builtins::Generate_FastArrayPush(compiler::CodeAssemblerState* state) {
assembler.CallRuntime(Runtime::kSetProperty, context, receiver, length, arg,
assembler.SmiConstant(STRICT));
assembler.Increment(arg_index);
// The runtime SetProperty call could have converted the array to dictionary
// mode, which must be detected to abort the fast-path.
Node* map = assembler.LoadMap(receiver);
Node* bit_field2 = assembler.LoadMapBitField2(map);
Node* kind = assembler.DecodeWord32<Map::ElementsKindBits>(bit_field2);
assembler.GotoIf(assembler.Word32Equal(
kind, assembler.Int32Constant(DICTIONARY_ELEMENTS)),
&default_label);
assembler.Goto(&object_push);
}