Closed
Bug 606236
Opened 14 years ago
Closed 14 years ago
MNHT calls WB on non-pointer values and isn't consistent
Categories
(Tamarin Graveyard :: Virtual Machine, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
Q3 11 - Serrano
People
(Reporter: treilly, Assigned: treilly)
References
Details
(Whiteboard: safegc)
Attachments
(1 file, 2 obsolete files)
57.30 KB,
patch
|
stejohns
:
review+
edwsmith
:
superreview-
|
Details | Diff | Splinter Review |
addVersionedBindings(bindings, name, compat_nss, AvmCore::makeMGSBinding(methodCount, BKIND_METHOD)); we want to make the write barrier stricter but this has to be addressed first. MNHT.h sez: BKIND_METHOD = 1, // MethodEnv* 001 Which is a lie in this case because methodCount ain't a MethodEnv*
Comment 1•14 years ago
|
||
MNHT has lots of client code who play fast and loose with what they hand it; some cleanup would probably be a very good idea
Comment 2•14 years ago
|
||
(In reply to comment #1) > MNHT has lots of client code who play fast and loose with what they hand it; > some cleanup would probably be a very good idea ^^^^^^^^ definitely This is one of the reasons we are held hostage to Atom; lets fix abuses aggressively as we find them. Or, at least, catalog them in a tracking bug.
Comment 3•14 years ago
|
||
This might be a dupe of a bug Lars ran into with exact-marking. I remember talking to him about it and I'm not sure if he wrote it up as a blocker or just found a workaround. Maybe check the exact-marking dependencies.
Assignee | ||
Comment 4•14 years ago
|
||
I see comments about this in Lar's exact tracing patch but couldn't find a bug reference or one linked to the exact tracing master bug, I suspect we don't feel strongly about this to make it a blocker on exact tracing?
Assignee | ||
Comment 5•14 years ago
|
||
FYI, Lar's rolled a ConserativeTracePointer function to handle this and other cases of malfeasance
Comment 6•14 years ago
|
||
Malfeasance is right...
Comment 7•14 years ago
|
||
IMHO the right long-term fix is to upgrade MNHT to be type-safe with various payloads, a la https://bugzilla.mozilla.org/show_bug.cgi?id=568664 -- not a trivial change, alas
Assignee | ||
Comment 8•14 years ago
|
||
Doesn't help exact tracing but it at least delineates the malfeasance which isn't that bad actually.
Attachment #485415 -
Flags: feedback?(stejohns)
Comment 9•14 years ago
|
||
Comment on attachment 485415 [details] [diff] [review] Not the right not term fix but lets my strict write barrier assertions fly yuck, holding nose but arguably better than nothing. comments: -- instead of a new arg to put(), maybe have put_gc() and put_nongc(), since put() is typically on a hot path and you almost always know at compile time which you want -- gonna need a lot more specialization that Traits, I suspect. Also worth doing a scan of Flash/AIR glue code to find people using this. -- extra credit: make two thin-inline templated wrappers on top of MNHT, one for GC, one for non-GC, thus avoiding the overloading of add()?
Attachment #485415 -
Flags: feedback?(stejohns) → feedback+
Assignee: nobody → treilly
Status: NEW → ASSIGNED
Flags: flashplayer-qrb+
Priority: -- → P2
Whiteboard: safegc
Target Milestone: --- → flash10.x - Serrano
Blocks: safegc-tracker
OS: Mac OS X → Windows 7
Assignee | ||
Updated•14 years ago
|
No longer blocks: safegc-tracker
Assignee | ||
Comment 10•14 years ago
|
||
Attachment #485415 -
Attachment is obsolete: true
Attachment #490941 -
Flags: feedback?(stejohns)
Comment 11•14 years ago
|
||
Comment on attachment 490941 [details] [diff] [review] getting warmer? Oh yeah. Just did a quick skim, not full review, but this looks much happier.
Attachment #490941 -
Flags: feedback?(stejohns) → feedback+
Assignee | ||
Comment 12•14 years ago
|
||
Pre-review Checklist: sandbox perf code size Anything else?
Assignee | ||
Comment 13•14 years ago
|
||
sandbox passes code size is a wash on gcc and msvc perf is a wash no hits on MultinameHashtable in FR
Attachment #490941 -
Attachment is obsolete: true
Attachment #491504 -
Flags: superreview?(edwsmith)
Attachment #491504 -
Flags: review?(stejohns)
Assignee | ||
Comment 14•14 years ago
|
||
I didn't wait for the perf run to finish, there was one repeatable win: avm avm2 test best avg best avg %dBst %dAvg Metric: time Dir: jsbench/typed/ LUFact 2530 2532.6 2227 2230.8 12.0 11.9 ++
Comment 15•14 years ago
|
||
Comment on attachment 491504 [details] [diff] [review] templatized MultinameHashtable One real suggestion: this code pattern, seen in a few places: int bitMask = numQuads - 1; // Note: Mask off MSB to avoid negative indices. Mask off bottom // 3 bits because it doesn't contribute to hash. Quad it // because names, namespaces, and values are stored adjacently. unsigned i = ((0x7FFFFFF8 & (uintptr_t)mnameName)>>3) & bitMask; has always seemed wonky to be and probably time to consider fixing it: (1) "Mask off MSB to avoid negative indices", but uintptr_t is unsigned, so this is pointless (2) "Mask off bottom 3 bits" is a waste since we are shifting those bits out anyway, via >>3 (3) "Quad it because names, namespaces, and values are stored adjacently" is nonsensical and I think applies to a long-dead implementation Can anyone explain why this is just as good: uintptr_t bitMask = numQuads - 1; uintptr_t i = (uintptr_t(mnameName)>>3) & bitMask; nits: -- tabbing in Domain.h, MultinameHashtable.h, PoolObject.h, Traits.h (vertical alignment of members) -- // point to GC memory, highly unlikely and its worth keeping us ^^^ it's -- // To be specific how to declare getNSSet's return value elluded ^, ^^^^^^^ eluded idle thoughts: -- find() and rehash() use "int" and "unsigned"; I wonder if now is a good time to convert them to C99 types? -- I wonder if isFull() should be inlined?
Attachment #491504 -
Flags: review?(stejohns) → review+
Assignee | ||
Comment 16•14 years ago
|
||
I'll fix the comments and code alignment but not the other changes, I'm just trying to unblock my stricter write barriers which Lar's wanted checked in yesterday.
Comment 17•14 years ago
|
||
Comment on attachment 491504 [details] [diff] [review] templatized MultinameHashtable Domain.h: - fix alignment of m_namedTraits and m_namedScriptsMap. (really, I shouldn't have to ask! that the messy formatting got this far wastes my time to write about it and your time to fix it. just do it up front, please). The new template functions in MultinameHashtable-impl.h are not marked inline. Should they be? If not, explicit instantiation might be required, but that's okay, we control the use sites. IIRC, explicit instantiations can go in MNHT.cpp, like this: (or elsewhere, for that matter). template class MultinameHashtable<Binding, BindingType>; template class MultinameHashtable<Traits*, GCObjectType>; I think there will be enough movement to re-review after this, but not re-SR.
Attachment #491504 -
Flags: superreview?(edwsmith) → superreview-
Assignee | ||
Comment 18•14 years ago
|
||
(In reply to comment #17) > Comment on attachment 491504 [details] [diff] [review] > templatized MultinameHashtable > > Domain.h: > - fix alignment of m_namedTraits and m_namedScriptsMap. > (really, I shouldn't have to ask! that the messy formatting got this > far wastes my time to write about it and your time to fix it. just do it > up front, please). Will do, I've never paid attention to the alignment of the field names before, we don't do it everywhere (we don't do it at all in MMgc) and I had to look at it a couple times to figure out what Steven was talking about.
OS: Windows 7 → Windows XP
Assignee | ||
Comment 19•14 years ago
|
||
(In reply to comment #17) > The new template functions in MultinameHashtable-impl.h are not marked inline. > Should they be? This bug isn't about revisiting whether or not certain methods should be inlined. These are out of line as they were before. > If not, explicit instantiation might be required, but that's > okay, we control the use sites. IIRC, explicit instantiations can go in > MNHT.cpp, like this: (or elsewhere, for that matter). > > template class MultinameHashtable<Binding, BindingType>; > template class MultinameHashtable<Traits*, GCObjectType>; > > I think there will be enough movement to re-review after this, but not re-SR. This is exactly what the patch does. See MultinameHashtable.cpp
Assignee | ||
Comment 20•14 years ago
|
||
I think isFull(In reply to comment #15) > -- I wonder if isFull() should be inlined? isFull, Init and perhaps the dtor and getMulti could perhaps be inlined, I'll open a separate bug.
Assignee | ||
Comment 21•14 years ago
|
||
https://bugzilla.mozilla.org/show_bug.cgi?id=613490
OS: Windows XP → All
Assignee | ||
Comment 22•14 years ago
|
||
https://bugzilla.mozilla.org/show_bug.cgi?id=613491
Comment 23•14 years ago
|
||
changeset: 5566:a67f06077185 user: Tommy Reilly <treilly@adobe.com> summary: Refactor MultinameHashtable as a template class to get proper write barrier usage (r=stejohns,sr=edwsmith,bug=606236) http://hg.mozilla.org/tamarin-redux/rev/a67f06077185
Assignee | ||
Comment 24•14 years ago
|
||
(In reply to comment #19) > > I think there will be enough movement to re-review after this, but not re-SR. There was no movement since the suggestion was to do something the patch already did so I pushed it.
Assignee | ||
Updated•14 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 25•14 years ago
|
||
Also logged this bug: https://bugzilla.mozilla.org/show_bug.cgi?id=613196
Comment 26•14 years ago
|
||
(In reply to comment #19) > This is exactly what the patch does. See MultinameHashtable.cpp Fair enough -- but then why are all those functions in an -impl.h file? They could go in MultinameHashtable.cpp.
Assignee | ||
Comment 27•14 years ago
|
||
(In reply to comment #26) > Fair enough -- but then why are all those functions in an -impl.h file? They > could go in MultinameHashtable.cpp. Good question, I had my stejohns hat on and was just following the avmplusList precedent.
Comment 28•14 years ago
|
||
(In reply to comment #26) > Fair enough -- but then why are all those functions in an -impl.h file? They > could go in MultinameHashtable.cpp. There is a good reason: this allows downstream users to create additional custom instantiations more easily, without needing to edit our .cpp file: they can just #include the -impl.h file and instantiate.
Updated•13 years ago
|
Flags: flashplayer-bug+
You need to log in
before you can comment on or make changes to this bug.
Description
•