Skip to content

Commit

Permalink
Fix typos in comments of JSCJSValue.h
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=270775

Reviewed by Keith Miller.

It is the second bit which is set for non-numeric immediates and the second bit is bit 1.

* Source/JavaScriptCore/runtime/JSCJSValue.h:

Canonical link: https://commits.webkit.org/275951@main
  • Loading branch information
witch-factory authored and kmiller68 committed Mar 12, 2024
1 parent 33e22ac commit b2b0e19
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Source/JavaScriptCore/runtime/JSCJSValue.h
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ class JSValue {
* ranges to encode other values (however there are also other ranges of NaN space that
* could have been selected).
*
* This range of NaN space is represented by 64-bit numbers begining with the 15-bit
* This range of NaN space is represented by 64-bit numbers beginning with the 15-bit
* hex patterns 0xFFFC and 0xFFFE - we rely on the fact that no valid double-precision
* numbers will fall in these ranges.
*
Expand Down Expand Up @@ -452,9 +452,9 @@ class JSValue {
* Null: 0x02
*
* These values have the following properties:
* - Bit 1 (OtherTag) is set for all four values, allowing real pointers to be
* - Bit 1 (0-indexed) is set (OtherTag) for all four values, allowing real pointers to be
* quickly distinguished from all immediate values, including these invalid pointers.
* - With bit 3 masked out (UndefinedTag), Undefined and Null share the
* - With bit 3 (0-indexed) masked out (UndefinedTag), Undefined and Null share the
* same value, allowing null & undefined to be quickly detected.
*
* No valid JSValue will have the bit pattern 0x0, this is used to represent array
Expand Down Expand Up @@ -482,7 +482,7 @@ class JSValue {
static_assert(LowestOfHighBits & NumberTag);
static_assert(!((LowestOfHighBits>>1) & NumberTag));

// All non-numeric (bool, null, undefined) immediates have bit 2 set.
// All non-numeric (bool, null, undefined) immediates have bit 1 (0-indexed) set.
static constexpr int32_t OtherTag = 0x2;
static constexpr int32_t BoolTag = 0x4;
static constexpr int32_t UndefinedTag = 0x8;
Expand Down

0 comments on commit b2b0e19

Please sign in to comment.