Closed Bug 518747 Opened 15 years ago Closed 15 years ago

NJ merge: get rid of NJ_LOG2_PAGE_SIZE et al

Categories

(Core :: JavaScript Engine, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
status1.9.2 --- beta1-fixed

People

(Reporter: n.nethercote, Assigned: n.nethercote)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file, 2 obsolete files)

Attached patch patch (obsolete) — Splinter Review
This patch removes NJ_LOG2_PAGE_SIZE from all the backends, to match
Tamarin.  jstracer was using it via NJ_PAGE_SIZE for the Tracker, so I
introduced a new constant TRACKER_PAGE_SIZE which is now used instead.  Its
size is 4096 which the same as NJ_PAGE_SIZE for all backends except Sparc,
so Tracker lookup performance shouldn't be affected.

I also changed "Page" to "TrackerPage" throughout, because I don't like the
idea of taking a well-defined existing term like "Page" (as in OS pages) and
using it to refer to something similar-but-subtly-different (arbitrarily
sized memory chunks in our own data structure).
Attachment #402741 - Flags: review?(graydon)
Attached patch patch v2 (obsolete) — Splinter Review
In the new version I tweaked a comment, and renamed PAGESIZE as TRACKER_PAGE_SIZE.

But now I'm not sure about this comment:

 * The size of the map is allocated as N * sizeof(LIns*), where N is
 * (TRACKER_PAGE_SIZE >> 2).  Since the lower two bits are 0, they are always
 * discounted.  The result is the map can store N pointers.
 *
 * PAGEMASK is the "reverse" expression, with a |- 1| to get a mask which
 * separates an address into the Base and Index bits. It is necessary to do
 * all this work rather than use TRACKER_PAGE_SIZE - 1, because on 64-bit
 * platforms the pointer width is twice as large, and only half as many
 * indexes can fit into TrackerPage::map. So the "Base" grows by one bit, and
 * the "Index" shrinks by one bit.

In particular, the "on 64-bit... only half as many indexes can fit into TrackerPage::map" doesn't seem right, because we allocate twice as much space on 64 bit machines.  As a result, I'm not sure if the last sentence is right, and thus whether Tracker works properly on 64-bit machines.  (Nb: this is all independent of the patch, which hasn't changed the operation at all... any problems were pre-existing.)
Attachment #402741 - Attachment is obsolete: true
Attachment #402744 - Flags: review?(graydon)
Attachment #402741 - Flags: review?(graydon)
Attached patch patch v3Splinter Review
Attached the wrong patch.  Previous comment applies to this patch (v3).
Attachment #402744 - Attachment is obsolete: true
Attachment #402745 - Flags: review?(graydon)
Attachment #402744 - Flags: review?(graydon)
Attachment #402745 - Flags: review?(graydon) → review+
http://hg.mozilla.org/tracemonkey/rev/18edb6af7701
Whiteboard: fixed-in-tracemonkey
(In reply to comment #1)
> 
> In particular, the "on 64-bit... only half as many indexes can fit into
> TrackerPage::map" doesn't seem right, because we allocate twice as much space
> on 64 bit machines.  As a result, I'm not sure if the last sentence is right,
> and thus whether Tracker works properly on 64-bit machines.

Bug 519156 is the follow-up for this observation.
http://hg.mozilla.org/mozilla-central/rev/18edb6af7701
Status: ASSIGNED → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: