Last Comment Bug 669776 - Rename hash AtomStateEntry to TaggedPointerEntry
: Rename hash AtomStateEntry to TaggedPointerEntry
Status: RESOLVED FIXED
[inbound]
:
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: unspecified
: x86_64 Linux
: -- normal (vote)
: mozilla8
Assigned To: Chris Leary [:cdleary] (not checking bugmail)
:
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-07-06 16:06 PDT by Chris Leary [:cdleary] (not checking bugmail)
Modified: 2011-07-20 06:58 PDT (History)
2 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Tagged pointer hasher and entry. (11.42 KB, patch)
2011-07-06 16:06 PDT, Chris Leary [:cdleary] (not checking bugmail)
jwalden+bmo: review+
Details | Diff | Splinter Review

Description Chris Leary [:cdleary] (not checking bugmail) 2011-07-06 16:06:38 PDT
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.
Comment 1 Jeff Walden [:Waldo] (remove +bmo to email) 2011-07-08 14:45:39 PDT
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?
Comment 2 Marco Bonardo [::mak] 2011-07-20 06:58:36 PDT
http://hg.mozilla.org/mozilla-central/rev/adc8f12b54df

Note You need to log in before you can comment on or make changes to this bug.