Bug 1130618: Introduce ion.gvn.enable in SetJitCompilerOptions; r=nbp

--HG--
extra : rebase_source : fccc8c74ce080f887246aca2254f9b453bcf810d
This commit is contained in:
Benjamin Bouvier 2015-02-12 11:50:51 +01:00
parent 8b314aadfe
commit 63e8c030a4
5 changed files with 24 additions and 6 deletions

View File

@ -36,7 +36,8 @@ var v = asmLink(asmCompile('global', `
assertEq(v, NaN);
// Bug 1130618
// Bug 1130618: without GVN
setJitCompilerOption("ion.gvn.enable", 0);
var v = asmLink(asmCompile('global', `
"use asm";
var float32x4 = global.SIMD.float32x4;

View File

@ -168,6 +168,12 @@ JitOptions::isSmallFunction(JSScript *script) const
return script->length() <= smallFunctionMaxBytecodeLength_;
}
void
JitOptions::enableGvn(bool enable)
{
disableGvn = !enable;
}
void
JitOptions::setEagerCompilation()
{

View File

@ -72,6 +72,7 @@ struct JitOptions
void setEagerCompilation();
void setCompilerWarmUpThreshold(uint32_t warmUpThreshold);
void resetCompilerWarmUpThreshold();
void enableGvn(bool val);
};
extern JitOptions js_JitOptions;

View File

@ -5470,6 +5470,15 @@ JS_SetGlobalJitCompilerOption(JSRuntime *rt, JSJitCompilerOption opt, uint32_t v
if (value == 0)
jit::js_JitOptions.setEagerCompilation();
break;
case JSJITCOMPILER_ION_GVN_ENABLE:
if (value == 0) {
jit::js_JitOptions.enableGvn(false);
JitSpew(js::jit::JitSpew_IonScripts, "Disable ion's GVN");
} else {
jit::js_JitOptions.enableGvn(true);
JitSpew(js::jit::JitSpew_IonScripts, "Enable ion's GVN");
}
break;
case JSJITCOMPILER_ION_ENABLE:
if (value == 1) {
JS::RuntimeOptionsRef(rt).setIon(true);

View File

@ -4760,11 +4760,12 @@ JS_SetParallelParsingEnabled(JSRuntime *rt, bool enabled);
extern JS_PUBLIC_API(void)
JS_SetOffthreadIonCompilationEnabled(JSRuntime *rt, bool enabled);
#define JIT_COMPILER_OPTIONS(Register) \
Register(BASELINE_WARMUP_TRIGGER, "baseline.warmup.trigger") \
Register(ION_WARMUP_TRIGGER, "ion.warmup.trigger") \
Register(ION_ENABLE, "ion.enable") \
Register(BASELINE_ENABLE, "baseline.enable") \
#define JIT_COMPILER_OPTIONS(Register) \
Register(BASELINE_WARMUP_TRIGGER, "baseline.warmup.trigger") \
Register(ION_WARMUP_TRIGGER, "ion.warmup.trigger") \
Register(ION_GVN_ENABLE, "ion.gvn.enable") \
Register(ION_ENABLE, "ion.enable") \
Register(BASELINE_ENABLE, "baseline.enable") \
Register(OFFTHREAD_COMPILATION_ENABLE, "offthread-compilation.enable") \
Register(SIGNALS_ENABLE, "signals.enable")