Build the JIT by default if we're on x86, and control enabling it for content

via javascript.options.content_jit.
This commit is contained in:
shaver@mozilla.org 2008-07-10 23:05:27 -04:00
Родитель 3a894689a8
Коммит 7b70cff612
2 изменённых файлов: 38 добавлений и 14 удалений

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

@ -1084,6 +1084,7 @@ static const char js_relimit_option_str[]= JS_OPTIONS_DOT_STR "relimit";
#ifdef JS_GC_ZEAL
static const char js_zeal_option_str[] = JS_OPTIONS_DOT_STR "gczeal";
#endif
static const char js_content_jit_str[] = JS_OPTIONS_DOT_STR "content_jit";
int PR_CALLBACK
nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
@ -1098,13 +1099,21 @@ nsJSContext::JSOptionChangedCallback(const char *pref, void *data)
else
newDefaultJSOptions &= ~JSOPTION_STRICT;
nsIScriptGlobalObject *global = context->GetGlobalObject();
nsCOMPtr<nsIDOMChromeWindow> chromeWindow(do_QueryInterface(global));
if (!chromeWindow) {
PRBool contentJIT = nsContentUtils::GetBoolPref(js_content_jit_str);
if (contentJIT)
newDefaultJSOptions |= JSOPTION_JIT;
else
newDefaultJSOptions &= ~JSOPTION_JIT;
}
#ifdef DEBUG
// In debug builds, warnings are always enabled in chrome context
// Note this callback is also called from context's InitClasses thus we don't
// need to enable this directly from InitContext
if ((newDefaultJSOptions & JSOPTION_STRICT) == 0) {
nsIScriptGlobalObject *global = context->GetGlobalObject();
nsCOMPtr<nsIDOMChromeWindow> chromeWindow(do_QueryInterface(global));
if (chromeWindow)
newDefaultJSOptions |= JSOPTION_STRICT;
}

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

@ -87,6 +87,16 @@ ifndef JS_STATIC_BUILD
FORCE_SHARED_LIB = 1
endif
ifeq (86,$(findstring 86,$(OS_TEST)))
DEFINES += -DAVMPLUS_IA32
NANOJIT_ARCH = i386
ENABLE_JIT = 1
endif
ifeq ($(OS_ARCH),Linux)
DEFINES += -DAVMPLUS_LINUX -DLINUX
endif
CPPSRCS = \
jsapi.cpp \
jsarena.cpp \
@ -120,17 +130,10 @@ CPPSRCS = \
jsscope.cpp \
jsscript.cpp \
jsstr.cpp \
jstracer.cpp \
jsutil.cpp \
jsxdrapi.cpp \
jsxml.cpp \
prmjtime.cpp \
nanojit/Assembler.cpp \
nanojit/Fragmento.cpp \
nanojit/LIR.cpp \
nanojit/RegAlloc.cpp \
nanojit/avmplus.cpp \
jsbuiltins.cpp \
$(NULL)
ifdef HAVE_DTRACE
@ -188,27 +191,39 @@ EXPORTS = \
jsutil.h \
jsxdrapi.h \
jsxml.h \
$(NULL)
ifdef ENABLE_JIT
EXPORTS += \
nanojit/Assembler.h \
nanojit/LIR.h \
nanojit/avmplus.h \
nanojit/vm_fops.h \
nanojit/Fragmento.h \
nanojit/Native.h \
nanojit/Native$(NANOJIT_ARCH).h \
nanojit/RegAlloc.h \
nanojit/nanojit.h \
builtins.tbl \
$(NULL)
CPPSRCS += \
jstracer.cpp \
nanojit/Assembler.cpp \
nanojit/Fragmento.cpp \
nanojit/LIR.cpp \
nanojit/RegAlloc.cpp \
nanojit/avmplus.cpp \
nanojit/Native$(NANOJIT_ARCH).cpp \
jsbuiltins.cpp \
$(NULL)
ifdef DEBUG
EXPORTS += nanojit/TraceTreeDrawer.h
CPPSRCS += nanojit/TraceTreeDrawer.cpp nanojit/Tests.cpp
endif
DEFINES += -DFEATURE_NANOJIT
ifeq (86,$(findstring 86,$(OS_TEST)))
DEFINES += -DAVMPLUS_IA32
CPPSRCS += nanojit/Nativei386.cpp
EXPORTS += nanojit/Nativei386.h
DEFINES += -DFEATURE_NANOJIT -DJS_TRACER
endif
ifdef HAVE_DTRACE