Closed Bug 925807 Opened 6 years ago Closed 6 years ago

define JS_BITS_PER_WORD in terms of JS_64BIT

Categories

(Core :: JavaScript Engine, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla27

People

(Reporter: froydnj, Unassigned)

References

(Blocks 1 open bug)

Details

Attachments

(1 file, 3 obsolete files)

JS_BITS_PER_WORD is derived from configure.  This work done by configure is unecessary,
since we can derive the information from the compiler, and it holds us back from doing
clever things like single-pass universal builds on OS X (bug 781171).  Over in
bug 925110, I hit upon the idea of using the currently-unused JS_64BIT macro to replace
JS_BITS_PER_WORD usages.  I don't know that doing so is any cleaner, but it's
certainly more pragmatic and easier to review than replacing everything with C++
template magic or the equivalent.
This is possibly the least straightforward of the patches, since we really do need
constants in the definition of ArenaHeader.
Attachment #815925 - Flags: review?(wmccloskey)
Most of complication here comes from switching conditionals around so that we do
|if defined| rather than |if !defined|.
Attachment #815927 - Flags: review?(jdemooij)
All these bits didn't seem to nicely fit in other places.
Attachment #815929 - Flags: review?(jorendorff)
Why don't we just define JS_BITS_PER_WORD using JS_64BIT? That's effectively what this patch does anyway.
(In reply to Bill McCloskey (:billm) from comment #4)
> Why don't we just define JS_BITS_PER_WORD using JS_64BIT? That's effectively
> what this patch does anyway.

Hm, that's a possibility!  *slaps forehead*

I don't care one way or the other.
Blocks: 925167
Comment on attachment 815927 [details] [diff] [review]
part 2 - use JS_64BIT instead of JS_BITS_PER_WORD in jit code

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

Clearing review flag per comment 4 and 5.
Attachment #815927 - Flags: review?(jdemooij)
Summary: use JS_64BIT instead of checking JS_BITS_PER_WORD for preprocessor conditionals → define JS_BITS_PER_WORD in terms of JS_64BIT
Smaller patch.  The extra #includes are for all the places that ought to be including
jstypes.h for JS_BITS_PER_WORD, but are instead bootlegging from elsewhere.
Attachment #815925 - Attachment is obsolete: true
Attachment #815927 - Attachment is obsolete: true
Attachment #815929 - Attachment is obsolete: true
Attachment #815925 - Flags: review?(wmccloskey)
Attachment #815929 - Flags: review?(jorendorff)
Attachment #816030 - Flags: review?(wmccloskey)
Comment on attachment 816030 [details] [diff] [review]
define JS_BITS_PER_WORD in terms of JS_64BIT

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

Stealing review.
Attachment #816030 - Flags: review?(wmccloskey) → review+
Thanks njn.
https://hg.mozilla.org/mozilla-central/rev/2b6522d861f8
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
You need to log in before you can comment on or make changes to this bug.