Bug 704369: Factor EmitTree to avoid recursion limit. (r=Waldo)

This commit is contained in:
Chris Leary 2011-12-06 10:50:23 -08:00
parent 24850ce76d
commit 718eefc6c5
2 changed files with 1175 additions and 1050 deletions

File diff suppressed because it is too large Load Diff

View File

@ -118,10 +118,34 @@ class AutoNamespaceArray : protected AutoGCRooter {
JSXMLArray<JSObject> array;
};
template <typename T>
class AutoPtr
{
JSContext *cx;
T *value;
AutoPtr(const AutoPtr &other) MOZ_DELETE;
public:
explicit AutoPtr(JSContext *cx) : cx(cx), value(NULL) {}
~AutoPtr() {
cx->delete_<T>(value);
}
void operator=(T *ptr) { value = ptr; }
typedef void ***** ConvertibleToBool;
operator ConvertibleToBool() const { return (ConvertibleToBool) value; }
const T *operator->() const { return value; }
T *operator->() { return value; }
T *get() { return value; }
};
#ifdef DEBUG
class CompartmentChecker
{
private:
JSContext *context;
JSCompartment *compartment;