diff --git a/deps/v8/src/builtins/builtins-object.cc b/deps/v8/src/builtins/builtins-object.cc index 671397d9eacd11..53de00338ae4db 100644 --- a/deps/v8/src/builtins/builtins-object.cc +++ b/deps/v8/src/builtins/builtins-object.cc @@ -300,10 +300,10 @@ void Builtins::Generate_ObjectProtoToString(CodeStubAssembler* assembler) { Node* context = assembler->Parameter(3); assembler->GotoIf( - assembler->Word32Equal(receiver, assembler->UndefinedConstant()), + assembler->WordEqual(receiver, assembler->UndefinedConstant()), &return_undefined); - assembler->GotoIf(assembler->Word32Equal(receiver, assembler->NullConstant()), + assembler->GotoIf(assembler->WordEqual(receiver, assembler->NullConstant()), &return_null); assembler->GotoIf(assembler->WordIsSmi(receiver), &return_number); diff --git a/deps/v8/test/mjsunit/regress/regress-crbug-664506.js b/deps/v8/test/mjsunit/regress/regress-crbug-664506.js new file mode 100644 index 00000000000000..b0bf5e7591d4f4 --- /dev/null +++ b/deps/v8/test/mjsunit/regress/regress-crbug-664506.js @@ -0,0 +1,11 @@ +// Copyright 2016 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Flags: --expose-gc --predictable --random-seed=-1109634722 + +gc(); +gc(); +assertEquals("[object Object]", Object.prototype.toString.call({})); +gc(); +assertEquals("[object Array]", Object.prototype.toString.call([]));