Closed Bug 1639898 Opened 6 years ago Closed 6 years ago

More cleanups of NaN in JS::Value

Categories

(Core :: JavaScript Engine, task, P3)

task

Tracking

()

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: tcampbell, Assigned: tcampbell)

References

Details

Attachments

(2 files, 2 obsolete files)

Misc cleanup around handling of NaN in JS::Value.

  • Add more comments
  • Simplify the JSVAL_SHIFTED_TAG_MAX_DOUBLE
  • Add ValueToDouble helper methods
  • Assert GenericNaN is compatible
  • Fixup the WrappedPtrOperations for JS::Value

This is arbitrary, but since the negative NaN is the dividing point between
Double and boxed values, it seems like a better canonical value.

Depends on D76339

This ensures we compute the NaN at runtime instead of compile time since this
is this test is aimed at JIT compatibility. In practice, these should be the
same, plus/minus the sign bit.

Depends on D76340

The StructuredClone algorithm has its own form of NaN-boxing that does not
need to strictly match JS::Value. Add a SCTAG_NAN type that matches current
value of GenericNaN and replace the CanonicalizeNaN call.

When converting to JS::Value, we still explicitly canonicalize. I put back
the JS:: namespace qualifier since this isn't a universal canonicalization.
Also remove the extraneous canonicalization.

Attachment #9150790 - Attachment is obsolete: true
Attachment #9150888 - Attachment is obsolete: true
Pushed by tcampbell@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/ed3c28387f3a Cleanup NaN code for JS::Value. r=iain https://hg.mozilla.org/integration/autoland/rev/156314339700 Use volatile in CheckCanonicalNaN. r=iain
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: