mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-03-09 04:25:38 +00:00
Bug 928507: Properly hide JS::Handle's assignment operator; add 'repoint' method to deal with the fallout; fix C1Spewer, IonSpewer, and CompileOptions. r=terrence
This commit is contained in:
parent
ab08cf6060
commit
53a9ab4dc3
@ -455,13 +455,16 @@ class MOZ_NONHEAP_CLASS Handle : public js::HandleBase<T>
|
||||
bool operator!=(const T &other) const { return *ptr != other; }
|
||||
bool operator==(const T &other) const { return *ptr == other; }
|
||||
|
||||
/* Change this handle to point to the same rooted location RHS does. */
|
||||
void repoint(const Handle &rhs) { ptr = rhs.address(); }
|
||||
|
||||
private:
|
||||
Handle() {}
|
||||
|
||||
const T *ptr;
|
||||
|
||||
template <typename S>
|
||||
void operator=(S v) MOZ_DELETE;
|
||||
template <typename S> void operator=(S) MOZ_DELETE;
|
||||
void operator=(Handle) MOZ_DELETE;
|
||||
};
|
||||
|
||||
/*
|
||||
|
@ -31,7 +31,7 @@ C1Spewer::beginFunction(MIRGraph *graph, HandleScript script)
|
||||
return;
|
||||
|
||||
this->graph = graph;
|
||||
this->script = script;
|
||||
this->script.repoint(script);
|
||||
|
||||
fprintf(spewout_, "begin_compilation\n");
|
||||
if (script) {
|
||||
|
@ -161,7 +161,7 @@ IonSpewer::beginFunction(MIRGraph *graph, HandleScript function)
|
||||
}
|
||||
|
||||
this->graph = graph;
|
||||
this->function = function;
|
||||
this->function.repoint(function);
|
||||
|
||||
c1Spewer.beginFunction(graph, function);
|
||||
jsonSpewer.beginFunction(function);
|
||||
|
@ -4466,7 +4466,7 @@ JS::Compile(JSContext *cx, HandleObject obj, CompileOptions options, const char
|
||||
AutoFile file;
|
||||
if (!file.open(cx, filename))
|
||||
return nullptr;
|
||||
options = options.setFileAndLine(filename, 1);
|
||||
options.setFileAndLine(filename, 1);
|
||||
JSScript *script = Compile(cx, obj, options, file.fp());
|
||||
return script;
|
||||
}
|
||||
|
@ -3469,7 +3469,7 @@ class JS_PUBLIC_API(CompileOptions)
|
||||
}
|
||||
CompileOptions &setSourceMapURL(const jschar *s) { sourceMapURL = s; return *this; }
|
||||
CompileOptions &setColumn(unsigned c) { column = c; return *this; }
|
||||
CompileOptions &setElement(Handle<JSObject*> e) { element = e; return *this; }
|
||||
CompileOptions &setElement(Handle<JSObject*> e) { element.repoint(e); return *this; }
|
||||
CompileOptions &setCompileAndGo(bool cng) { compileAndGo = cng; return *this; }
|
||||
CompileOptions &setForEval(bool eval) { forEval = eval; return *this; }
|
||||
CompileOptions &setNoScriptRval(bool nsr) { noScriptRval = nsr; return *this; }
|
||||
|
Loading…
x
Reference in New Issue
Block a user