js/src/jit/JitOptions.h

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/js/src/jit/JitOptions.h	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,88 @@
     1.4 +/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
     1.5 + * vim: set ts=8 sts=4 et sw=4 tw=99:
     1.6 + * This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +#ifndef jit_JitOptions_h
    1.11 +#define jit_JitOptions_h
    1.12 +
    1.13 +#include "jit/IonTypes.h"
    1.14 +#include "js/TypeDecls.h"
    1.15 +
    1.16 +#ifdef JS_ION
    1.17 +
    1.18 +namespace js {
    1.19 +namespace jit {
    1.20 +
    1.21 +// Longer scripts can only be compiled off thread, as these compilations
    1.22 +// can be expensive and stall the main thread for too long.
    1.23 +static const uint32_t MAX_OFF_THREAD_SCRIPT_SIZE = 100 * 1000;
    1.24 +static const uint32_t MAX_MAIN_THREAD_SCRIPT_SIZE = 2 * 1000;
    1.25 +static const uint32_t MAX_MAIN_THREAD_LOCALS_AND_ARGS = 256;
    1.26 +
    1.27 +// DOM Worker runtimes don't have off thread compilation, but can also compile
    1.28 +// larger scripts since this doesn't stall the main thread.
    1.29 +static const uint32_t MAX_DOM_WORKER_SCRIPT_SIZE = 16 * 1000;
    1.30 +static const uint32_t MAX_DOM_WORKER_LOCALS_AND_ARGS = 2048;
    1.31 +
    1.32 +// Possible register allocators which may be used.
    1.33 +enum IonRegisterAllocator {
    1.34 +    RegisterAllocator_LSRA,
    1.35 +    RegisterAllocator_Backtracking,
    1.36 +    RegisterAllocator_Stupid
    1.37 +};
    1.38 +
    1.39 +enum IonGvnKind {
    1.40 +    GVN_Optimistic,
    1.41 +    GVN_Pessimistic
    1.42 +};
    1.43 +
    1.44 +struct JitOptions
    1.45 +{
    1.46 +    bool checkGraphConsistency;
    1.47 +#ifdef CHECK_OSIPOINT_REGISTERS
    1.48 +    bool checkOsiPointRegisters;
    1.49 +#endif
    1.50 +    bool checkRangeAnalysis;
    1.51 +    bool compileTryCatch;
    1.52 +    bool disableGvn;
    1.53 +    bool disableLicm;
    1.54 +    bool disableInlining;
    1.55 +    bool disableEdgeCaseAnalysis;
    1.56 +    bool disableRangeAnalysis;
    1.57 +    bool disableUce;
    1.58 +    bool disableEaa;
    1.59 +    bool eagerCompilation;
    1.60 +    bool forceDefaultIonUsesBeforeCompile;
    1.61 +    uint32_t forcedDefaultIonUsesBeforeCompile;
    1.62 +    bool forceGvnKind;
    1.63 +    IonGvnKind forcedGvnKind;
    1.64 +    bool forceRegisterAllocator;
    1.65 +    IonRegisterAllocator forcedRegisterAllocator;
    1.66 +    bool limitScriptSize;
    1.67 +    bool osr;
    1.68 +    uint32_t baselineUsesBeforeCompile;
    1.69 +    uint32_t exceptionBailoutThreshold;
    1.70 +    uint32_t frequentBailoutThreshold;
    1.71 +    uint32_t maxStackArgs;
    1.72 +    uint32_t osrPcMismatchesBeforeRecompile;
    1.73 +    uint32_t smallFunctionMaxBytecodeLength_;
    1.74 +    uint32_t usesBeforeCompilePar;
    1.75 +    bool profileInlineFrames;
    1.76 +
    1.77 +    JitOptions();
    1.78 +    bool isSmallFunction(JSScript *script) const;
    1.79 +    void setEagerCompilation();
    1.80 +    void setUsesBeforeCompile(uint32_t useCount);
    1.81 +    void resetUsesBeforeCompile();
    1.82 +};
    1.83 +
    1.84 +extern JitOptions js_JitOptions;
    1.85 +
    1.86 +} // namespace jit
    1.87 +} // namespace js
    1.88 +
    1.89 +#endif // JS_ION
    1.90 +
    1.91 +#endif /* jit_JitOptions_h */

mercurial