Closed Bug 555982 Opened 16 years ago Closed 16 years ago

in operator speed should match operator[]

Categories

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

defect

Tracking

(Not tracked)

RESOLVED FIXED
Q3 11 - Serrano

People

(Reporter: pnkfelix, Assigned: pnkfelix)

References

Details

(Whiteboard: PACMAN)

Attachments

(7 files, 17 obsolete files)

1.22 KB, patch
Details | Diff | Splinter Review
2.36 KB, patch
stejohns
: review+
Details | Diff | Splinter Review
1.36 KB, patch
stejohns
: review+
Details | Diff | Splinter Review
1.13 KB, patch
stejohns
: review+
Details | Diff | Splinter Review
30.50 KB, patch
lhansen
: review+
Details | Diff | Splinter Review
2.16 KB, patch
lhansen
: review+
Details | Diff | Splinter Review
978 bytes, patch
lhansen
: review+
Details | Diff | Splinter Review
The execution of the expression (n in x) is much slower than (x[n] !== undefined), even though in principle the subcomponents of the latter must be doing at least as much work as the former. I've attached a benchmark that does one million lookups via both methods, and compares their running times. The runtime for operator[] is about 100ms, while the in operator takes over 3600ms. I have been told the difference in speed is because the operator[] has received more optimization attention than the in operator. It is likely that many or all of the performance enhancements applied to operator[] are also applicable to (n in x). It might not be reasonable to require that the in operator always be faster than operator[], but I think requiring that the factor of slowdown be no more than 1.5x or 2x (rather than 36x as above) would be a good goal.
Blocks: 555010
OS: Mac OS X → All
Hardware: x86 → All
Target Milestone: --- → Future
1. Requiring a consistent bound of 2x may be over-reaching; all kinds of factors (e.g. cache effects, memory alignment) can yield differences in code speed that it would not be realistic to try to control. (I was reminded of this when I observed that the running time for operator[] went from 100ms to 200ms when I turned OFF the debugger mode). Maybe a factor of 3x or 4x would be a better formal goal. 2. The original attachment did a lookup on an large object on a million distinct indices, some present, some not. 2a. The large difference in performance looks like it depends on the particular indices being used. 2b. And also, pumping up this problem is hard because you hit the implementation limit on large objects when I tried to use a limit of 100,000,000. So I am generalizing the benchmark so that one can iterate on a fixed smaller limit.
Attachment #435897 - Attachment is obsolete: true
Generalized a bit further to distinguish between overhead introduced by a large object subject to lookup and overhead introduced by large magnitude in indices used for lookup.
Attachment #435905 - Attachment is obsolete: true
Whoops, the prior two uploads were erroneous (I attached the wrong file). Still getting my bugzilla sealegs. . .
Attachment #435908 - Attachment is obsolete: true
Generalized further to allow specification of starting points for construction and lookup ranges. Also changed output to print derivative info (like number of lookups performed according to parameters, as well as the factor relating the two lookup methods). The poorest performance is dependent on *both* having a subject object with a large number of indexed properties as well as a large variety of indices being used as the basis for the lookup. (The original benchmark happened to maximize both characteristics; I wanted to see if the issue could be isolated to one characteristic or the other.)
Attachment #435911 - Attachment is obsolete: true
Looking more carefully at the stack trace for the lookup operation made me realize that the benchmark time for operator[] is actually dominated by the cost of the generic comparisons performed by the iteration code. (Ed was warning me about this a little bit yesterday.) The iteration is not what I am interested in timing, so I added type annotations that made the comparison operators (closer to) free. Now the profile reported by Shark seems to match my expectations better about how time is distributed.
Assignee: nobody → fklockii
Whiteboard: PACMAN
Avoid allocating a Stringp on the GC heap when interning an int. Avoid allocating a Stringp on the GC heap until after we have confirmed that there is not already an entry in the intern table corresponding to the int. This code was largely derived from the body of MathUtils::canvertIntegerToStringBase10. (You can see by comparison how much of it is the result of manual inlining and partial evaluation.) This may not be as smart as other alternatives. In particular, this approach still converts the integer to a (stack-allocated) char* buffer. From what I understand of what Ed says in the comments for bug 555010, we could instead calculate the string hashcode from the int and then walk the entries in the intern table, checking against the string's index value which (according to Ed) caches the string's integer conversion. But that is a much larger change than this. Even this (simpler and semi-obviously-correct) change takes some of the pressure off of the GC for bug 555010 and 555982. (It does not help as much as you might hope; a true fix for those requires special case code for uints within the in_operator implementation.)
Attachment #437115 - Flags: review?(edwsmith)
This code adds a fast path to the Toplevel in operator, (n in x). When n is a uint and x is not a Dictionary, this patch dispatches to the ScriptObject's hasUintProperty method. After a couple false starts on this task, I decided the safest thing would be to make the code validate itself when run in debug mode; in those builds, "fast path" is a misnomer, as the fast path is actually just additional work that has been added onto the original slow path. (Or you can think about it like I do, and consider the old code to just be validating the result acquired via the fast path.) I do not know enough about Dictionary's to know if the path for that case should be modified as well. (That question probably should be answered before this ticket can be closed.) I have not done thorough testing of this. Essentially I have only applied it to the two benchmarks associated with bug 555010 and bug 555982. So I do not want to assign a formal reviewer until I figure out how to run the test suite(s). But I thought I should put it up so that no one wastes effort trying out the same idea. Thus I left the review flags clear above. This patch does dramatically improve the speed of the in operator, so that it is now "only" about 10% to 20% slower than the indexed get operator[] on the cmp_in_and_lookup benchmark attached to this ticket.
(In reply to comment #7) > This patch does dramatically improve the speed of the in operator, so that it > is now "only" about 10% to 20% slower than the indexed get operator[] on the > cmp_in_and_lookup benchmark attached to this ticket. Oh, yeah: I believe the reason that the in operator is still slower for this benchmark is that operator[] is JIT'ed while in_operator is not. So I think I will now investigate the JIT.
(In reply to comment #7) > I have not done thorough testing of this. Essentially I have only applied it > to the two benchmarks associated with bug 555010 and bug 555982. So I do not > want to assign a formal reviewer until I figure out how to run the test > suite(s). Yeah, it was not ready for prime-time. The posted patch was too aggressive and broke test as3/Vector/in.as, because predict_false was yield false negatives.
Less aggressive version of fast path; passes local run of acceptance tests.
Attachment #437118 - Attachment is obsolete: true
(In reply to comment #10) > Created an attachment (id=437308) [details] > add fast path for (n in x) when n is uint and present > > Less aggressive version of fast path; passes local run of acceptance tests. The problem with this patch is that it will not resolve bug 555010, because when n is not present in x then it goes through the slow process of converting n to a string and using that for the lookup. I plan to track down how the indexed get operator[] resolves this issue.
Ah! VectorClass.cpp does not override ScriptObject::hasUintProperty(uint), even though it overrides ScriptObject::hasAtomProperty(Atom). Of course, the question is now: "should it?" It remains unclear, because hasUintProperty was not previously used to implement in_operator. The only interesting clients of the hasUintProperty method are ArrayObject::checkForSparseToDenseConversion and ArraySort::ArraySort. I have not yet grokked what purpose they are using it for, which makes me a little worried about introducing an override within VectorClass.cpp.
Eww... yeah, I'm guessing it probably should; maybe it didn't simply as an oversight (which is all-too-easy to make with our current setup). (Adding Erik Tierney, original Vector author)
Yeah, it probably was an oversight. At least I can't remember any reason why it doesn't implement hasUintProperty. It implements get/setUintProperty, so it should probably implement hasUintProperty as well.
Just noticed bug 505194 which seems partially related (at least on the topic of string interning).
(In reply to comment #12) > Ah! VectorClass.cpp does not override ScriptObject::hasUintProperty(uint), > even though it overrides ScriptObject::hasAtomProperty(Atom). Likewise, ByteArrayGlue.cpp does not override ScriptObject::hasUintProperty(uint32_t) even though it does define ByteArrayObject::hasAtomProperty(Atom). I think fixing this will make my implementation "correct". But the presence of the problem raises the question of whether the infrastructure should be doing more to prevent these inconsistencies from arising. . .
There is (or was) some bug complaining about this: generally, overriding any of the has/get/set/del options meant you probably needed to override them all, but there's no enforcement mechanism.
Hmm. regarding enforcement, what do you think about adding AvmAsserts that directly inspect the method table from within ScriptObject? e.g. something like: AvmAssert( (this->hasAtomProperty == ScriptObject::hasAtomProperty) || (this->hasUintProperty != ScriptObject::hasUintProperty) )
(In reply to comment #18) > Hmm. regarding enforcement, what do you think about adding AvmAsserts that > directly inspect the method table from within ScriptObject? > > e.g. something like: > > AvmAssert( (this->hasAtomProperty == ScriptObject::hasAtomProperty) || > (this->hasUintProperty != ScriptObject::hasUintProperty) ) Or perhaps that cannot be implemented in standard C++. Mrrrh.
(In reply to comment #19) > Or perhaps that cannot be implemented in standard C++. Mrrrh. A more robust but expensive way to check that hasUintProperty(uint32) coheres with hasAtomProperty(Atom) would be to simply call the latter before returning from the former. AvmAssert(retval == this->hasAtomProperty(core->uintToAtom(i))); Is this worth considering?
If it works, fine, but generally we want to minimize extra Debug overhead, and in this case i'd be worried about double side effects, even though hasAtomProperty should not cause side effects. minor concerns anyway. Comments in ScriptObject.h clearly stating the rules are a good enough first step, and as long as the method table inspection works on one platform, then it would be a good enough enforcer. If we do that i'd wrap it in a macro so on other platforms it gets turned off. Lastly, if a static assert would work, thats better (compile time error vs runtime error).
Comment on attachment 437115 [details] [diff] [review] Make AvmCore::internInt not allocate intermediate String object Functionally it looks fine. You should add a comment referencing which other method was inlined and specialized. And add a "todo, bug XXX: " with a short description of the ideas from comment #6. (process note: R+ with commnets means no re-review is required) This bug already argues pretty well that the patch will be a performance improvement, however since you also have #s, attaching the test case and results would further back it up. (and the test case can then be added to the microbenchmark suite).
Attachment #437115 - Flags: review?(edwsmith) → review+
oh, and prevailing style for function calls is: foo(arg, arg) with no whitespace between the name, the (, and the first arg.
(In reply to comment #21) > Comments in ScriptObject.h clearly stating the rules are a good enough first > step, and as long as the method table inspection works on one platform, then it > would be a good enough enforcer. If we do that i'd wrap it in a macro so on > other platforms it gets turned off. Lastly, if a static assert would work, > thats better (compile time error vs runtime error). I am still trying to determine whether method table introspection would be feasible. I have not read enough yet to make a solid conclusion; for example there is a GCC extension for member function pointers but I cannot tell if that extension even addresses this problem. The following article has been the most "interesting" resource I have encountered so far. http://www.codeproject.com/KB/cpp/FastDelegate.aspx
This is one half of the changes that are needed to complete a fast path (case where n is uint and absent).
This is the other half of the changes that are needed to complete a fast path (case where n is uint and absent).
Note that this patch requires the hasUintProperty overrides (see other patches).
Attachment #437308 - Attachment is obsolete: true
The plot thickens: there's a regression in 10.1 (vs 10.0) that I thought this would fix. It does not. The relevant snippet (adapted from Grant Skinner's PerformanceTest2) is: var loops:uint = 100000; var hash2:Object; function init():void { hash2 = {}; for (var i=0; i<loops; i++) { var s:String = "0"+i; // also: +"000", and +"00000000" hash2[s] = i/3; } } function objHash2():void { for (var n:String in hash2) { hash2[n] += 0.2; } } init(); objHash2(); The interesting part here being the explicit ":String" typing on "var n" in objHash2... if you remove it and inspect typeof(n), you see the "natural" type of all the keys are "number"; the presence of the type qualification is forcing a coercion from number to string each time thru the loop. The same test in a 10.0-based avmshell prints "string" for all the keys, regardless of how (or whether) "n" is typed. In sum: it seems we used to keep Strings as Strings when storing as dynamic keys, even if they were equivalent to a number; now, we eagerly convert to number.
(In reply to comment #28) > The plot thickens While this is indeed interesting, after posting I realized this is a different issue: the slowdown is in the "iterator" version of in, not the "has" version. I'll open a new bug.
Revised patch to incorporate Ed's comments. (I will post performance results to the ticket after I finish uploading the patches.)
Attachment #437115 - Attachment is obsolete: true
This is a precursor for using hasUintProperty within TopLevel::in_operator (attachment 437666 [details] [diff] [review])
Attachment #437663 - Attachment is obsolete: true
Attachment #437665 - Attachment is obsolete: true
Attached file transcript of benchmark runs (obsolete) —
A transcript of benchmarking results from various runs of cmp_in_and_lookup.abc (attachment 436004 [details]). I'll present a table summarizing the results at the end of this comment. Here are the important conclusions to draw: the hasUintProperty changes (attachment 437852 [details] [diff] [review] and attachment 437666 [details] [diff] [review]) yield a massive improvement to the performance of the in operator (has variant) when applied to uint keys. However, this does not obsolete the patch to AvmCore::internInt (attachment 437851 [details] [diff] [review]) because non-uint keys still go through the internInt path. For such keys, the AvmCore::internInt change yields a tidy improvement to both the lookup operator[] and to in operator; one can see this by examining the columns (rather than the rows) for the cases below where I made the iteration start at a significant negative number (like -5e5 or -1e6). Some benchmark results (format is Variant:Start; array and lookups cover [Start,Start+10^6]) values are lookup_dur, in_dur, and (derived) ratio between them. baseline:0 44.4 3563.0 80.25 intern:0 45.2 3329.2 73.65 hasuint:0 45.25 50.0 1.10 combined:0 44.6 50.2 1.13 baseline:-1K 72.0 3596.2 49.94 intern:-1K 71.2 3297.4 46.31 hasuint:-1K 70.2 76.8 1.09 combined:-1K 70.6 76.8 1.08 baseline:-1M 1105.2 1154.8 1.04 intern:-1M 824.2 861.4 1.05 hasuint:-1M 1098.8 1170.8 1.07 combined:1M 799.8 857.4 1.07 baseline:-500K 1136.4 8054.2 7.09 intern:-500K 990.6 7453.6 7.52 hasuint:-500K 1121.6 1149.4 1.02 combined:-500K 989.0 1021.4 1.03
I think the attached patches cover the majority of this problem. I opened bug 558327 specifically to track the task of adding JIT support for in (has) operator, which should deal with the remaining performance gap between in and the get operator[].
(In reply to comment #24) > I am still trying to determine whether method table introspection would be > feasible. I have not read enough yet to make a solid conclusion; for example > there is a GCC extension for member function pointers but I cannot tell if that > extension even addresses this problem. See also the Annotated C++ Reference Manual, Section 8.1c.
Depends on: 564167
Depends on: 558327
Priority: -- → P3
Target Milestone: Future → flash10.2
This is mainly a rebase of the earlier patch. Will be posting associated patches and performance results shortly. Assuming that review goes through, when pushing, you may want to just cut-and-paste the log message I included in the patch file.
Attachment #437852 - Attachment is obsolete: true
Attachment #451032 - Flags: review?(edwsmith)
Attachment #451032 - Flags: review?(edwsmith)
Comment on attachment 451032 [details] [diff] [review] Must^H^H^H^H Should override hasUint if overriding hasAtom (on 2nd thought, i'll wait for this morning's sandbox build to finish before requesting review.)
Attempts to avoid converting a uint nameatom into an interned string, by delegating to hasUintProperty. (That's what prompted attachment 451032 [details] [diff] [review], as discussed in earlier comments.) This is a slight cleanup of (a rebase of) the earlier patch; decided to drop debug code and follow a more C++-ish style. Will request review after sandbox build finishes.
Attachment #437666 - Attachment is obsolete: true
Made these microbenchmarks to go with the others in jsmicro/. Tried to match style of others in jsmicro/ (e.g. in terms of number of sig. fig's in output). (Lars and I discussed this a touch in #asteam.) The log message I included with the patch discusses the setup of these files a little. I'm obsoleting the earlier microbenchmark I made (the obsoleted version may still be of interest since it did some things a bit differently, but not sufficient interest to not obsolete...). I'm also obsoleting its transcript, as well as the typed-variant; that cannot be added to jsmicro/, but can (and should/will) be adapted once we have a place for AS microbenchmarks; see bug 571256. (If bug 571256 does not end up going through, the typed version of the benchmark should probably be moved over to bug 558327, since I have been unable to observe improvement due to JIT'ing the in-operator *without* adding type annotations...) In results below, avm is before I added patches for attachment 451032 [details] [diff] [review] and attachment 451033 [details] [diff] [review], and avm2 is after I added those patches. Note that it is expected that the results for the "fetch" variants should be mostly unchanged by the patches; the whole point is to speed up the "in" variants, which were grossly slower than the "fetch" variants before these patches were added. test avm avm2 %sp metric jsmicro/lookup-array-fetch-1.as 549 529 -3.6 v8 largerValuesFaster jsmicro/lookup-array-in-1.as 35 775 2114.3 v8 largerValuesFaster jsmicro/lookup-object-fetch-1.as 533 552 3.6 v8 largerValuesFaster jsmicro/lookup-object-in-1.as 37 699 1789.2 v8 largerValuesFaster
Attachment #435924 - Attachment is obsolete: true
Attachment #436004 - Attachment is obsolete: true
Attachment #437856 - Attachment is obsolete: true
sandbox attempt revealed type-typos; minor fixup.
Attachment #451032 - Attachment is obsolete: true
sandbox attempt revealed type-typos; minor fixup.
Attachment #451033 - Attachment is obsolete: true
Comment on attachment 451065 [details] [diff] [review] Must^H^H^H^H Should override hasUint if overriding hasAtom (cut/pasted from patch log) bugzilla 555982: override hasUintProperty for fast path in vectors/bytearrays. Any class that overrides hasAtomProperty should consider overriding hasUintProperty (and should at least ensure that the semantics of the two will match); otherwise the fallback code may waste time performing an integer-to-interned-string conversion.
Attachment #451065 - Flags: review?(stejohns)
Comment on attachment 451066 [details] [diff] [review] fast path for (n in x) when n is uint (cut+pasted from patch log) bugzilla 555982: add fast path for (n in x) when n is uint. This attempts to avoid converting a uint nameatom into an interned string, by delegating to hasUintProperty. (Of course one must also ensure that hasUintProperty is itself fast; see discussion on ticket.)
Attachment #451066 - Flags: review?(stejohns)
Comment on attachment 451036 [details] [diff] [review] jsmicro/ benchmarks comparing in and fetch operators. Suggested (but long) potential log entry is included in patch log; I guess the text there could also just be pasted into a comment here... or left in the to-be-obseleted patch attachment... Added Steven for feedback since I'm asking him to review the patches to avm that are supposed to correct the bulk of the issues.
Attachment #451036 - Flags: review?(lhansen)
Attachment #451036 - Flags: feedback?(stejohns)
Attachment #451065 - Flags: review?(stejohns) → review+
Comment on attachment 451066 [details] [diff] [review] fast path for (n in x) when n is uint I don't see any check (or guarantee) that "obj" is non-null; do all callers guarantee this? We might be better off using AvmCore::isObject() rather than atomKind == kObjectType.
Attachment #451066 - Flags: review?(stejohns) → review-
(In reply to comment #45) > (From update of attachment 451066 [details] [diff] [review]) > I don't see any check (or guarantee) that "obj" is non-null; do all callers > guarantee this? We might be better off using AvmCore::isObject() rather than > atomKind == kObjectType. If all callers aren't guaranteeing obj is non-null, aren't we already in trouble, based on the lines below the patched area? (Which is from where I copied the logic ... bad me for copying code) Anyway, I'll look over the situation. Maybe I'll figure out how to fold the copied code together into one expression.
Bugzilla 555982: clarify different "null checks" being done. (Justifies lack of null check later in control flow of in_operator.)
Attachment #451095 - Flags: review?(stejohns)
Attachment #451095 - Flags: review?(stejohns) → review+
Comment on attachment 451066 [details] [diff] [review] fast path for (n in x) when n is uint Not really interested in spending time refactoring this further (doing CSE) right now. The conversion from Atom to ScriptObject may be cheap enough to do unconditionally, but I don't want to spend time verifying that... You see other problems? Or feel strongly about doing the CSE anyway?
Attachment #451066 - Flags: review- → review?(stejohns)
Attachment #451036 - Flags: feedback?(stejohns) → feedback+
Attachment #451066 - Flags: review?(stejohns) → review+
Comment on attachment 451065 [details] [diff] [review] Must^H^H^H^H Should override hasUint if overriding hasAtom (you had to see it coming): push me please. Feel free to copy log msg from patch.
Comment on attachment 451095 [details] [diff] [review] Improve null check comments (you had to see it coming): push me please. Feel free to copy log msg from patch.
Comment on attachment 451066 [details] [diff] [review] fast path for (n in x) when n is uint (you had to see it coming): push me please. Feel free to copy log msg from patch.
Comment on attachment 451065 [details] [diff] [review] Must^H^H^H^H Should override hasUint if overriding hasAtom Hypothesis: the getUint/_getUint division in VectorClass.h (which I replicated when I wrote hasUint/_hasUint) is in place for the benefit of the JIT, so that jit-calls.h can readily refer to the (non-virtual) _getUintProperty method. If this is true, then the only reason to keep a similar division in hasUint/_hasUint is if we want to type-specialize this operation in the JIT, the same way we specialize get/set. Further discussion of that matter more properly belongs with bug 558327.
Seems likely. IMHO keeping the symmetry may be worthwhile even if not necessary.
Comment on attachment 451036 [details] [diff] [review] jsmicro/ benchmarks comparing in and fetch operators. r+ but with a reservation: there is some evidence that global variable lookup is not very fast in Tamarin, thus using global variable bounds in the benchmark probably masks the real effect of the optimization. I'm not going to insist but I'd feel more comfortable if that layer of abstraction were removed. (Also please copy your checkin comment into the bug.)
Attachment #451036 - Flags: review?(lhansen) → review+
(In reply to comment #55) > (From update of attachment 451036 [details] [diff] [review]) > r+ but with a reservation: there is some evidence that global variable lookup > is not very fast in Tamarin, thus using global variable bounds in the benchmark > probably masks the real effect of the optimization. I'm not going to insist > but I'd feel more comfortable if that layer of abstraction were removed. Ah, interesting point. I could replace with function parameters, but I suspect you'd really prefer that I just hard-code the bounds into the loops, the same way the other microbenchmarks do. I will do that. > (Also please copy your checkin comment into the bug.) Will do.
(this should be essentially the same as the previous patch except that the global var refs in the benchmarking loop have been replaced with constants, as requested.) Bugzilla 555982: Javascript microbenchmarks for in operator. These microbenchmarks are meant to compare the performance of evaluating (N in X) versus (X[N] !== undefined); the former (files named "lookup*-in-*") should in principle be always at least as fast as the latter (files named "lookup*-fetch-*"). Since using an object X versus an array X may have different performance characteristics, I have included that as another varying dimension in the set of microbenchmarks; the former is named "lookup-object-*", the latter "lookup-array-*". I used these benchmarks to evaluate the effect of the patches I added for bugzilla 555982: here the results (avm is before the patches, avm2 is after). Note that it is expected that the results for the "fetch" variants should be mostly unchanged by the patches; the whole point is to speed up the "in" variants, which were grossly slower than the "fetch" variants before these patches were added. See the ticket for further discussion. test avm avm2 %sp metric jsmicro/lookup-array-fetch-1.as 546 544 -0.4 v8 largerValuesFaster jsmicro/lookup-array-in-1.as 35 822 2248.6 v8 largerValuesFaster jsmicro/lookup-object-fetch-1.as 599 583 -2.7 v8 largerValuesFaster jsmicro/lookup-object-in-1.as 36 744 1966.7 v8 largerValuesFaster
Attachment #451036 - Attachment is obsolete: true
Attachment #451394 - Flags: review?(lhansen)
Attachment #451394 - Flags: review?(lhansen) → review+
Comment on attachment 451394 [details] [diff] [review] jsmicro/ benchmarks comparing in and fetch operators. push please
Status: NEW → ASSIGNED
(Only remaining patch on this ticket is better off being associated with bug 564167; once that is resolved then I'll close this.)
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
(In reply to comment #60) > (Only remaining patch on this ticket is better off being associated with bug > 564167; once that is resolved then I'll close this.) Misspoke; the main problem here has been resolved and the associated fix has been pushed, so I closed the ticket. But the issue associated with bug 564167 is still worth fixing on its own, so that remains open. (Am I wrong about handling it this way? If so, please feel free to reopen, and we'll take care of the dependencies in order.)
the "casual" definition of Depends-On would lead one to beleive you can't close a bug until bugs it depends on are fixed. otherwise, whats the dependency? but, if the linkages are useful, keep them and dont worry about it. if there's no more work on this issue, fine to mark it resolved.
(In reply to comment #62) > the "casual" definition of Depends-On would lead one to beleive you can't close > a bug until bugs it depends on are fixed. otherwise, whats the dependency? > but, if the linkages are useful, keep them and dont worry about it. Part of my sloppiness came up because this is a performance bug, not a correctness one, so the whole thing gets fuzzy -- the subtasks would also improve performance of the same operation, but my investigations so far have led me to think that the performance impact of the other bugs won't matter as much now. But you convinced me; I will change the depends-on to see-also's; that way it should be clearer that the issues are related, but the main problem (the absurd performance difference between the two variants) has been resolved.
No longer depends on: 558327
See Also: → 558327
No longer depends on: 564167
See Also: → 564167
(In reply to comment #63) > I will change the depends-on to see-also's (Note that both of the referenced bugs already have back-pointers to this one in their description; otherwise changing from depends-on to see-also's would have risked losing some useful arcs between tickets...)
Assuming this passes review, please push as well.
Attachment #453130 - Flags: review?(lhansen)
assuming this passes review, please push.
Attachment #453145 - Flags: review?(lhansen)
Attachment #453130 - Flags: review?(lhansen) → review+
Attachment #453145 - Flags: review?(lhansen) → review+
tamarin-redux: changeset: 4867:1110901bc264 changeset: 4866:739fbd5c4fc7
(In reply to comment #35) > (In reply to comment #24) > > I am still trying to determine whether method table introspection would be > > feasible. I have not read enough yet to make a solid conclusion; for example > > there is a GCC extension for member function pointers but I cannot tell if that > > extension even addresses this problem. > > See also the Annotated C++ Reference Manual, Section 8.1c. (Note that in that book, section 8.1c comes after section 8.4. Wacky wacky!) Of course the ARM dates from 1990. I just bought the ANSI 2003 spec; I'll skim through that and see if there's anything interesting there.
A helpful link I saw in discussion between Ed and Krzysztof: http://www.codesourcery.com/public/cxx-abi/abi.html#member-pointers That plus some union { ... } magic may be enough to get the desired effect here.
(In reply to comment #69) > A helpful link I saw in discussion between Ed and Krzysztof: > > http://www.codesourcery.com/public/cxx-abi/abi.html#member-pointers > > That plus some union { ... } magic may be enough to get the desired effect > here. Ed made checking code based on the above in bug 575848; see attachment 455262 [details] [diff] [review]
(In reply to comment #24) > (In reply to comment #21) > > Comments in ScriptObject.h clearly stating the rules are a good enough first > > step, and as long as the method table inspection works on one platform, then it > > would be a good enough enforcer. If we do that i'd wrap it in a macro so on > > other platforms it gets turned off. Lastly, if a static assert would work, > > thats better (compile time error vs runtime error). > > I am still trying to determine whether method table introspection would be > feasible. I have not read enough yet to make a solid conclusion; for example > there is a GCC extension for member function pointers but I cannot tell if that > extension even addresses this problem. > > The following article has been the most "interesting" resource I have > encountered so far. > > http://www.codeproject.com/KB/cpp/FastDelegate.aspx Dehydra is apparently well suited for exactly the task of detecting violations of the above rule. http://blog.mozilla.com/tglek/2009/09/18/enforcing-inheritance-rules/ (more on Dehydra here: http://blog.mozilla.com/tglek/category/dehydra/ )
Flags: flashplayer-bug+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: