Closed Bug 930378 Opened 11 years ago Closed 11 years ago

Improve rooting in Debugger

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: sfink, Assigned: sfink)

References

Details

(Whiteboard: [qa-])

Attachments

(2 files)

Attached patch Debugger rootingSplinter Review
I just don't like AutoValueArray.
Comment on attachment 821467 [details] [diff] [review]
Debugger rooting

This fixes one actual bug (an AutoValueArray address was passed into something that GC'd before the element was initialized, so a bogus Value was marked, which failed an assertion.) It also switches to more straightforward rooting. The renaming from argv -> specificName is arguable, since its address ends up being passed into Invoke as a 1-element array. Tell me if you no like.
Attachment #821467 - Flags: review?(jimb)
(In reply to Steve Fink [:sfink] from comment #1)
> Comment on attachment 821467 [details] [diff] [review]
> Debugger rooting
> 
> This fixes one actual bug (an AutoValueArray address was passed into
> something that GC'd before the element was initialized, so a bogus Value was
> marked, which failed an assertion.)

Er... actually, the part about the address being passed in is irrelevant. The problem was really just GCing with an uninitialized AutoValueArray on the stack.
Blocks: ExactRooting
I don't know whether this is better or worse, so I'll put it up for review and let you decide. (And yes, I'm abusing an unrelated bug to hang this off of. Sue me. bzexport is busted due to a bmo change. Bug/patch manipulation is painful.)
Assignee: nobody → sphink
Status: NEW → ASSIGNED
Attachment #821470 - Flags: review?(jimb)
Attachment #821467 - Attachment is patch: true
Attachment #821470 - Flags: review?(jimb) → review+
Comment on attachment 821467 [details] [diff] [review]
Debugger rooting

Review of attachment 821467 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks very much for looking at these. All these changes look like good cleanups to me, except for the one I note below.

There are a few cases (ApplyOrCall's argument list wrapping, for example) that seem to go out of their way to not do the obvious thing. I wish I knew why; but let's go with your changes.

::: js/src/vm/Debugger.cpp
@@ +964,5 @@
>  
>      Maybe<AutoCompartment> ac;
>      ac.construct(cx, object);
>  
> +    AutoValueVector argv(cx);

Can't we just use AutoValueArray, and initialize the slot? It seems excessive to use a dynamically allocated type when we need exactly two slots.
Attachment #821467 - Flags: review?(jimb) → review+
https://hg.mozilla.org/mozilla-central/rev/12eb8c273f9b
https://hg.mozilla.org/mozilla-central/rev/0de56f72315e
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla28
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: