The default bug view has changed. See this FAQ.

Rename hash AtomStateEntry to TaggedPointerEntry

RESOLVED FIXED in mozilla8

Status

()

Core
JavaScript Engine
RESOLVED FIXED
6 years ago
6 years ago

People

(Reporter: cdleary, Assigned: cdleary)

Tracking

unspecified
mozilla8
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [inbound])

Attachments

(1 attachment)

Created attachment 544368 [details] [diff] [review]
Tagged pointer hasher and entry.

I created another tagged hash-table pointer entry in the process of writing bug 649576 -- I generalized this out and ended up not needing it. It's a nice renaming on its own, and puts it in an easily identifiable place should anyone want to use it in the future.
Attachment #544368 - Flags: review?(jwalden+bmo)
Comment on attachment 544368 [details] [diff] [review]
Tagged pointer hasher and entry.

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

::: js/src/jsatom.h
@@ +152,4 @@
>  enum InternBehavior
>  {
>      DoNotInternAtom = 0,
>      InternAtom = 1

Luke's been using true/false for the initializers for enums like this that are bool-y, might be worth switching as a driveby.

::: js/src/jshashtable.h
@@ +754,5 @@
> +  public:
> +    TaggedPointerEntry() : bits(0) {}
> +    TaggedPointerEntry(const TaggedPointerEntry &other) : bits(other.bits) {}
> +    TaggedPointerEntry(T *ptr, bool tagged) : bits(uintptr_t(ptr) | tagged) {
> +        JS_ASSERT((uintptr_t(ptr) & 0x1) == 0);

Yesssss.

@@ +762,5 @@
> +        return bits & 0x1;
> +    }
> +
> +    /*
> +     * Non-branching code sequence. Note that the const_cast is safe because

Maybe use mutable instead?
Attachment #544368 - Flags: review?(jwalden+bmo) → review+
Whiteboard: [inbound]
http://hg.mozilla.org/mozilla-central/rev/adc8f12b54df
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla8
You need to log in before you can comment on or make changes to this bug.