Thank you! Unfortunately, for everyone, it is getting clearer and clearer that this is an optimization issue. The issue does not reproduce with the --no-crankshaft flag.
The code is calling something like -
jQuery.extend(/* deepCopy */ true, {string: 'something'}, {string, 'something', instance: someConstructedInstance})
(Where someConstructedInstance is a an instance of an object based on an enhanced Backbone View Model, so it is not a plain object)
And sometimes (it used to occasionally appear, it now appears most often than not), jQuery.isPlainObject returns true for the value of instance.
That jQuery function finishes with the following
statements -
var key;
for ( key in obj ) {}
return key === undefined || core_hasOwn.call( obj, key );
From my debugging, it sometimes fails the
key === undefined check (if I add more logging code, it returns
true - that does not make sense) and it sometimes fails the
core_hasOwn.call( obj, key ) check (which returns
true for a key that is not an own property). When this happen,
Object.keys(obj).indexOf(key) returns
-1. I verified that the key is indeed not an own property.
(I am using jQuery 1.9.1 and cannot update it, but the code has basically gone through simplification, not real bug fixes)
I think it may have started since Chrome 52, I am not sure. It evidently possibly became much, much worse in Chrome 53 (Windows 7, Intel Core i5, 32 bit).
I should report it, but I cannot disclose the code (it is a several-megabyte package that includes - and uses in that stack - several libraries like Knockout, Backbone, Underscore and more). Can someone suggest how I can diagnose and debug this further (without a native code debugger) in order to help you understand the exact issue (without showing code :()?
☆PhistucK