Opened on 03/24/2016 at 05:22:50 PM
Closed on 03/24/2016 at 08:15:47 PM
#3873 closed change (fixed)
Replace more occurrences of __proto__ with Object.create(null)
Reported by: | sebastian | Assignee: | |
---|---|---|---|
Priority: | Unknown | Milestone: | |
Module: | Core | Keywords: | |
Cc: | Blocked By: | ||
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | no | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description (last modified by sebastian)
Background
The special property __proto__ has only recently been added to the ES standard as a legacy feature. Moreover, object literals using __proto__ causes the whole function to be deoptimized on V8.
Anyway, for a while we avoid using __proto__ now where easily possible, in particular for objects used as a hash-table. With #656, we even migrated most existing code where possible to use Object.create(null) instead. But it seems some bits have been overlooked or got reintroduced later.
Most notably, ActiveFilter.domains is currently using __proto__ in an object literal, triggering a deoptimization on V8, that effects filter matching performance on Chrome.
What to change
Replace object literals using __proto__: null with Object.create(null).
Attachments (0)
Change History (5)
comment:2 Changed on 03/24/2016 at 05:27:02 PM by sebastian
- Review URL(s) modified (diff)
- Status changed from new to reviewing
comment:4 Changed on 03/24/2016 at 08:14:56 PM by abpbot
comment:5 Changed on 03/24/2016 at 08:15:47 PM by sebastian
- Resolution set to fixed
- Status changed from reviewing to closed
A commit referencing this issue has landed:
https://hg.adblockplus.org/adblockpluscore/rev/655248eac773