minor cleanups in indexedDB Key code

RESOLVED FIXED in Firefox 52

Status

()

RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: froydnj, Assigned: froydnj)

Tracking

unspecified
mozilla52
Points:
---

Firefox Tracking Flags

(firefox52 fixed)

Details

Attachments

(2 attachments)

(Assignee)

Description

2 years ago
We have better ways of writing some of the floating-point serialization bits.
(Assignee)

Comment 1

2 years ago
Created attachment 8803510 [details] [diff] [review]
part 1 - use BitwiseCast for punning between uint64_t/double in indexedDB

We have code elsewhere for this sort of stuff; let's use it here.
Attachment #8803510 - Flags: review?(jvarga)
(Assignee)

Comment 2

2 years ago
Created attachment 8803511 [details] [diff] [review]
part 2 - use FloatingPoint<>::kSignBit in lieu of hand-rolled constant

This way is a little bit more readable.
Attachment #8803511 - Flags: review?(jvarga)

Comment 3

2 years ago
Comment on attachment 8803510 [details] [diff] [review]
part 1 - use BitwiseCast for punning between uint64_t/double in indexedDB

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

Looks good.

btw, there's one more "pun" in dom/indexedDB/ActorsParent.cpp, DatabaseOperationBase::ReinterpretDoubleAsUInt64()
Attachment #8803510 - Flags: review?(jvarga) → review+

Comment 4

2 years ago
Comment on attachment 8803511 [details] [diff] [review]
part 2 - use FloatingPoint<>::kSignBit in lieu of hand-rolled constant

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

::: dom/indexedDB/Key.cpp
@@ +616,2 @@
>                      (0 - bits) :
> +                    (bits | signbit);

Nit: merge into one line ?

@@ +642,1 @@
>                    (0 - number);

dtto
Attachment #8803511 - Flags: review?(jvarga) → review+

Comment 5

2 years ago
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/22876ba02fee
part 1 - use BitwiseCast for punning between uint64_t/double in indexedDB; r=janv
https://hg.mozilla.org/integration/mozilla-inbound/rev/9c10b3a0b1e2
part 2 - use FloatingPoint<>::kSignBit in lieu of hand-rolled constant; r=janv

Comment 6

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/22876ba02fee
https://hg.mozilla.org/mozilla-central/rev/9c10b3a0b1e2
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox52: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla52
You need to log in before you can comment on or make changes to this bug.