Bug 880917 - Remove AutoVersionAPI. r=luke

This doesn't do anything anymore. The compile options should generally carry
the right version through, with the exception of eval, which will end up using
the version of the running script anyway.
This commit is contained in:
Bobby Holley 2013-06-29 09:11:20 -06:00
Родитель a7550aef7c
Коммит 1ea512c17d
1 изменённых файлов: 0 добавлений и 51 удалений

Просмотреть файл

@ -122,35 +122,6 @@ JS::detail::CallMethodIfWrapped(JSContext *cx, IsAcceptableThis test, NativeImpl
return false; return false;
} }
/*
* This class is a version-establishing barrier at the head of a VM entry or
* re-entry. It ensures that |newVersion| is the starting (default) version
* used for the runtime.
*/
class AutoVersionAPI
{
JSRuntime * const rt;
JSVersion oldDefaultVersion;
JSVersion newVersion;
public:
AutoVersionAPI(JSRuntime *rt, JSVersion newVersion)
: rt(rt),
oldDefaultVersion(rt->defaultVersion())
{
this->newVersion = newVersion;
rt->setDefaultVersion(newVersion);
}
~AutoVersionAPI() {
rt->setDefaultVersion(oldDefaultVersion);
}
/* The version that this scoped-entity establishes. */
JSVersion version() const { return newVersion; }
};
#ifdef HAVE_VA_LIST_AS_ARRAY #ifdef HAVE_VA_LIST_AS_ARRAY
#define JS_ADDRESSOF_VA_LIST(ap) ((va_list *)(ap)) #define JS_ADDRESSOF_VA_LIST(ap) ((va_list *)(ap))
#else #else
@ -5172,13 +5143,6 @@ JSScript *
JS::Compile(JSContext *cx, HandleObject obj, CompileOptions options, JS::Compile(JSContext *cx, HandleObject obj, CompileOptions options,
const jschar *chars, size_t length) const jschar *chars, size_t length)
{ {
Maybe<AutoVersionAPI> mava;
if (options.versionSet) {
mava.construct(cx->runtime(), options.version);
// AutoVersionAPI propagates some compilation flags through.
options.version = mava.ref().version();
}
JS_THREADSAFE_ASSERT(cx->compartment() != cx->runtime()->atomsCompartment); JS_THREADSAFE_ASSERT(cx->compartment() != cx->runtime()->atomsCompartment);
AssertHeapIsIdle(cx); AssertHeapIsIdle(cx);
CHECK_REQUEST(cx); CHECK_REQUEST(cx);
@ -5331,13 +5295,6 @@ JS::CompileFunction(JSContext *cx, HandleObject obj, CompileOptions options,
const char *name, unsigned nargs, const char **argnames, const char *name, unsigned nargs, const char **argnames,
const jschar *chars, size_t length) const jschar *chars, size_t length)
{ {
Maybe<AutoVersionAPI> mava;
if (options.versionSet) {
mava.construct(cx->runtime(), options.version);
// AutoVersionAPI propagates some compilation flags through.
options.version = mava.ref().version();
}
JS_THREADSAFE_ASSERT(cx->compartment() != cx->runtime()->atomsCompartment); JS_THREADSAFE_ASSERT(cx->compartment() != cx->runtime()->atomsCompartment);
AssertHeapIsIdle(cx); AssertHeapIsIdle(cx);
CHECK_REQUEST(cx); CHECK_REQUEST(cx);
@ -5513,7 +5470,6 @@ JS_ExecuteScriptVersion(JSContext *cx, JSObject *objArg, JSScript *script, jsval
JSVersion version) JSVersion version)
{ {
RootedObject obj(cx, objArg); RootedObject obj(cx, objArg);
AutoVersionAPI ava(cx->runtime(), version);
return JS_ExecuteScript(cx, obj, script, rval); return JS_ExecuteScript(cx, obj, script, rval);
} }
@ -5523,13 +5479,6 @@ extern JS_PUBLIC_API(bool)
JS::Evaluate(JSContext *cx, HandleObject obj, CompileOptions options, JS::Evaluate(JSContext *cx, HandleObject obj, CompileOptions options,
const jschar *chars, size_t length, jsval *rval) const jschar *chars, size_t length, jsval *rval)
{ {
Maybe<AutoVersionAPI> mava;
if (options.versionSet) {
mava.construct(cx->runtime(), options.version);
// AutoVersionAPI propagates some compilation flags through.
options.version = mava.ref().version();
}
JS_THREADSAFE_ASSERT(cx->compartment() != cx->runtime()->atomsCompartment); JS_THREADSAFE_ASSERT(cx->compartment() != cx->runtime()->atomsCompartment);
AssertHeapIsIdle(cx); AssertHeapIsIdle(cx);
CHECK_REQUEST(cx); CHECK_REQUEST(cx);