Closed
Bug 636296
Opened 14 years ago
Closed 14 years ago
simplify activation object creating/putting logic
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
People
(Reporter: luke, Assigned: luke)
References
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(5 files, 7 obsolete files)
5.65 KB,
patch
|
dvander
:
review+
|
Details | Diff | Splinter Review |
13.02 KB,
patch
|
dvander
:
review+
|
Details | Diff | Splinter Review |
31.40 KB,
patch
|
dvander
:
review+
|
Details | Diff | Splinter Review |
53.14 KB,
patch
|
Waldo
:
review+
|
Details | Diff | Splinter Review |
5.13 KB,
patch
|
dvander
:
review+
|
Details | Diff | Splinter Review |
Working on bug 635811 and bug 634542, I saw a couple ways we could simplify the logic surrounding activation object creating/putting. The patches got too big for FF4, so I had to make quick 'n dirty fixes instead, but I'd still like to finish and land the patches post 4.0. In particular:
- putting call objects when we pop the frame, not in the ScriptEpilogue (we create the call object when we push the frame, not in ScriptPrologue).
- s/fp->hasCallObj/fp->hasOwnCallObj/ so that "if (fp->hasOwnCallObj()) PutCallObject(fp->callObj())" is always correct (as opposed to now with the whole non-strict eval situation)
Assignee | ||
Comment 1•14 years ago
|
||
Assignee | ||
Comment 2•14 years ago
|
||
Assignee | ||
Comment 3•14 years ago
|
||
Assignee | ||
Comment 4•14 years ago
|
||
Assignee | ||
Comment 5•14 years ago
|
||
Passes trace tests. I won't bother anyone for reviews until after FF4.0, but I thought it would be good to leave these here.
Assignee | ||
Comment 6•14 years ago
|
||
Posting rebased patches and getting review. The first two are really simple. This patch just fixed a naming complaint Steve Fink had on infomonkey.
Attachment #514870 -
Attachment is obsolete: true
Attachment #519293 -
Flags: review?(dvander)
Assignee | ||
Comment 7•14 years ago
|
||
This splits prologue/epilogue into the parts that deal with debug stuff and the parts that deal with core semantics.
Attachment #514872 -
Attachment is obsolete: true
Attachment #519294 -
Flags: review?(dvander)
Assignee | ||
Comment 8•14 years ago
|
||
This patch gives 'hasCallObj' the meaning: if a frame 'hasCallObj', then the call obj should be put when the frame is popped (thereby eliminating the eval-frame corner case).
Attachment #514873 -
Attachment is obsolete: true
Attachment #519295 -
Flags: review?(jwalden+bmo)
Assignee | ||
Updated•14 years ago
|
Attachment #519294 -
Attachment description: tidy up ScriptPrologue/Epilogue → part 2: tidy up ScriptPrologue/Epilogue
Assignee | ||
Comment 9•14 years ago
|
||
Attachment #514874 -
Attachment is obsolete: true
Attachment #519296 -
Flags: review?(dvander)
Assignee | ||
Comment 10•14 years ago
|
||
Oops, need to fix InjectJaegerReturn; will make a part 5 patch.
Assignee | ||
Comment 11•14 years ago
|
||
Actually, InjectJaegerReturn can just die; its equivalent to the forceReturnTrampoline, which works.
Attachment #519296 -
Attachment is obsolete: true
Attachment #519296 -
Flags: review?(dvander)
Attachment #519447 -
Flags: review?(dvander)
Assignee | ||
Comment 12•14 years ago
|
||
Fix bug (strict eval's call obj not getting put in initialVarObj).
With that, green on try.
Attachment #519295 -
Attachment is obsolete: true
Attachment #519295 -
Flags: review?(jwalden+bmo)
Assignee | ||
Updated•14 years ago
|
Attachment #519527 -
Flags: review?(jwalden+bmo)
Updated•14 years ago
|
Attachment #519293 -
Flags: review?(dvander) → review+
Updated•14 years ago
|
Attachment #519294 -
Flags: review?(dvander) → review+
Comment on attachment 519447 [details] [diff] [review]
part 4: put activation objects when the frame is popped, not ScriptEpilogue
Nice, this is much simpler. One nit, markActivationObjectsAsHavingBeenPut is kind of verbose. How about markActivationObjectsAsPut?
Attachment #519447 -
Flags: review?(dvander) → review+
Assignee | ||
Comment 14•14 years ago
|
||
Oh, hah, yeah, that is much preferable.
Comment 15•14 years ago
|
||
Comment on attachment 519527 [details] [diff] [review]
part 3: simplify meaning of hasCallObj
You have one "NB." which more typically is "NB:". Other than that, much awesomeness to behold.
Attachment #519527 -
Flags: review?(jwalden+bmo) → review+
Assignee | ||
Comment 16•14 years ago
|
||
http://hg.mozilla.org/tracemonkey/rev/d7c35d34c202
http://hg.mozilla.org/tracemonkey/rev/9484a9805efa
http://hg.mozilla.org/tracemonkey/rev/dbb123c798c8
http://hg.mozilla.org/tracemonkey/rev/d839300746c3
Whiteboard: fixed-in-tracemonkey
Comment 17•14 years ago
|
||
Part 4 causes crash on Win64 and Solaris x86. These platforms have to consider stack adjustment.
Comment 18•14 years ago
|
||
Attachment #521451 -
Flags: review?(luke)
Assignee | ||
Comment 19•14 years ago
|
||
Comment on attachment 521451 [details] [diff] [review]
crash fix for Win64
Could you instead factor out this hack into JaegerCompartment so that it gets fixed in one place instead of 2+ ?
Attachment #521451 -
Flags: review?(luke)
Assignee | ||
Comment 20•14 years ago
|
||
Oops, I meant to add: thank you for debugging and fixing :)
Comment 21•14 years ago
|
||
(In reply to comment #19)
> Comment on attachment 521451 [details] [diff] [review]
> crash fix for Win64
>
> Could you instead factor out this hack into JaegerCompartment so that it gets
> fixed in one place instead of 2+ ?
PushActiveVMFrame set return function to JaegerTrampolineReturn. JaegerTrampolineReturn adjusts stack for non-FASTCALL ABI and Win64 ABIT. This point needs restore stack.
Assignee | ||
Comment 22•14 years ago
|
||
I was referring to the duplication in stubs::Debugger and stubs::Trap.
Comment 23•14 years ago
|
||
(In reply to comment #22)
> I was referring to the duplication in stubs::Debugger and stubs::Trap.
It is necessary to add stack adjustment excepting to js_InternalThrow().
After my fix, it passes test even if on Win64 build.
Assignee | ||
Comment 24•14 years ago
|
||
I'm sorry, I was not communicating my intentions clearly. Here is something like what I was asking for.
Attachment #521451 -
Attachment is obsolete: true
Attachment #522395 -
Flags: review?
Assignee | ||
Updated•14 years ago
|
Attachment #522395 -
Flags: review? → review?(dvander)
Comment 25•14 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/d7c35d34c202
http://hg.mozilla.org/mozilla-central/rev/9484a9805efa
http://hg.mozilla.org/mozilla-central/rev/dbb123c798c8
http://hg.mozilla.org/mozilla-central/rev/d839300746c3
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Updated•14 years ago
|
Attachment #522395 -
Flags: review?(dvander) → review+
Assignee | ||
Comment 26•14 years ago
|
||
Comment 28•13 years ago
|
||
I'm tracking a TenFourFox bug that seems to have been triggered by part 4. In our bug, the browser hiccoughs (and sometimes crashes) trying to malloc a ridiculously large amount of memory. Analysis shows that the actual failure is in NewArguments() being passed a huge argc, which multiplied by sizeof(Value) yields a huge number, and the argc is coming from args.nactual, which appears to be getting much less frequently updated as a result of that part. Our wallpaper patch is this very simple kludge,
diff --git a/js/src/jsinterpinlines.h b/js/src/jsinterpinlines.h
--- a/js/src/jsinterpinlines.h
+++ b/js/src/jsinterpinlines.h
@@ -393,17 +393,23 @@ JSStackFrame::varobj(JSContext *cx) cons
return isFunctionFrame() ? callObj() : cx->activeSegment()->getInitialVarObj();
}
inline uintN
JSStackFrame::numActualArgs() const
{
JS_ASSERT(hasArgs());
if (JS_UNLIKELY(flags_ & (JSFRAME_OVERFLOW_ARGS | JSFRAME_UNDERFLOW_ARGS)))
+#if(0)
return hasArgsObj() ? argsObj().getArgsInitialLength() : args.nactual;
+#else
+ return hasArgsObj() ? argsObj().getArgsInitialLength() :
+ (args.nactual < 1024*1024) ? args.nactual :
+ numFormalArgs();
+#endif
return numFormalArgs();
}
inline js::Value *
JSStackFrame::actualArgs() const
{
JS_ASSERT(hasArgs());
js::Value *argv = formalArgs();
which repairs the problem. But I'm trying to figure out where it came from in the first place. Is this the right thing to do? The dynamics may be different for us because we're pure tracejit and have no methodjit yet.
4.0 didn't do this.
Assignee | ||
Comment 29•13 years ago
|
||
Cameron: is there a reproducible test-case for this hiccough/crash? (Also, if its not too much trouble, could you file a new bug instead of extending this one and CC me?)
Comment 30•13 years ago
|
||
Done (bug 663789). Thanks, Luke!
You need to log in
before you can comment on or make changes to this bug.
Description
•