Commit fd918b59 authored by danno's avatar danno Committed by Commit bot

[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}
parent 9be4934d
......@@ -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);
}
......
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