Bug 705356 - Remove JSOPTION_JIT and JSOPTION_PROFILING. r=dvander

This commit is contained in:
Ryan VanderMeulen 2011-11-28 14:57:31 -08:00
parent c86ca0cbd3
commit c99172b952
19 changed files with 42 additions and 98 deletions

View File

@ -311,7 +311,7 @@ nsInProcessTabChildGlobal::InitTabChildGlobal()
JS_SetNativeStackQuota(cx, 128 * sizeof(size_t) * 1024);
JS_SetOptions(cx, JS_GetOptions(cx) | JSOPTION_JIT | JSOPTION_PRIVATE_IS_NSISUPPORTS);
JS_SetOptions(cx, JS_GetOptions(cx) | JSOPTION_PRIVATE_IS_NSISUPPORTS);
JS_SetVersion(cx, JSVERSION_LATEST);
JS_SetErrorReporter(cx, ContentScriptErrorReporter);

View File

@ -929,8 +929,6 @@ static const char js_zeal_compartment_str[] = JS_OPTIONS_DOT_STR "gczeal.compa
#endif
static const char js_methodjit_content_str[] = JS_OPTIONS_DOT_STR "methodjit.content";
static const char js_methodjit_chrome_str[] = JS_OPTIONS_DOT_STR "methodjit.chrome";
static const char js_profiling_content_str[] = JS_OPTIONS_DOT_STR "jitprofiling.content";
static const char js_profiling_chrome_str[] = JS_OPTIONS_DOT_STR "jitprofiling.chrome";
static const char js_methodjit_always_str[] = JS_OPTIONS_DOT_STR "methodjit_always";
static const char js_typeinfer_str[] = JS_OPTIONS_DOT_STR "typeinference";
static const char js_pccounts_content_str[] = JS_OPTIONS_DOT_STR "pccounts.content";
@ -961,9 +959,6 @@ nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
bool useMethodJIT = Preferences::GetBool(chromeWindow ?
js_methodjit_chrome_str :
js_methodjit_content_str);
bool useProfiling = Preferences::GetBool(chromeWindow ?
js_profiling_chrome_str :
js_profiling_content_str);
bool usePCCounts = Preferences::GetBool(chromeWindow ?
js_pccounts_chrome_str :
js_pccounts_content_str);
@ -976,7 +971,6 @@ nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
xr->GetInSafeMode(&safeMode);
if (safeMode) {
useMethodJIT = false;
useProfiling = false;
usePCCounts = false;
useTypeInference = false;
useMethodJITAlways = true;
@ -989,11 +983,6 @@ nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
else
newDefaultJSOptions &= ~JSOPTION_METHODJIT;
if (useProfiling)
newDefaultJSOptions |= JSOPTION_PROFILING;
else
newDefaultJSOptions &= ~JSOPTION_PROFILING;
if (usePCCounts)
newDefaultJSOptions |= JSOPTION_PCCOUNT;
else

View File

@ -915,7 +915,7 @@ TabChild::InitTabChildGlobal()
JS_SetNativeStackQuota(cx, 128 * sizeof(size_t) * 1024);
JS_SetOptions(cx, JS_GetOptions(cx) | JSOPTION_JIT | JSOPTION_PRIVATE_IS_NSISUPPORTS);
JS_SetOptions(cx, JS_GetOptions(cx) | JSOPTION_PRIVATE_IS_NSISUPPORTS);
JS_SetVersion(cx, JSVERSION_LATEST);
JS_SetErrorReporter(cx, ContentScriptErrorReporter);

View File

@ -151,7 +151,6 @@ enum {
PREF_werror,
PREF_relimit,
PREF_methodjit,
PREF_jitprofiling,
PREF_methodjit_always,
#ifdef JS_GC_ZEAL
@ -168,7 +167,6 @@ const char* gPrefsToWatch[] = {
JS_OPTIONS_DOT_STR "werror",
JS_OPTIONS_DOT_STR "relimit",
JS_OPTIONS_DOT_STR "methodjit.content",
JS_OPTIONS_DOT_STR "jitprofiling.content",
JS_OPTIONS_DOT_STR "methodjit_always"
#ifdef JS_GC_ZEAL
@ -202,9 +200,6 @@ PrefCallback(const char* aPrefName, void* aClosure)
if (Preferences::GetBool(gPrefsToWatch[PREF_methodjit])) {
newOptions |= JSOPTION_METHODJIT;
}
if (Preferences::GetBool(gPrefsToWatch[PREF_jitprofiling])) {
newOptions |= JSOPTION_PROFILING;
}
if (Preferences::GetBool(gPrefsToWatch[PREF_methodjit_always])) {
newOptions |= JSOPTION_METHODJIT_ALWAYS;
}

View File

@ -130,8 +130,7 @@ JetpackChild::Init(base::ProcessHandle aParentProcessHandle,
JS_SetVersion(mCx, JSVERSION_LATEST);
JS_SetOptions(mCx, JS_GetOptions(mCx) |
JSOPTION_DONT_REPORT_UNCAUGHT |
JSOPTION_ATLINE |
JSOPTION_JIT);
JSOPTION_ATLINE);
JS_SetErrorReporter(mCx, ReportError);
{

View File

@ -261,7 +261,6 @@ BEGIN_TEST(testDebugger_singleStepThrow)
uint32 opts = JS_GetOptions(cx);
opts |= JSOPTION_METHODJIT | JSOPTION_METHODJIT_ALWAYS;
opts &= ~JSOPTION_JIT;
JS_SetOptions(cx, opts);
CHECK(JS_DefineFunction(cx, global, "setStepMode", setStepMode, 0, 0));

View File

@ -118,24 +118,21 @@ BEGIN_TEST(testFuncCallback_bug507012)
#endif
// Uncomment this to validate whether you're hitting all runmodes (interp,
// tjit, mjit, ...?) Unfortunately, that still doesn't cover all
// mjit, ...?) Unfortunately, that still doesn't cover all
// transitions between the various runmodes, but it's a start.
//JS_DumpAllProfiles(cx);
return true;
}
// Not strictly necessary, but part of the test attempts to check
// whether these callbacks still trigger when traced, so force
// JSOPTION_JIT just to be sure. Once the method jit and tracing jit
// are integrated, this'll probably have to change (and we'll probably
// want to test in all modes.)
// Make sure that the method jit is enabled.
// We'll probably want to test in all modes.
virtual
JSContext *createContext()
{
JSContext *cx = JSAPITest::createContext();
if (cx)
JS_SetOptions(cx, JS_GetOptions(cx) | JSOPTION_JIT | JSOPTION_METHODJIT | JSOPTION_PCCOUNT);
JS_SetOptions(cx, JS_GetOptions(cx) | JSOPTION_METHODJIT | JSOPTION_PCCOUNT);
return cx;
}

View File

@ -24,12 +24,6 @@ BEGIN_TEST(testGCOutOfMemory)
jsvalRoot root(cx);
/*
* We loop until we get out-of-memory. We have to disable the jit since it
* ignores the runtime allocation limits during execution.
*/
JS_ToggleOptions(cx, JSOPTION_JIT);
static const char source[] =
"var max = 0; (function() {"
" var array = [];"
@ -45,7 +39,6 @@ BEGIN_TEST(testGCOutOfMemory)
CHECK(!JS_IsExceptionPending(cx));
CHECK_EQUAL(errorCount, 1);
JS_GC(cx);
JS_ToggleOptions(cx, JSOPTION_JIT);
EVAL("(function() {"
" var array = [];"
" for (var i = max >> 2; i != 0;) {"

View File

@ -39,9 +39,6 @@ BEGIN_TEST(testTrap_gc)
CHECK(JSVAL_IS_OBJECT(v2));
CHECK_EQUAL(emptyTrapCallCount, 0);
// Disable JIT for debugging
JS_SetOptions(cx, JS_GetOptions(cx) & ~JSOPTION_JIT);
// Enable debug mode
CHECK(JS_SetDebugMode(cx, JS_TRUE));

View File

@ -374,7 +374,7 @@ class JSAPITest
JS_SetNativeStackQuota(cx, MAX_STACK_SIZE);
JS_SetOptions(cx, JSOPTION_VAROBJFIX | JSOPTION_JIT);
JS_SetOptions(cx, JSOPTION_VAROBJFIX);
JS_SetVersion(cx, JSVERSION_LATEST);
JS_SetErrorReporter(cx, &reportError);
return cx;

View File

@ -2157,7 +2157,7 @@ JS_StringToVersion(const char *string);
of the input string */
/* JS_BIT(10) is currently unused. */
#define JSOPTION_JIT JS_BIT(11) /* Deprecated; does nothing */
/* JS_BIT(11) is currently unused. */
#define JSOPTION_NO_SCRIPT_RVAL JS_BIT(12) /* A promise to the compiler
that a null rval out-param
@ -2170,7 +2170,9 @@ JS_StringToVersion(const char *string);
embedding. */
#define JSOPTION_METHODJIT JS_BIT(14) /* Whole-method JIT. */
#define JSOPTION_PROFILING JS_BIT(15) /* Profiler to make tracer/methodjit choices. */
/* JS_BIT(15) is currently unused. */
#define JSOPTION_METHODJIT_ALWAYS \
JS_BIT(16) /* Always whole-method JIT,
don't tune at run-time. */

View File

@ -156,7 +156,6 @@ static jsdouble gTimeoutInterval = -1.0;
static volatile bool gCanceled = false;
static bool enableMethodJit = false;
static bool enableProfiling = false;
static bool enableTypeInference = false;
static bool enableDisassemblyDumps = false;
@ -613,8 +612,6 @@ static const struct JSOption {
uint32 flag;
} js_options[] = {
{"atline", JSOPTION_ATLINE},
{"jitprofiling", JSOPTION_PROFILING},
{"tracejit", JSOPTION_JIT},
{"methodjit", JSOPTION_METHODJIT},
{"methodjit_always",JSOPTION_METHODJIT_ALWAYS},
{"relimit", JSOPTION_RELIMIT},
@ -5062,11 +5059,6 @@ ProcessArgs(JSContext *cx, JSObject *obj, OptionParser *op)
ParseZealArg(cx, zeal);
#endif
if (op->getBoolOption('p')) {
enableProfiling = true;
JS_ToggleOptions(cx, JSOPTION_PROFILING);
}
if (op->getBoolOption('d')) {
JS_SetRuntimeDebugMode(JS_GetRuntime(cx), true);
JS_SetDebugMode(cx, true);
@ -5322,14 +5314,10 @@ main(int argc, char **argv, char **envp)
|| !op.addMultiStringOption('e', "execute", "CODE", "Inline code to run")
|| !op.addBoolOption('i', "shell", "Enter prompt after running code")
|| !op.addBoolOption('m', "methodjit", "Enable the JaegerMonkey method JIT")
|| !op.addBoolOption('j', "tracejit", "Deprecated; does nothing")
|| !op.addBoolOption('p', "profiling", "Enable runtime profiling select JIT mode")
|| !op.addBoolOption('n', "typeinfer", "Enable type inference")
|| !op.addBoolOption('d', "debugjit", "Enable runtime debug mode for method JIT code")
|| !op.addBoolOption('a', "always-mjit",
"Do not try to run in the interpreter before "
"method jitting. Note that this has no particular effect on the "
"tracer; it still kicks in if enabled.")
"Do not try to run in the interpreter before method jitting.")
|| !op.addBoolOption('D', "dump-bytecode", "Dump bytecode with exec count for all scripts")
|| !op.addBoolOption('b', "print-timing", "Print sub-ms runtime for each file that's run")
#ifdef DEBUG

View File

@ -224,7 +224,6 @@ function optionsInit() {
xml: true,
relimit: true,
methodjit: true,
jitprofiling: true,
methodjit_always: true
};

View File

@ -649,7 +649,6 @@ function optionsClear() {
var optionName = optionNames[i];
if (optionName &&
optionName != "methodjit" &&
optionName != "jitprofiling" &&
optionName != "methodjit_always")
{
options(optionName);

View File

@ -30,8 +30,6 @@ user_pref("extensions.checkUpdateSecurity", false);
user_pref("browser.EULA.override", true);
user_pref("javascript.options.methodjit.chrome", true);
user_pref("javascript.options.methodjit.content", true);
user_pref("javascript.options.jitprofiling.chrome", true);
user_pref("javascript.options.jitprofiling.content", true);
user_pref("javascript.options.methodjit_always", false);
user_pref("javascript.options.strict", false);
user_pref("javascript.options.werror", false);

View File

@ -153,7 +153,7 @@ interface ScheduledGCCallback : nsISupports
/**
* interface of Components.utils
*/
[scriptable, uuid(11785c1f-346f-475c-950e-fe1bacce70f1)]
[scriptable, uuid(d6916b9e-0947-400f-8552-81fd96312c9d)]
interface nsIXPCComponents_Utils : nsISupports
{
@ -324,7 +324,6 @@ interface nsIXPCComponents_Utils : nsISupports
attribute boolean xml;
attribute boolean relimit;
attribute boolean methodjit;
attribute boolean jitprofiling;
attribute boolean methodjit_always;
[implicit_jscontext]
void setGCZeal(in long zeal);

View File

@ -726,7 +726,6 @@ static const struct JSOption {
uint32 flag;
} js_options[] = {
{"atline", JSOPTION_ATLINE},
{"jit", JSOPTION_JIT},
{"relimit", JSOPTION_RELIMIT},
{"strict", JSOPTION_STRICT},
{"werror", JSOPTION_WERROR},
@ -1283,15 +1282,9 @@ ProcessArgs(JSContext *cx, JSObject *obj, char **argv, int argc)
compileOnly = true;
isInteractive = false;
break;
case 'j':
JS_ToggleOptions(cx, JSOPTION_JIT);
break;
case 'm':
JS_ToggleOptions(cx, JSOPTION_METHODJIT);
break;
case 'p':
JS_ToggleOptions(cx, JSOPTION_PROFILING);
break;
case 'n':
JS_ToggleOptions(cx, JSOPTION_TYPE_INFERENCE);
break;

View File

@ -56,8 +56,8 @@
#include "nsJSUtils.h"
#include "mozJSComponentLoader.h"
#include "nsContentUtils.h"
#include "jsgc.h"
#include "jsgc.h"
using namespace js;
/***************************************************************************/
// stuff used by all
@ -3102,13 +3102,13 @@ xpc_CreateSandboxObject(JSContext * cx, jsval * vp, nsISupports *prinOrSop, JSOb
JSCompartment *compartment;
JSObject *sandbox;
nsRefPtr<Identity> identity;
if (!identityPtr) {
identity = new Identity();
identityPtr = identity;
}
rv = xpc_CreateGlobalObject(cx, &SandboxClass, principal, identityPtr,
nsRefPtr<Identity> identity;
if (!identityPtr) {
identity = new Identity();
identityPtr = identity;
}
rv = xpc_CreateGlobalObject(cx, &SandboxClass, principal, identityPtr,
wantXrays, &sandbox, &compartment);
NS_ENSURE_SUCCESS(rv, rv);
@ -3324,25 +3324,25 @@ nsXPCComponents_utils_Sandbox::CallOrConstruct(nsIXPConnectWrappedNative *wrappe
sandboxName.Adopt(tmp, strlen(tmp));
}
// see Bug 677294:
if (!JS_HasProperty(cx, optionsObject, "sameGroupAs", &found))
return NS_ERROR_INVALID_ARG;
if (found) {
if (!JS_GetProperty(cx, optionsObject, "sameGroupAs", &option) ||
JSVAL_IS_PRIMITIVE(option)) {
return ThrowAndFail(NS_ERROR_INVALID_ARG, cx, _retval);
}
void* privateValue =
JS_GetCompartmentPrivate(cx,GetObjectCompartment(JSVAL_TO_OBJECT(option)));
xpc::CompartmentPrivate *compartmentPrivate =
static_cast<xpc::CompartmentPrivate*>(privateValue);
if (!compartmentPrivate || !compartmentPrivate->key)
return ThrowAndFail(NS_ERROR_INVALID_ARG, cx, _retval);
identity = compartmentPrivate->key->GetPtr();
// see Bug 677294:
if (!JS_HasProperty(cx, optionsObject, "sameGroupAs", &found))
return NS_ERROR_INVALID_ARG;
if (found) {
if (!JS_GetProperty(cx, optionsObject, "sameGroupAs", &option) ||
JSVAL_IS_PRIMITIVE(option)) {
return ThrowAndFail(NS_ERROR_INVALID_ARG, cx, _retval);
}
void* privateValue =
JS_GetCompartmentPrivate(cx,GetObjectCompartment(JSVAL_TO_OBJECT(option)));
xpc::CompartmentPrivate *compartmentPrivate =
static_cast<xpc::CompartmentPrivate*>(privateValue);
if (!compartmentPrivate || !compartmentPrivate->key)
return ThrowAndFail(NS_ERROR_INVALID_ARG, cx, _retval);
identity = compartmentPrivate->key->GetPtr();
}
}
@ -4070,7 +4070,6 @@ GENERATE_JSOPTION_GETTER_SETTER(Atline, JSOPTION_ATLINE)
GENERATE_JSOPTION_GETTER_SETTER(Xml, JSOPTION_XML)
GENERATE_JSOPTION_GETTER_SETTER(Relimit, JSOPTION_RELIMIT)
GENERATE_JSOPTION_GETTER_SETTER(Methodjit, JSOPTION_METHODJIT)
GENERATE_JSOPTION_GETTER_SETTER(Jitprofiling, JSOPTION_PROFILING)
GENERATE_JSOPTION_GETTER_SETTER(Methodjit_always, JSOPTION_METHODJIT_ALWAYS)
#undef GENERATE_JSOPTION_GETTER_SETTER

View File

@ -628,8 +628,6 @@ pref("javascript.options.strict.debug", true);
pref("javascript.options.relimit", true);
pref("javascript.options.methodjit.content", true);
pref("javascript.options.methodjit.chrome", true);
pref("javascript.options.jitprofiling.content", true);
pref("javascript.options.jitprofiling.chrome", true);
pref("javascript.options.pccounts.content", false);
pref("javascript.options.pccounts.chrome", false);
pref("javascript.options.methodjit_always", false);