RPM Package Manager, CVS Repository http://rpm5.org/cvs/ ____________________________________________________________________________
Server: rpm5.org Name: Jeff Johnson Root: /v/rpm/cvs Email: j...@rpm5.org Module: rpm Date: 09-Jul-2017 18:11:12 Branch: rpm-5_4 Handle: 2017070916111200 Modified files: (Branch: rpm-5_4) rpm/js Makefile.am rpmjs45.cpp rpm/rpmio rpmjss.h Log: - rpmjs45: start switching to POPT arg processing. Summary: Revision Changes Path 1.44.2.16 +11 -80 rpm/js/Makefile.am 1.1.2.7 +587 -58 rpm/js/rpmjs45.cpp 1.1.2.4 +37 -19 rpm/rpmio/rpmjss.h ____________________________________________________________________________ patch -p0 <<'@@ .' Index: rpm/js/Makefile.am ============================================================================ $ cvs diff -u -r1.44.2.15 -r1.44.2.16 Makefile.am --- rpm/js/Makefile.am 8 Jul 2017 11:29:09 -0000 1.44.2.15 +++ rpm/js/Makefile.am 9 Jul 2017 16:11:12 -0000 1.44.2.16 @@ -6,6 +6,8 @@ LINT = splint +SUBDIS = src . + EXTRA_DIST = \ rpmjs45.cpp \ rpmjs52.cpp @@ -89,7 +91,9 @@ noinst_PROGRAMS = tjs moz_srcdir = ${srcdir}/mozilla-release/js/src -moz_builddir = ${builddir}/platform/x86_64/linux/build +#moz_builddir = ${builddir}/platform/x86_64/linux/build +moz_builddir = ${builddir}/src + # mozilla-release/memory/build/mozmemory_wrap.c \ # mozilla-release/mozglue/misc/TimeStamp.cpp \ # mozilla-release/mozglue/misc/TimeStamp_posix.cpp \ @@ -108,85 +112,12 @@ # ${moz_srcdir}/perf/pm_linux.cpp \ # ${moz_srcdir}/vm/Initialization.cpp \ # ${moz_srcdir}/vm/TraceLogging.cpp \ -# ${moz_srcdir}/vm/TraceLoggingGraph.cpp \ -# ${moz_builddir}/Unified_cpp_js_src0.cpp \ -# ${moz_builddir}/Unified_cpp_js_src1.cpp \ -# ${moz_builddir}/Unified_cpp_js_src2.cpp \ -# ${moz_builddir}/Unified_cpp_js_src3.cpp \ -# ${moz_builddir}/Unified_cpp_js_src4.cpp \ -# ${moz_builddir}/Unified_cpp_js_src5.cpp \ -# ${moz_builddir}/Unified_cpp_js_src6.cpp \ -# ${moz_builddir}/Unified_cpp_js_src7.cpp \ -# ${moz_builddir}/Unified_cpp_js_src8.cpp \ -# ${moz_builddir}/Unified_cpp_js_src9.cpp \ -# ${moz_builddir}/Unified_cpp_js_src10.cpp \ -# ${moz_builddir}/Unified_cpp_js_src11.cpp \ -# ${moz_builddir}/Unified_cpp_js_src12.cpp \ -# ${moz_builddir}/Unified_cpp_js_src13.cpp \ -# ${moz_builddir}/Unified_cpp_js_src14.cpp \ -# ${moz_builddir}/Unified_cpp_js_src15.cpp \ -# ${moz_builddir}/Unified_cpp_js_src16.cpp \ -# ${moz_builddir}/Unified_cpp_js_src17.cpp \ -# ${moz_builddir}/Unified_cpp_js_src18.cpp \ -# ${moz_builddir}/Unified_cpp_js_src19.cpp \ -# ${moz_builddir}/Unified_cpp_js_src20.cpp \ -# ${moz_builddir}/Unified_cpp_js_src21.cpp \ -# ${moz_builddir}/Unified_cpp_js_src22.cpp \ -# ${moz_builddir}/Unified_cpp_js_src23.cpp \ -# ${moz_builddir}/Unified_cpp_js_src24.cpp \ -# ${moz_builddir}/Unified_cpp_js_src25.cpp \ -# ${moz_builddir}/Unified_cpp_js_src26.cpp \ -# ${moz_builddir}/Unified_cpp_js_src27.cpp \ -# ${moz_builddir}/Unified_cpp_js_src28.cpp \ -# ${moz_builddir}/Unified_cpp_js_src29.cpp \ -# ${moz_builddir}/Unified_cpp_js_src30.cpp \ -# ${moz_builddir}/Unified_cpp_js_src31.cpp \ -# ${moz_builddir}/Unified_cpp_js_src32.cpp \ -# ${moz_builddir}/Unified_cpp_js_src33.cpp \ -# ${moz_builddir}/Unified_cpp_js_src34.cpp \ -# ${moz_builddir}/Unified_cpp_js_src35.cpp \ -# ${moz_builddir}/Unified_cpp_js_src36.cpp +# ${moz_srcdir}/vm/TraceLoggingGraph.cpp rpmjs45_SOURCES = \ - ${moz_builddir}/Unified_cpp_js_src0.cpp \ - ${moz_builddir}/Unified_cpp_js_src1.cpp \ - ${moz_builddir}/Unified_cpp_js_src2.cpp \ - ${moz_builddir}/Unified_cpp_js_src3.cpp \ - ${moz_builddir}/Unified_cpp_js_src4.cpp \ - ${moz_builddir}/Unified_cpp_js_src5.cpp \ - ${moz_builddir}/Unified_cpp_js_src6.cpp \ - ${moz_builddir}/Unified_cpp_js_src7.cpp \ - ${moz_builddir}/Unified_cpp_js_src8.cpp \ - ${moz_builddir}/Unified_cpp_js_src9.cpp \ - ${moz_builddir}/Unified_cpp_js_src10.cpp \ - ${moz_builddir}/Unified_cpp_js_src11.cpp \ - ${moz_builddir}/Unified_cpp_js_src12.cpp \ - ${moz_builddir}/Unified_cpp_js_src13.cpp \ - ${moz_builddir}/Unified_cpp_js_src14.cpp \ - ${moz_builddir}/Unified_cpp_js_src15.cpp \ - ${moz_builddir}/Unified_cpp_js_src16.cpp \ - ${moz_builddir}/Unified_cpp_js_src17.cpp \ - ${moz_builddir}/Unified_cpp_js_src18.cpp \ - ${moz_builddir}/Unified_cpp_js_src19.cpp \ - ${moz_builddir}/Unified_cpp_js_src20.cpp \ - ${moz_builddir}/Unified_cpp_js_src21.cpp \ - ${moz_builddir}/Unified_cpp_js_src22.cpp \ - ${moz_builddir}/Unified_cpp_js_src23.cpp \ - ${moz_builddir}/Unified_cpp_js_src24.cpp \ - ${moz_builddir}/Unified_cpp_js_src25.cpp \ - ${moz_builddir}/Unified_cpp_js_src26.cpp \ - ${moz_builddir}/Unified_cpp_js_src27.cpp \ - ${moz_builddir}/Unified_cpp_js_src28.cpp \ - ${moz_builddir}/Unified_cpp_js_src29.cpp \ - ${moz_builddir}/Unified_cpp_js_src30.cpp \ - ${moz_builddir}/Unified_cpp_js_src31.cpp \ - ${moz_builddir}/Unified_cpp_js_src32.cpp \ - ${moz_builddir}/Unified_cpp_js_src33.cpp \ - ${moz_builddir}/Unified_cpp_js_src34.cpp \ - ${moz_builddir}/Unified_cpp_js_src35.cpp \ - ${moz_builddir}/Unified_cpp_js_src36.cpp \ rpmjs45shim.cpp \ - ${moz_builddir}/shell/Unified_cpp_js_src_shell0.cpp + rpmjs45.cpp +# ${moz_builddir}/shell/Unified_cpp_js_src_shell0.cpp rpmjs45_CPPFLAGS = \ -DEXPORT_JS_API \ -DJS_HAS_CTYPES \ @@ -219,7 +150,6 @@ -fno-exceptions \ -fno-math-errno \ -pthread \ - -DNDEBUG \ -DTRIMMER \ -freorder-blocks \ -O3 \ @@ -229,6 +159,7 @@ -std=gnu++0x \ -fno-rtti rpmjs45_LDADD = \ + -L${abs_top_builddir}/js/src -lmozjs \ -L${abs_top_builddir}/js/mozilla-release/js/src/dist/sdk/lib \ -lmozglue -lmemory \ -lm -ldl -lffi -licui18n -licuuc -licudata \ @@ -293,8 +224,8 @@ @CFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fno-tree-vrp -fno-strict-aliasing -fno-delete-null-pointer-checks' \ CXXFLAGS='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fno-tree-vrp -fno-strict-aliasing -fno-delete-null-pointer-checks' \ LINKFLAGS='-Wl,-z,relro' \ - LDFLAGS='-Wl,-z,relro' \ - sh -e ./extract.sh + LDFLAGS='-Wl,-z,relro' + @sh -x -e ./extract.sh platform: extract @echo "-- $@ --" @@ . patch -p0 <<'@@ .' Index: rpm/js/rpmjs45.cpp ============================================================================ $ cvs diff -u -r1.1.2.6 -r1.1.2.7 rpmjs45.cpp --- rpm/js/rpmjs45.cpp 9 Jul 2017 09:42:41 -0000 1.1.2.6 +++ rpm/js/rpmjs45.cpp 9 Jul 2017 16:11:12 -0000 1.1.2.7 @@ -30,6 +30,350 @@ rpmjss jss = &_jss; /*==============================================================*/ +static bool +rpmSetRuntimeOptions(JSRuntime* rt, const OptionParser& op) +{ +#ifdef DYING + enableBaseline = !op.getBoolOption("no-baseline"); +assert(enableBaseline == ((jss->xf & XF_BASELINE) != 0)); + enableIon = !op.getBoolOption("no-ion"); +assert(enableIon == ((jss->xf & XF_ION) != 0)); + enableAsmJS = !op.getBoolOption("no-asmjs"); +assert(enableAsmJS == ((jss->xf & XF_ASMJS) != 0)); + enableNativeRegExp = !op.getBoolOption("no-native-regexp"); +assert(enableNativeRegExp == ((jss->xf & XF_NATIVE_REGEXP) != 0)); + enableUnboxedArrays = op.getBoolOption("unboxed-arrays"); +assert(enableUnboxedArrays == ((jss->xf & XF_UNBOXED_ARRAYS) != 0)); +#else + enableBaseline = ((jss->xf & XF_BASELINE) != 0); + enableIon = ((jss->xf & XF_ION) != 0); + enableAsmJS = ((jss->xf & XF_ASMJS) != 0); + enableNativeRegExp = ((jss->xf & XF_NATIVE_REGEXP) != 0); + enableUnboxedArrays = ((jss->xf & XF_UNBOXED_ARRAYS) != 0); +#endif + + JS::RuntimeOptionsRef(rt).setBaseline(enableBaseline) + .setIon(enableIon) + .setAsmJS(enableAsmJS) + .setNativeRegExp(enableNativeRegExp) + .setUnboxedArrays(enableUnboxedArrays); + +#ifdef DYING +assert(op.getBoolOption("no-unboxed-objects") == ((jss->xf & XF_UNBOXED_OBJECTS) == 0)); + if (op.getBoolOption("no-unboxed-objects")) + jit::JitOptions.disableUnboxedObjects = true; +#else + if (!(jss->xf & XF_UNBOXED_OBJECTS)) + jit::JitOptions.disableUnboxedObjects = true; +#endif + + if (const char* str = op.getStringOption("ion-scalar-replacement")) { +assert(!strcmp(str, jss->ion_scalar_replacement)); + if (strcmp(str, "on") == 0) + jit::JitOptions.disableScalarReplacement = false; + else if (strcmp(str, "off") == 0) + jit::JitOptions.disableScalarReplacement = true; + else + return OptionFailure("ion-scalar-replacement", str); + } + + if (const char* str = op.getStringOption("ion-shared-stubs")) { +assert(!strcmp(str, jss->ion_shared_stubs)); + if (strcmp(str, "on") == 0) + jit::JitOptions.disableSharedStubs = false; + else if (strcmp(str, "off") == 0) + jit::JitOptions.disableSharedStubs = true; + else + return OptionFailure("ion-shared-stubs", str); + } + + if (const char* str = op.getStringOption("ion-gvn")) { +assert(!strcmp(str, jss->ion_gvn)); + if (strcmp(str, "off") == 0) { + jit::JitOptions.disableGvn = true; + } else if (strcmp(str, "on") != 0 && + strcmp(str, "optimistic") != 0 && + strcmp(str, "pessimistic") != 0) + { + // We accept "pessimistic" and "optimistic" as synonyms for "on" + // for backwards compatibility. + return OptionFailure("ion-gvn", str); + } + } + + if (const char* str = op.getStringOption("ion-licm")) { +assert(!strcmp(str, jss->ion_licm)); + if (strcmp(str, "on") == 0) + jit::JitOptions.disableLicm = false; + else if (strcmp(str, "off") == 0) + jit::JitOptions.disableLicm = true; + else + return OptionFailure("ion-licm", str); + } + + if (const char* str = op.getStringOption("ion-edgecase-analysis")) { +assert(!strcmp(str, jss->ion_edgecase_analysis)); + if (strcmp(str, "on") == 0) + jit::JitOptions.disableEdgeCaseAnalysis = false; + else if (strcmp(str, "off") == 0) + jit::JitOptions.disableEdgeCaseAnalysis = true; + else + return OptionFailure("ion-edgecase-analysis", str); + } + + if (const char* str = op.getStringOption("ion-pgo")) { +assert(!strcmp(str, jss->ion_pgo)); + if (strcmp(str, "on") == 0) + jit::JitOptions.disablePgo = false; + else if (strcmp(str, "off") == 0) + jit::JitOptions.disablePgo = true; + else + return OptionFailure("ion-pgo", str); + } + + if (const char* str = op.getStringOption("ion-range-analysis")) { +assert(!strcmp(str, jss->ion_range_analysis)); + if (strcmp(str, "on") == 0) + jit::JitOptions.disableRangeAnalysis = false; + else if (strcmp(str, "off") == 0) + jit::JitOptions.disableRangeAnalysis = true; + else + return OptionFailure("ion-range-analysis", str); + } + + if (const char *str = op.getStringOption("ion-sincos")) { +assert(!strcmp(str, jss->ion_sincos)); + if (strcmp(str, "on") == 0) + jit::JitOptions.disableSincos = false; + else if (strcmp(str, "off") == 0) + jit::JitOptions.disableSincos = true; + else + return OptionFailure("ion-sincos", str); + } + + if (const char* str = op.getStringOption("ion-sink")) { +assert(!strcmp(str, jss->ion_sink)); + if (strcmp(str, "on") == 0) + jit::JitOptions.disableSink = false; + else if (strcmp(str, "off") == 0) + jit::JitOptions.disableSink = true; + else + return OptionFailure("ion-sink", str); + } + + if (const char* str = op.getStringOption("ion-loop-unrolling")) { +assert(!strcmp(str, jss->ion_loop_unrolling)); + if (strcmp(str, "on") == 0) + jit::JitOptions.disableLoopUnrolling = false; + else if (strcmp(str, "off") == 0) + jit::JitOptions.disableLoopUnrolling = true; + else + return OptionFailure("ion-loop-unrolling", str); + } + + if (const char* str = op.getStringOption("ion-instruction-reordering")) { +assert(!strcmp(str, jss->ion_instruction_reordering)); + if (strcmp(str, "on") == 0) + jit::JitOptions.disableInstructionReordering = false; + else if (strcmp(str, "off") == 0) + jit::JitOptions.disableInstructionReordering = true; + else + return OptionFailure("ion-instruction-reordering", str); + } + +#ifdef DYING +assert(op.getBoolOption("ion-check-range-analysis") == ((jss->ionf & ION_CHECK_RANGE_ANALYSIS) != 0)); + if (op.getBoolOption("ion-check-range-analysis")) + jit::JitOptions.checkRangeAnalysis = true; +#else + if (jss->ionf & ION_CHECK_RANGE_ANALYSIS) + jit::JitOptions.checkRangeAnalysis = true; +#endif + +#ifdef DYING +assert(op.getBoolOption("ion-extra-checks") == ((jss->ionf & ION_EXTRA_CHECKS) != 0)); + if (op.getBoolOption("ion-extra-checks")) + jit::JitOptions.runExtraChecks = true; +#else + if (jss->ionf & ION_EXTRA_CHECKS) + jit::JitOptions.runExtraChecks = true; +#endif + + if (const char* str = op.getStringOption("ion-inlining")) { +assert(!strcmp(str, jss->ion_inlining)); + if (strcmp(str, "on") == 0) + jit::JitOptions.disableInlining = false; + else if (strcmp(str, "off") == 0) + jit::JitOptions.disableInlining = true; + else + return OptionFailure("ion-inlining", str); + } + + if (const char* str = op.getStringOption("ion-osr")) { +assert(!strcmp(str, jss->ion_osr)); + if (strcmp(str, "on") == 0) + jit::JitOptions.osr = true; + else if (strcmp(str, "off") == 0) + jit::JitOptions.osr = false; + else + return OptionFailure("ion-osr", str); + } + + if (const char* str = op.getStringOption("ion-limit-script-size")) { +assert(!strcmp(str, jss->ion_limit_script_size)); + if (strcmp(str, "on") == 0) + jit::JitOptions.limitScriptSize = true; + else if (strcmp(str, "off") == 0) + jit::JitOptions.limitScriptSize = false; + else + return OptionFailure("ion-limit-script-size", str); + } + +#ifdef DYING + int32_t warmUpThreshold = op.getIntOption("ion-warmup-threshold"); +assert(warmUpThreshold == jss->ion_warmup_threshold); + if (warmUpThreshold >= 0) + jit::JitOptions.setCompilerWarmUpThreshold(warmUpThreshold); +#else + int32_t warmUpThreshold = jss->ion_warmup_threshold; + if (warmUpThreshold >= 0) + jit::JitOptions.setCompilerWarmUpThreshold(warmUpThreshold); +#endif + +#ifdef DYING + warmUpThreshold = op.getIntOption("baseline-warmup-threshold"); + assert(warmUpThreshold == jss->baseline_warmup_threshold); + if (warmUpThreshold >= 0) + jit::JitOptions.baselineWarmUpThreshold = warmUpThreshold; +#else + warmUpThreshold = jss->baseline_warmup_threshold; + if (warmUpThreshold >= 0) + jit::JitOptions.baselineWarmUpThreshold = warmUpThreshold; +#endif + +#ifdef DYING +assert(op.getBoolOption("baseline-eager") == ((jss->xf & XF_BASELINE_EAGER) != 0)); + if (op.getBoolOption("baseline-eager")) + jit::JitOptions.baselineWarmUpThreshold = 0; +#else + if (jss->xf & XF_BASELINE_EAGER) + jit::JitOptions.baselineWarmUpThreshold = 0; +#endif + + if (const char* str = op.getStringOption("ion-regalloc")) { +assert(!strcmp(str, jss->ion_regalloc)); + jit::JitOptions.forcedRegisterAllocator = jit::LookupRegisterAllocator(str); + if (!jit::JitOptions.forcedRegisterAllocator.isSome()) + return OptionFailure("ion-regalloc", str); + } + +#ifdef DYING +assert(op.getBoolOption("ion-eager") == ((jss->ionf & ION_EAGER) != 0)); + if (op.getBoolOption("ion-eager")) + jit::JitOptions.setEagerCompilation(); +#else + if (jss->ionf & ION_EAGER) + jit::JitOptions.setEagerCompilation(); +#endif + + offthreadCompilation = true; + if (const char* str = op.getStringOption("ion-offthread-compile")) { +assert(!strcmp(str, jss->ion_offthread_compile)); + if (strcmp(str, "off") == 0) + offthreadCompilation = false; + else if (strcmp(str, "on") != 0) + return OptionFailure("ion-offthread-compile", str); + } + rt->setOffthreadIonCompilationEnabled(offthreadCompilation); + +#ifdef DYING + if (op.getStringOption("ion-parallel-compile")) { + fprintf(stderr, "--ion-parallel-compile is deprecated. Please use --ion-offthread-compile instead.\n"); + return false; + } +#endif + +#if defined(JS_CODEGEN_ARM) /* XXX FIXME */ + if (const char* str = op.getStringOption("arm-hwcap")) + jit::ParseARMHwCapFlags(str); + + int32_t fill = op.getIntOption("arm-asm-nop-fill"); + if (fill >= 0) + jit::Assembler::NopFill = fill; + + int32_t poolMaxOffset = op.getIntOption("asm-pool-max-offset"); + if (poolMaxOffset >= 5 && poolMaxOffset <= 1024) + jit::Assembler::AsmPoolMaxOffset = poolMaxOffset; +#endif + +#if defined(JS_SIMULATOR_ARM) /* XXX FIXME */ + if (op.getBoolOption("arm-sim-icache-checks")) + jit::Simulator::ICacheCheckingEnabled = true; + + int32_t stopAt = op.getIntOption("arm-sim-stop-at"); + if (stopAt >= 0) + jit::Simulator::StopSimAt = stopAt; +#elif defined(JS_SIMULATOR_MIPS32) || defined(JS_SIMULATOR_MIPS64) + if (op.getBoolOption("mips-sim-icache-checks")) + jit::Simulator::ICacheCheckingEnabled = true; + + int32_t stopAt = op.getIntOption("mips-sim-stop-at"); + if (stopAt >= 0) + jit::Simulator::StopSimAt = stopAt; +#endif + +#ifdef DYING + reportWarnings = op.getBoolOption('w'); +assert(reportWarnings == ((jss->xf & XF_WARNINGS) != 0)); + compileOnly = op.getBoolOption('c'); +assert(compileOnly == ((jss->xf & XF_COMPILE_ONLY) != 0)); + printTiming = op.getBoolOption('b'); +assert(printTiming == ((jss->xf & XF_PRINT_TIMING) != 0)); + enableCodeCoverage = op.getBoolOption("code-coverage"); +assert(enableCodeCoverage == ((jss->xf & XF_CODE_COVERAGE) != 0)); + enableDisassemblyDumps = op.getBoolOption('D'); +assert(enableDisassemblyDumps == ((jss->xf & XF_DUMP_BYTECODE) != 0)); +#else + reportWarnings = ((jss->xf & XF_WARNINGS) != 0); + compileOnly = ((jss->xf & XF_COMPILE_ONLY) != 0); + printTiming = ((jss->xf & XF_PRINT_TIMING) != 0); + enableCodeCoverage = ((jss->xf & XF_CODE_COVERAGE) != 0); + enableDisassemblyDumps = ((jss->xf & XF_DUMP_BYTECODE) != 0); +#endif + rt->profilingScripts = enableCodeCoverage || enableDisassemblyDumps; + + jsCacheDir = op.getStringOption("js-cache"); + if (jsCacheDir) { +assert(!strcmp(jsCacheDir, jss->cachedir)); +assert(op.getBoolOption("no-js-cache-per-process") == ((jss->xf & XF_CACHE_PER_PROCESS) == 0)); + if (!op.getBoolOption("no-js-cache-per-process")) + jsCacheDir = JS_smprintf("%s/%u", jsCacheDir, (unsigned)getpid()); + else + jsCacheDir = JS_strdup(rt, jsCacheDir); + jsCacheAsmJSPath = JS_smprintf("%s/asmjs.cache", jsCacheDir); + } + +#ifdef DEBUG + dumpEntrainedVariables = op.getBoolOption("dump-entrained-variables"); +assert(op.getBoolOption("dump-entrained-variables") == ((jss->xf & XF_DUMP_ENTRAINED_VARIABLES) != 0)); +#endif + +#ifdef JS_GC_ZEAL + const char* zealStr = op.getStringOption("gc-zeal"); +assert(!strcmp(zealStr, jss->gc_zeal)); + gZealStr[0] = 0; + if (zealStr) { + if (!rt->gc.parseAndSetZeal(zealStr)) + return false; + strncpy(gZealStr, zealStr, sizeof(gZealStr)); + gZealStr[sizeof(gZealStr)-1] = 0; + } +#endif + + return true; +} + +/*==============================================================*/ static void mozFini(rpmjss jss) { JSI_t I = (JSI_t) jss->I; @@ -40,7 +384,8 @@ if (I->cx) JS_DestroyContext(I->cx); #else - DestroyContext(I->cx, true); + if (I->cx) + DestroyContext(I->cx, true); #endif I->cx = NULL; @@ -87,14 +432,15 @@ // The fake thread count must be set before initializing the Runtime, // which spins up the thread pool. - int32_t threadCount = op.getIntOption("thread-count"); + int32_t threadCount = jss->thread_count; if (threadCount >= 0) SetFakeCPUCount(threadCount); static uint32_t _maxbytes = 8L * 1024L * 1024L; - static uint32_t _maxNurseryBytes = JS::DefaultNurseryBytes; + uint32_t nurseryBytes = jss->nursery_size > 0 + ? jss->nursery_size : JS::DefaultNurseryBytes; - JSRuntime * rt = JS_NewRuntime(_maxbytes, _maxNurseryBytes); + JSRuntime * rt = JS_NewRuntime(_maxbytes, nurseryBytes); assert(rt); I->rt = rt; @@ -114,7 +460,7 @@ JS_SetErrorReporter(rt, my_ErrorReporter); JS::SetOutOfMemoryCallback(rt, my_OOMCallback, nullptr); - ok = SetRuntimeOptions(rt, op); + ok = rpmSetRuntimeOptions(rt, op); assert(ok); sr->interruptFunc.init(rt, NullValue()); @@ -123,8 +469,10 @@ JS_SetGCParameter(rt, JSGC_MAX_BYTES, 0xffffffff); size_t availMem = op.getIntOption("available-memory"); - if (availMem > 0) + if (availMem > 0) { JS_SetGCParametersBasedOnAvailableMemory(rt, availMem); +assert(jss->available_memory == availMem); + } JS_SetTrustedPrincipals(rt, &ShellPrincipals::fullyTrusted); JS_SetSecurityCallbacks(rt, &ShellPrincipals::securityCallbacks); @@ -153,7 +501,7 @@ #ifdef DYING JS_SetContextPrivate(cx, (void *)jss); #else - JS_SetSecondContextPrivate(cx, (void *)jss); + JS_SetSecondContextPrivate(cx, (void *)jss); /* XXX */ #endif JS_SetGCParameter(rt, JSGC_MODE, JSGC_MODE_INCREMENTAL); @@ -165,11 +513,20 @@ // as is done for the browser, except in more-deterministic builds or when // disabled by command line options. #ifndef JS_MORE_DETERMINISTIC +#ifdef DYING if (!op.getBoolOption("no-incremental-gc")) { +assert(jss->xf & XF_INCREMENTAL_GC); + JS_SetGCParameter(rt, JSGC_DYNAMIC_HEAP_GROWTH, 1); + JS_SetGCParameter(rt, JSGC_DYNAMIC_MARK_SLICE, 1); + JS_SetGCParameter(rt, JSGC_SLICE_TIME_BUDGET, 10); + } +#else + if (jss->xf & XF_INCREMENTAL_GC) { JS_SetGCParameter(rt, JSGC_DYNAMIC_HEAP_GROWTH, 1); JS_SetGCParameter(rt, JSGC_DYNAMIC_MARK_SLICE, 1); JS_SetGCParameter(rt, JSGC_SLICE_TIME_BUDGET, 10); } +#endif /* DYING */ #endif js::SetPreserveWrapperCallback(rt, DummyPreserveWrapperCallback); @@ -204,7 +561,6 @@ } } #endif /* FIXME */ - } return I; @@ -281,50 +637,49 @@ /*==============================================================*/ #define N_(_str) (_str) struct poptOption rpmjssIPoptTable[] = { - { "allow", '\0', POPT_BIT_SET, &_jss.flags, RPMJSS_FLAGS_ALLOW, + { "allow", '\0', POPT_BIT_SET, + &_jss.flags, RPMJSS_FLAGS_ALLOW, N_("Allow (read-only) access to caller's environment"), NULL }, - { "nocache", '\0', POPT_BIT_SET, &_jss.flags, RPMJSS_FLAGS_NOCACHE, + { "cache", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, + &_jss.flags, RPMJSS_FLAGS_NOCACHE, N_("Disables compiler caching via JSScript XDR serialization"), NULL }, - { "loadrc", '\0', POPT_BIT_SET, &_jss.flags, RPMJSS_FLAGS_LOADRC, + { "loadrc", '\0', POPT_BIT_SET, + &_jss.flags, RPMJSS_FLAGS_LOADRC, N_("Load RC file for interpreter based on script filename."), NULL }, - { "nowarn", '\0', POPT_BIT_SET, &_jss.flags, RPMJSS_FLAGS_NOWARN, + { "warn", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, + &_jss.flags, RPMJSS_FLAGS_NOWARN, N_("Do not report warnings"), NULL }, - { "norelimit", '\0', POPT_BIT_CLR, &_jss.flags, RPMJSS_FLAGS_RELIMIT, + { "relimit", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, + &_jss.flags, RPMJSS_FLAGS_RELIMIT, N_("Do not limit regexps to n^3 levels of backtracking"), NULL }, - { "nojit", '\0', POPT_BIT_CLR, &_jss.flags, RPMJSS_FLAGS_JIT, + { "jit", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, + &_jss.flags, RPMJSS_FLAGS_JIT, N_("Disable nanojit"), NULL }, - { "nostrict", '\0', POPT_BIT_CLR, &_jss.flags, RPMJSS_FLAGS_STRICT, + { "strict", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, + &_jss.flags, RPMJSS_FLAGS_STRICT, N_("Disable Strict mode"), NULL }, - { "noutf8", '\0', POPT_BIT_SET, &_jss.flags, RPMJSS_FLAGS_NOUTF8, + { "utf8", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, + &_jss.flags, RPMJSS_FLAGS_NOUTF8, N_("Disable UTF-8 C string processing"), NULL }, - { "xml", '\0', POPT_BIT_SET, &_jss.flags, RPMJSS_FLAGS_XML, + { "xml", '\0', POPT_BIT_SET, + &_jss.flags, RPMJSS_FLAGS_XML, N_("Parse <!-- comments --> as E4X tokens"), NULL }, - { "anonfunfix", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &_jss.flags, RPMJSS_FLAGS_ANONFUNFIX, + { "anonfunfix", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &_jss.flags, RPMJSS_FLAGS_ANONFUNFIX, N_("Parse //@line number [\"filename\"] for XUL"), NULL }, - { "atline", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &_jss.flags, RPMJSS_FLAGS_ATLINE, + { "atline", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &_jss.flags, RPMJSS_FLAGS_ATLINE, N_("Parse //@line number [\"filename\"] for XUL"), NULL }, - { "werror", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, &_jss.flags, RPMJSS_FLAGS_WERROR, + { "werror", '\0', POPT_BIT_SET|POPT_ARGFLAG_DOC_HIDDEN, + &_jss.flags, RPMJSS_FLAGS_WERROR, N_("Convert warnings to errors"), NULL }, POPT_TABLEEND }; -rpmjssIonFlags _ionf = (rpmjssIonFlags) ( - ION_SCALAR_REPLACEMENT | - ION_GVN | - ION_LICM | - ION_RANGE_ANALYSIS | - ION_SINCOS | - ION_INLINING | - ION_OSR | - ION_LIMIT_SCRIPT_SIZE | - ION_EAGER | - ION_OFFTHREAD_COMPILE | - 0 -); - struct poptOption rpmjssIonPoptTable[] = { +#ifdef NOTYET { "ion-shared-stubs", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, &_jss.ionf, ION_SHARED_STUBS, N_("Use shared stubs (default: off)"), NULL }, @@ -358,12 +713,50 @@ { "ion-instruction-reordering", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, &_jss.ionf, ION_INSTRUCTION_REORDERING, N_("Instruction reordering (default: off)"), NULL }, +#else + { "ion-shared-stubs", '\0', POPT_ARG_STRING, + &_jss.ion_shared_stubs, 0, + N_("Use shared stubs (default: off)"), NULL }, + { "ion-scalar-replacement", '\0', POPT_ARG_STRING, + &_jss.ion_scalar_replacement, 0, + N_("Scalar replacement (default: on)"), NULL }, + { "ion-gvn", '\0', POPT_ARG_STRING, + &_jss.ion_gvn, 0, + N_("Global value numbering (default: on)"), NULL }, + { "ion-licm", '\0', POPT_ARG_STRING, + &_jss.ion_licm, 0, + N_("Loop invariant code motion (default: on)"), NULL }, + { "ion-edgecase-analysis", '\0', POPT_ARG_STRING, + &_jss.ion_edgecase_analysis, 0, + N_("Find edge cases where Ion can avoid bailouts (default: off)"), NULL }, + { "ion-pgo", '\0', POPT_ARG_STRING, + &_jss.ion_pgo, 0, + N_("Profile guided optimization (default: off)"), NULL }, + { "ion-range-analysis", '\0', POPT_ARG_STRING, + &_jss.ion_range_analysis, 0, + N_("Range analysis (default: on)"), NULL }, + { "ion-sincos", '\0', POPT_ARG_STRING, + &_jss.ion_sincos, 0, + N_("Replace sin(x)/cos(x) to sincos(x) (default: on)"), NULL }, + { "ion-sink", '\0', POPT_ARG_STRING, + &_jss.ion_sink, 0, + N_("Sink code motion (default: off)"), NULL }, + { "ion-loop-unrolling", '\0', POPT_ARG_STRING, + &_jss.ion_loop_unrolling, 0, + N_("Loop unrolling (default: off)"), NULL }, + { "ion-instruction-reordering", '\0', POPT_ARG_STRING, + &_jss.ion_instruction_reordering, 0, + N_("Instruction reordering (default: off)"), NULL }, +#endif + { "ion-check-range-analysis", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, &_jss.ionf, ION_CHECK_RANGE_ANALYSIS, N_("Range analysis checking (default: off)"), NULL }, { "ion-extra-checks", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, &_jss.ionf, ION_EXTRA_CHECKS, N_("Perform extra dynamic validation checks (default: off)"), NULL }, + +#ifdef NOTYET { "ion-inlining", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, &_jss.ionf, ION_INLINING, N_("Inline methods where possible (default: on)"), NULL }, @@ -373,6 +766,18 @@ { "ion-limit-script-size", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, &_jss.ionf, ION_LIMIT_SCRIPT_SIZE, N_("Don't compile large scripts(default: on)"), NULL }, +#else + { "ion-inlining", '\0', POPT_ARG_STRING, + &_jss.ion_inlining, 0, + N_("Inline methods where possible (default: on)"), NULL }, + { "ion-osr", '\0', POPT_ARG_STRING, + &_jss.ion_osr, 0, + N_("On-Stack Replacement(default: on)"), NULL }, + { "ion-limit-script-size", '\0', POPT_ARG_STRING, + &_jss.ion_limit_script_size, 0, + N_("Don't compile large scripts(default: on)"), NULL }, +#endif + { "ion-warmup-threshold", '\0', POPT_ARG_INT, &_jss.ion_warmup_threshold, 0, N_("Wait COUNT calls/iterations before compiling"), N_("COUNT") }, @@ -382,12 +787,22 @@ { "ion-eager", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, &_jss.ionf, ION_EAGER, N_("Always ion-compile methods (default: on)"), NULL }, + +#ifdef NOTYET { "ion-offthread-compile", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, &_jss.ionf, ION_OFFTHREAD_COMPILE, N_("Compile scripts off thread (default: on)"), NULL }, +#else + { "ion-offthread-compile", '\0', POPT_ARG_STRING, + &_jss.ion_offthread_compile, 0, + N_("Compile scripts off thread (default: on)"), NULL }, +#endif + +#ifdef DYING { "ion-parallel-compile", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, &_jss.ionf, ION_PARALLEL_COMPILE, N_("Parallel compilation (deprecated: use --ion-offthread-compile)"), NULL }, +#endif POPT_TABLEEND }; @@ -402,6 +817,7 @@ N_("Enter prompt after running code"), NULL }, { "compileonly", 'c', POPT_BIT_SET, &_jss.xf, XF_COMPILE_ONLY, N_("Only compile, don't run (syntax checking mode)"), NULL }, + /* XXX collision on -w? */ { "warnings", 'w', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, &_jss.xf, XF_WARNINGS, N_("Emit warnings"), NULL }, { "strict", 's', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, &_jss.xf, XF_STRICT, @@ -412,10 +828,28 @@ N_("Dump bytecode with exec count for all scripts"), NULL }, { "js-cache", '\0', POPT_ARG_STRING, &_jss.cachedir, 0, N_("Enable JS caching in DIR"), N_("DIR") }, - { "no-js-cache-per-process",'\0', POPT_BIT_SET, &_jss.xf, XF_NO_CACHE_PER_PROCESS, + { "js-cache-per-process",'\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, + &_jss.xf, XF_CACHE_PER_PROCESS, N_("Deactivate per-process caching"), NULL }, { "code-coverage", '\0', POPT_BIT_SET, &_jss.xf, XF_CODE_COVERAGE, N_("Enable code coverage insturmentation"), NULL }, + + { "ion", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, + &_jss.xf, XF_ION, + N_("Disable IonMonkey"), NULL }, + { "asmjs", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, + &_jss.xf, XF_ASMJS, + N_("Disable asm.js compilation"), NULL }, + { "native-regexp", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, + &_jss.xf, XF_NATIVE_REGEXP, + N_("Disable native regexp compilation"), NULL }, + { "unboxed-objects", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, + &_jss.xf, XF_UNBOXED_OBJECTS, + N_("Disable creating unboxed plain objects"), NULL }, + { "unboxed-arrays", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, + &_jss.xf, XF_UNBOXED_ARRAYS, + N_("Allow creating unboxed arrays"), NULL }, + { "print-alloc", 'O', POPT_BIT_SET, &_jss.xf, XF_PRINT_ALLOC, N_("Print no. of allocatsions at exit"), NULL }, { "script", '\0', POPT_ARG_STRING, &_jss.script_path, 0, @@ -426,7 +860,7 @@ N_("Use COUNT auxiliary threads"), N_("COUNT") }, { "baseline", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, - &_jss.xf, XF_BASELINE_EAGER, + &_jss.xf, XF_BASELINE, N_("Enable baseline compiler (default: on)"), NULL }, { "baseline-eager", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, &_jss.xf, XF_BASELINE_EAGER, @@ -438,17 +872,22 @@ { "non-writable-jitcode", '\0', POPT_BIT_SET, &_jss.xf, XF_NONWRITABLE_JITCODE, N_("Allocate JIT code as non-writable memory"), NULL }, - { "fpu", '\0', POPT_BIT_CLR|POPT_ARGFLAG_TOGGLE, - &_jss.xf, XF_NO_FPU, +#ifdef JS_CODEGEN_X86 + { "fpu", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, + &_jss.xf, XF_FPU, N_("Assume CPU has a FPU"), NULL }, - { "sse3", '\0', POPT_BIT_CLR|POPT_ARGFLAG_TOGGLE, - &_jss.xf, XF_NO_SSE3, +#endif + { "sse3", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, + &_jss.xf, XF_SSE3, N_("Assume CPU has SSE3 instructions"), NULL }, - { "sse4", '\0', POPT_BIT_CLR|POPT_ARGFLAG_TOGGLE, - &_jss.xf, XF_NO_SSE4, + { "sse4", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, + &_jss.xf, XF_SSE4, N_("Assume CPU has SSE4 instructions"), NULL }, - { "avx", '\0', POPT_BIT_CLR|POPT_ARGFLAG_TOGGLE, - &_jss.xf, XF_NO_AVX, + { "avx", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, + &_jss.xf, XF_AVX, + N_("Assume CPU has AVX instructions"), NULL }, + { "enable-avx", '\0', POPT_BIT_SET, + &_jss.xf, XF_AVX, N_("Assume CPU has AVX instructions"), NULL }, { "fuzzing-safe", '\0', POPT_BIT_SET, &_jss.xf, XF_FUZZING_SAFE, @@ -456,27 +895,30 @@ { "disable-oom-functions", '\0', POPT_BIT_SET, &_jss.xf, XF_DISABLE_OOM, N_("Disable functions that trigger OOM"), NULL }, - { "threads", '\0', POPT_BIT_CLR|POPT_ARGFLAG_TOGGLE, - &_jss.xf, XF_NO_THREADS, + { "threads", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, + &_jss.xf, XF_THREADS, N_("Disable helper threads"), NULL }, +#ifdef DEBUG { "dump-entrained-variables", '\0', POPT_BIT_SET, &_jss.xf, XF_DISABLE_OOM, N_("Print variables entrained by inner functions"), NULL }, +#endif - { "ggc", '\0', POPT_BIT_CLR|POPT_ARGFLAG_TOGGLE, - &_jss.xf, XF_NO_GGC, + { "ggc", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, + &_jss.xf, XF_GGC, N_("Disable Generational GC"), NULL }, - { "cgc", '\0', POPT_BIT_CLR|POPT_ARGFLAG_TOGGLE, - &_jss.xf, XF_NO_CGC, + { "cgc", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, + &_jss.xf, XF_CGC, N_("Disable Compacting GC"), NULL }, - { "incremental-gc", '\0', POPT_BIT_CLR|POPT_ARGFLAG_TOGGLE, - &_jss.xf, XF_NO_INCREMENTAL_GC, + { "incremental-gc", '\0', POPT_BIT_SET|POPT_ARGFLAG_TOGGLE, + &_jss.xf, XF_INCREMENTAL_GC, N_("Disable Incremental GC"), NULL }, { "available-memory", '\0', POPT_ARG_INT, &_jss.available_memory, 0, N_("Select GC settings based on SIZE-MB"), N_("SIZE-MB") }, +#if defined(JS_CODEGEN_ARM) { "arm-hwcap", '\0', POPT_ARG_STRING, &_jss.arm_hwcap, 0, N_("Specify ARM code generation FEATURES"), N_("FEATURES") }, @@ -484,23 +926,31 @@ N_("Insert N NOP instructions in pool"), N_("N") }, { "asm-pool-max-offset", '\0', POPT_ARG_INT, &_jss.asm_pool_max_offset, 0, N_("Max PC-relative OFFSET in pool"), N_("OFFSET") }, +#endif +#if defined(JS_SIMULATOR_ARM) { "arm-sim-icache-checks", '\0', POPT_BIT_SET, &_jss.xf, XF_ARM_SIM_ICACHE_CHECKS, N_("(ARM) Enable icache flush checks"), NULL }, { "arm-sim-stop-at", '\0', POPT_ARG_INT, &_jss.arm_sim_stop_at, 0, N_("(ARM) Stop simulator after N instructions"), N_("N") }, +#endif +#if defined(JS_SIMULATOR_MIPS32) || defined(JS_SIMULATOR_MIPS64) { "mips-sim-icache-checks", '\0', POPT_BIT_SET, &_jss.xf, XF_MIPS_SIM_ICACHE_CHECKS, N_("(MIPS) Enable icache flush checks"), NULL }, { "mips-sim-stop-at", '\0', POPT_ARG_INT, &_jss.mips_sim_stop_at, 0, N_("(MIPS) Stop simulator after N instructions"), N_("N") }, +#endif { "nursery-size", '\0', POPT_ARG_INT, &_jss.nursery_size, 0, N_("Set nursery SIZE-MB"), N_("SIZE-MB") }, - { "gc-zeal", '\0', POPT_ARG_INT, &_jss.gc_zeal, 0, - N_("Set GC zeal LEVEL"), N_("LEVEL") }, + +#ifdef JS_GC_ZEAL + { "gc-zeal", '\0', POPT_ARG_STRING, &_jss.gc_zeal, 0, + N_("Set GC zeal to LEVEL"), N_("LEVEL") }, +#endif { "module-load-path", '\0', POPT_ARG_STRING, &_jss.moduledir, 0, N_("Load modules from DIR"), N_("DIR") }, @@ -519,11 +969,61 @@ POPT_TABLEEND }; +static rpmjssFlags _flagsDefault = (rpmjssFlags) ( + RPMJSS_FLAGS_RELIMIT | + RPMJSS_FLAGS_JIT | + RPMJSS_FLAGS_STRICT | + 0 +); + +static rpmjssIonFlags _ionfDefault = (rpmjssIonFlags) ( + ION_SCALAR_REPLACEMENT | + ION_GVN | + ION_LICM | + ION_EDGECASE_ANALYSIS | + ION_RANGE_ANALYSIS | + ION_INLINING | + ION_OSR | + ION_LIMIT_SCRIPT_SIZE | + ION_OFFTHREAD_COMPILE | + 0 +); + +static rpmjssXFlags _xfDefault = (rpmjssXFlags) ( + XF_BASELINE | + XF_ION | + XF_ASMJS | + XF_NATIVE_REGEXP | + XF_UNBOXED_OBJECTS | + XF_CACHE_PER_PROCESS | + XF_FPU | + XF_SSE3 | + XF_SSE4 | + XF_THREADS | + XF_GGC | + XF_CGC | + XF_INCREMENTAL_GC | + 0 +); + int rpmMain(int argc, char *argv[], char *envp[]) { -#ifdef NOTYET + + jss->flags = _flagsDefault; + jss->thread_count = -1; + jss->ion_warmup_threshold = -1; + jss->baseline_warmup_threshold = -1; + jss->ion_warmup_threshold = -1; + jss->available_memory = 0; + jss->arm_asm_nop_fill = 0; + jss->asm_pool_max_offset = 1024; + jss->arm_sim_stop_at = -1; + jss->mips_sim_stop_at = -1; + jss->nursery_size = 16; + jss->ionf = _ionfDefault; + jss->xf = _xfDefault; + poptContext con = rpmioInit(argc, argv, rpmjssOptionsTable); -#endif int rc = 0; #ifdef HAVE_SETLOCALE @@ -714,30 +1214,61 @@ * allocations as possible. */ OOM_printAllocationCount = op.getBoolOption('O'); +assert(OOM_printAllocationCount == ((jss->xf & XF_PRINT_ALLOC) != 0)); #endif #ifdef JS_CODEGEN_X86 +#ifdef DYING +assert(op.getBoolOption("no-fpu") == ((jss->xf & XF_FPU) == 0)); if (op.getBoolOption("no-fpu")) js::jit::CPUInfo::SetFloatingPointDisabled(); +#else + if (!(jss->xf & XF_FPU)) + js::jit::CPUInfo::SetFloatingPointDisabled(); +#endif /* DYING */ #endif #if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64) +#ifdef DYING +assert(op.getBoolOption("no-sse3") == ((jss->xf & XF_SSE3) == 0)); if (op.getBoolOption("no-sse3")) { js::jit::CPUInfo::SetSSE3Disabled(); PropagateFlagToNestedShells("--no-sse3"); } +assert(op.getBoolOption("no-sse4") == ((jss->xf & XF_SSE4) == 0)); if (op.getBoolOption("no-sse4")) { js::jit::CPUInfo::SetSSE4Disabled(); PropagateFlagToNestedShells("--no-sse4"); } +assert(op.getBoolOption("enable-avx") == ((jss->xf & XF_AVX) != 0)); if (op.getBoolOption("enable-avx")) { js::jit::CPUInfo::SetAVXEnabled(); PropagateFlagToNestedShells("--enable-avx"); } +#else + if (!(jss->xf & XF_SSE3)) { + js::jit::CPUInfo::SetSSE3Disabled(); + PropagateFlagToNestedShells("--no-sse3"); + } + if (!(jss->xf & XF_SSE4)) { + js::jit::CPUInfo::SetSSE4Disabled(); + PropagateFlagToNestedShells("--no-sse4"); + } + if (jss->xf & XF_AVX) { + js::jit::CPUInfo::SetAVXEnabled(); + PropagateFlagToNestedShells("--enable-avx"); + } +#endif /* DYING */ #endif +#ifdef DYING +assert(op.getBoolOption("no-threads") == ((jss->xf & XF_THREADS) == 0)); if (op.getBoolOption("no-threads")) js::DisableExtraThreads(); +#else + if (!(jss->xf && XF_THREADS)) + js::DisableExtraThreads(); +#endif JSI_t I = (JSI_t) mozInit(jss, op); jss->I = I; @@ -763,9 +1294,7 @@ mozFini(jss); av = argvFree(av); -#ifdef NOTYET con = rpmioFini(con); -#endif return rc; } @@ . patch -p0 <<'@@ .' Index: rpm/rpmio/rpmjss.h ============================================================================ $ cvs diff -u -r1.1.2.3 -r1.1.2.4 rpmjss.h --- rpm/rpmio/rpmjss.h 9 Jul 2017 09:42:41 -0000 1.1.2.3 +++ rpm/rpmio/rpmjss.h 9 Jul 2017 16:11:12 -0000 1.1.2.4 @@ -22,7 +22,7 @@ /** * Interpreter flags. */ -enum rpmjssFlags_e { +typedef enum rpmjssFlags_e { RPMJSS_FLAGS_NONE = 0, RPMJSS_FLAGS_STRICT = (1<< 0), /* JSOPTION_STRICT */ RPMJSS_FLAGS_WERROR = (1<< 1), /* JSOPTION_WERROR */ @@ -33,22 +33,22 @@ RPMJSS_FLAGS_XML = (1<< 6), /* JSOPTION_XML */ /* bit 7 unused */ RPMJSS_FLAGS_DONT_REPORT_UNCAUGHT = (1<< 8), /* JSOPTION_DONT_REPORT_UNCAUGHT */ - RPMJSS_FLAGS_RELIMIT = (1<< 9), /* JSOPTION_RELIMIT */ + RPMJSS_FLAGS_RELIMIT = (1<< 9), /* JSOPTION_RELIMIT */ RPMJSS_FLAGS_ANONFUNFIX = (1<<10), /* JSOPTION_ANONFUNFIX */ RPMJSS_FLAGS_JIT = (1<<11), /* JSOPTION_JIT */ RPMJSS_FLAGS_NO_SCRIPT_RVAL = (1<<12), /* JSOPTION_NO_SCRIPT_RVAL */ - RPMJSS_FLAGS_UNROOTED_GLOBAL = (1<<13), /* JSOPTION_UNROOTED_GLOBAL */ + RPMJSS_FLAGS_UNROOTED_GLOBAL= (1<<13), /* JSOPTION_UNROOTED_GLOBAL */ /* bits 14-15 unused */ RPMJSS_FLAGS_NOEXEC = (1<<16), /*!< -n */ RPMJSS_FLAGS_SKIPSHEBANG = (1<<17), /*!< -F */ RPMJSS_FLAGS_LOADRC = (1<<18), /*!< -R */ RPMJSS_FLAGS_NOUTF8 = (1<<19), /*!< -U */ - RPMJSS_FLAGS_NOCACHE = (1<<20), /*!< -C */ + RPMJSS_FLAGS_NOCACHE = (1<<20), /*!< -C */ RPMJSS_FLAGS_NOWARN = (1<<21), /*!< -W */ RPMJSS_FLAGS_ALLOW = (1<<22), /*!< -a */ /* bits 23-30 unused */ RPMJSS_FLAGS_GLOBAL = (1<<31), -}; +} rpmjssFlags; typedef enum rpmjssIonFlags_e { ION_SHARED_STUBS = (1 << 0), @@ -79,28 +79,28 @@ XF_STRICT = (1 << 3), XF_DUMP_BYTECODE = (1 << 4), XF_PRINT_TIMING = (1 << 5), - XF_NO_CACHE_PER_PROCESS = (1 << 6), + XF_CACHE_PER_PROCESS = (1 << 6), XF_CODE_COVERAGE = (1 << 7), XF_PRINT_ALLOC = (1 << 8), - XF_NO_ION = (1 << 9), - XF_NO_ASMJS = (1 << 10), + XF_ION = (1 << 9), + XF_ASMJS = (1 << 10), XF_NATIVE_REGEXP = (1 << 11), XF_UNBOXED_OBJECTS = (1 << 12), XF_UNBOXED_ARRAYS = (1 << 13), XF_BASELINE = (1 << 14), XF_BASELINE_EAGER = (1 << 15), XF_NONWRITABLE_JITCODE = (1 << 16), - XF_NO_FPU = (1 << 17), - XF_NO_SSE3 = (1 << 18), - XF_NO_SSE4 = (1 << 19), - XF_NO_AVX = (1 << 20), + XF_FPU = (1 << 17), + XF_SSE3 = (1 << 18), + XF_SSE4 = (1 << 19), + XF_AVX = (1 << 20), XF_FUZZING_SAFE = (1 << 21), XF_DISABLE_OOM = (1 << 22), - XF_NO_THREADS = (1 << 23), + XF_THREADS = (1 << 23), XF_DUMP_ENTRAINED_VARIABLES = (1 << 24), - XF_NO_GGC = (1 << 25), - XF_NO_CGC = (1 << 26), - XF_NO_INCREMENTAL_GC = (1 << 27), + XF_GGC = (1 << 25), + XF_CGC = (1 << 26), + XF_INCREMENTAL_GC = (1 << 27), XF_ARM_SIM_ICACHE_CHECKS = (1 << 28), XF_MIPS_SIM_ICACHE_CHECKS = (1 << 29), } rpmjssXFlags; @@ -137,22 +137,40 @@ const char *script_path; const char *script_args; + const char * ion_shared_stubs; + const char * ion_scalar_replacement; + const char * ion_gvn; + const char * ion_licm; + const char * ion_edgecase_analysis; + const char * ion_pgo; + const char * ion_range_analysis; + const char * ion_sincos; + const char * ion_sink; + const char * ion_loop_unrolling; + const char * ion_instruction_reordering; + + const char * ion_inlining; + const char * ion_osr; + const char * ion_limit_script_size; + const char * ion_offthread_compile; + const char * ion_regalloc; const char * arm_hwcap; + const char * gc_zeal; + int thread_count; int ion_warmup_threshold; int baseline_warmup_threshold; - int available_memory; + unsigned available_memory; int arm_asm_nop_fill; int asm_pool_max_offset; int arm_sim_stop_at; int mips_sim_stop_at; - int nursery_size; - int gc_zeal; + unsigned nursery_size; rpmjssXFlags xf; rpmjssIonFlags ionf; @@ . ______________________________________________________________________ RPM Package Manager http://rpm5.org CVS Sources Repository rpm-cvs@rpm5.org