Closed Bug 787866 Opened 13 years ago Closed 13 years ago

Remove SharedContext::fun_

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla18

People

(Reporter: n.nethercote, Assigned: n.nethercote)

References

Details

Attachments

(3 files)

SharedContext::fun_ can be removed; it's subsumed by SharedContext::funbox_ (except when it's not, but I'll fix that case).
Part 1. This patch removes the unused |cx| parameter from ContextFlags().
Attachment #657766 - Flags: review?(luke)
There are various function-specific flags in SharedContext::cxFlags. For some of them, we assert that we're in a function context when we get/set them. But for others we don't. This patch tightens things up so that we assert for all of them.
Attachment #657767 - Flags: review?(luke)
Function-specific SharedContexts have a |fun_| and a |funbox_| field, even though FunctionBox is just a glorified wrapper of a JSFunction. This seems to be because CompileFunctionBody() doesn't provide a FunctionBox. This patch changes it so that CompileFunctionBody() does provide a FunctionBox, which allows us to remove SharedContext::fun_. One minor consequence is that we have to handle a NULL |outerpc| in newFunctionBox() and FunctionBox(). AIUI the GC rooting will be ok because FunctionBox is heap-allocated and traced by Parser::trace().
Summary: Remove unused |cx| parameter from ContextFlags(). → Remove SharedContext::fun_.
Summary: Remove SharedContext::fun_. → Remove SharedContext::fun_
Attachment #657766 - Flags: review?(luke) → review+
Attachment #657767 - Flags: review?(luke) → review+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: