Closed Bug 615181 Opened 14 years ago Closed 13 years ago

Extend SlotStorageType enum to allow more types

Categories

(Tamarin Graveyard :: Virtual Machine, defect, P3)

defect

Tracking

(Not tracked)

VERIFIED FIXED
Q1 12 - Brannan

People

(Reporter: virgilp, Assigned: virgilp)

References

Details

(Whiteboard: has-patch)

Attachments

(1 file, 5 obsolete files)

User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_5; en-US) AppleWebKit/534.7 (KHTML, like Gecko) Chrome/7.0.517.44 Safari/534.7
Build Identifier: 

SlotStorageType now has 8 members and is stored on 3 bits. In order to be able to add new types (like float, float4 etc) we need to extend this enum with new members

Reproducible: Always
Blocks: float/float4
Severity: enhancement → normal
Status: UNCONFIRMED → NEW
Ever confirmed: true
Target Milestone: --- → Future
Attached patch Patch to enlarge SlotStorageType (obsolete) — Splinter Review
Attachment #493714 - Flags: review?(virgilp)
Comment on attachment 493714 [details] [diff] [review]
Patch to enlarge SlotStorageType

I'm guessing you want someone else to review the patch?
Attachment #493714 - Attachment is patch: true
Comment on attachment 493714 [details] [diff] [review]
Patch to enlarge SlotStorageType

One nit: the comment

// offset is always a multiple of 4 so skip those, gives us a max of 1<<31-1

Is no longer correct, since MAX_SLOT_OFFSET is different now.
Attachment #493714 - Flags: review?(virgilp) → review+
I fixed the comment, removed changes related to bibop + project change.
This should be theoretically "good to go" if you want to take it in mainline
Attachment #493714 - Attachment is obsolete: true
Attachment #493924 - Flags: review?(lhansen)
Comment on attachment 493924 [details] [diff] [review]
updated patch to enlarge SlotStorageType

Redirecting review to Edwin for feedback, this is not my area of expertise and there's no really good reason to push for this to land right away.

(The comments about what the situation "was" vs what it "is" and who did what to it do not normally belong in the code; if we're curious about a file's history we have the mercurial log.  Documentation should pertain to what the code currently does.)
Attachment #493924 - Flags: review?(lhansen) → feedback?(edwsmith)
Attached patch patch to enlarge SlotStorageType (obsolete) — Splinter Review
fixed comment as per Lars' remarks
Attachment #493924 - Attachment is obsolete: true
Attachment #493932 - Flags: review?(edwsmith)
Attachment #493924 - Flags: feedback?(edwsmith)
Comment on attachment 493932 [details] [diff] [review]
patch to enlarge SlotStorageType

Looks okay.  A few new comments should be capitalized and end with .

The most important part of this patch is the argumentation that the reduced
upper limit on slot offset is still fine.  I think it is, but did not review
that part very carefully because I couldn't find the existing argumentation
for why 29 bits is okay.  (asking Steven for feedback).

The function tables in jit-calls.h could grow when MAX_SST changes, and it would be a bug if they didn't get new entries.  if we are super paranoid, a static
assertion would ensure we fail fast.  but we'd probably fail fast anyway and
I'm not *that* paranoid.
Attachment #493932 - Flags: review?(edwsmith)
Attachment #493932 - Flags: review+
Attachment #493932 - Flags: feedback?(stejohns)
29 bits was OK because we stored the offset in 4-byte-words, not bytes, so we could really express 31 bits of range in terms of byte-offset. Since MMgc never allowed allocations larger than 2GB anyway, this was safe. This reduces our effective range to 1GB, which is almost certainly fine as a practical matter, but probably is worth adding a resolve-time range check to ensure we don't overflow.
FWIW the object size limit in MMgc is now approx 4GB (actually a hair below that).
Comment on attachment 493932 [details] [diff] [review]
patch to enlarge SlotStorageType

F+ conditional on adding a resolve-time range check to ensure we don't
overflow.
Attachment #493932 - Flags: feedback?(stejohns) → feedback+
Attached file enlarge SlotStorageType (obsolete) —
Really only a rebase + a small comment change.
@Steven - by "adding a resolve-time range check" do you mean something different than the assert that already exists in Traits-inlines.h / setSlotInfo() ?
Attached patch enlarge SlotStorageType (obsolete) — Splinter Review
(resubmitted)

Really only a rebase + a small comment change.
@Steven - by "adding a resolve-time range check" do you mean something different than the assert that already exists in Traits-inlines.h / setSlotInfo() ?
Attachment #493932 - Attachment is obsolete: true
Attachment #533220 - Attachment is obsolete: true
Attachment #533221 - Attachment is obsolete: true
(In reply to comment #12)
> @Steven - by "adding a resolve-time range check" do you mean something
> different than the assert that already exists in Traits-inlines.h /
> setSlotInfo() ?

Hm, nope that will probably do it.
Assignee: nobody → virgilp
Status: NEW → ASSIGNED
Priority: -- → P3
Whiteboard: has-patch
Target Milestone: Future → Q1 12 - Brannan
changeset: 6396:457203bf8d0d
user:      Lars T Hansen <lhansen@adobe.com>
summary:   Fix 615181 - Extend SlotStorageType enum to allow more types (patch=virgilp, r=edwsmith, f=stejohns, push=lhansen)

http://hg.mozilla.org/tamarin-redux/rev/457203bf8d0d
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Lars/Virgil: Is there anything that needs to be done before I can mark this as "Verified"?
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: