gecko-dev/js
Chris Fallin 1c38bd4e40 Bug 1492920: remove restriction on IC attachment for instanceof: allow RHS with a reassigned __proto__. r=djvj,jandem
Based on discussions with :djvj, it seems that this IC attachment logic is
overly conservative. We're seeing a case where the `__proto__` of a constructor
function is reassigned, which causes all instanceof ICs to fail to attach. The
test case is like:

    function C() { /* ... */ }
    C.__proto__ = D;
    var o = new C();
    var result = o instanceof C;  // this IC fails to attach

This change generalizes the IC attachment logic to check whether @@hasInstance
is defined anywhere below Function in the prototype chain of the RHS. If not,
it is still safe to attach the IC; the IC simply needs to guard on the
prototype chain to ensure no @@hasInstance override is inserted later.

Differential Revision: https://phabricator.services.mozilla.com/D42366

--HG--
extra : moz-landing-system : lando
2019-08-22 18:08:37 +00:00
..
ductwork/debugger Bug 1564168 - [jsdbg2] Debugger.prototype.enabled should be removed. 2019-08-19 21:47:05 +00:00
examples Bug 1564168 - [jsdbg2] Debugger.prototype.enabled should be removed. 2019-08-19 21:47:05 +00:00
ipc Bug 1563139 - Remove StaticPrefs.h. r=glandium 2019-07-26 01:10:23 +00:00
public Backed out changeset d99e941429d0 (bug 1568923) for SM bustages on RelocationOverlay.h . CLOSED TREE 2019-08-22 20:31:45 +03:00
rust Bug 1573844 - Remove references to js::Class and remove the alias r=tcampbell 2019-08-14 19:13:12 +00:00
src Bug 1492920: remove restriction on IC attachment for instanceof: allow RHS with a reassigned __proto__. r=djvj,jandem 2019-08-22 18:08:37 +00:00
xpconnect Backed out 5 changesets (bug 1575055) for xpcshell failures on js/CompileOptions.h. CLOSED TREE 2019-08-22 17:08:22 +03:00
app.mozbuild Bug 1569197 - Backed out changeset 2a053de2828f;r=arai 2019-08-07 09:17:11 +00:00
ffi.configure
moz.build
moz.configure Bug 1555894 - Only enable cranelift on JS standalone builds. r=lth,nalexander 2019-08-19 13:12:25 +00:00
sub.configure Bug 844509 - Don't encode environment in get_cmd_output and old_configure. r=nalexander 2019-08-20 22:12:23 +00:00