Replace some uses of ProtoAndIfaceCache::EntrySlotIfExists with something that returns a boolean

RESOLVED FIXED in Firefox 55

Status

()

enhancement
RESOLVED FIXED
2 years ago
5 months ago

People

(Reporter: bzbarsky, Assigned: bzbarsky)

Tracking

53 Branch
mozilla55
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox55 fixed)

Details

Attachments

(1 attachment)

Right now we return a JSObject*, which means we end up barriering on it and doing exposeToJS.  There's no need to do that; all the consumers just want to know whether it's null.  So we could return a boolean, which Heap<JSObject*> can produce without barriering.
Summary: Replace ProtoAndIfaceCache::EntrySlotIfExists with something that returns a boolean → Replace some uses of ProtoAndIfaceCache::EntrySlotIfExists with something that returns a boolean
Comment on attachment 8874953 [details] [diff] [review]
Replace some uses of ProtoAndIfaceCache::EntrySlotIfExists with a faster boolean-returning test function

Review of attachment 8874953 [details] [diff] [review]:
-----------------------------------------------------------------

::: dom/bindings/BindingUtils.h
@@ +319,5 @@
>        }
>        return (*p)[leafIndex];
>      }
>  
> +    bool HasEntryInSlot(size_t i) {

Would be nice if there was a way to write this function without so much duplication, but... :(
Attachment #8874953 - Flags: review?(nfroyd) → review+
Yeah, I couldn't figure out a way to do that, without doing manual exposing stuff or something.  I thought I could nix EntrySlotIfExists completely, but we do have one single consumer of it that actually wants the JSObject*.

That said, maybe I can just switch ResolvePrototypeOrConstructor to EntrySlotMustExist. I believe in all cases when it's used this is in fact true...  and the current behavior when null is returned is a bit bonkers anyway (uncatchable exception).  Filed bug 1370640.
Blocks: 1370640
Pushed by bzbarsky@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/b84707ac2dfe
Replace some uses of ProtoAndIfaceCache::EntrySlotIfExists with a faster boolean-returning test function.  r=froydnj
https://hg.mozilla.org/mozilla-central/rev/b84707ac2dfe
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.