michael@0: /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- michael@0: * vim: set ts=8 sts=4 et sw=4 tw=99: michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef jit_JitOptions_h michael@0: #define jit_JitOptions_h michael@0: michael@0: #include "jit/IonTypes.h" michael@0: #include "js/TypeDecls.h" michael@0: michael@0: #ifdef JS_ION michael@0: michael@0: namespace js { michael@0: namespace jit { michael@0: michael@0: // Longer scripts can only be compiled off thread, as these compilations michael@0: // can be expensive and stall the main thread for too long. michael@0: static const uint32_t MAX_OFF_THREAD_SCRIPT_SIZE = 100 * 1000; michael@0: static const uint32_t MAX_MAIN_THREAD_SCRIPT_SIZE = 2 * 1000; michael@0: static const uint32_t MAX_MAIN_THREAD_LOCALS_AND_ARGS = 256; michael@0: michael@0: // DOM Worker runtimes don't have off thread compilation, but can also compile michael@0: // larger scripts since this doesn't stall the main thread. michael@0: static const uint32_t MAX_DOM_WORKER_SCRIPT_SIZE = 16 * 1000; michael@0: static const uint32_t MAX_DOM_WORKER_LOCALS_AND_ARGS = 2048; michael@0: michael@0: // Possible register allocators which may be used. michael@0: enum IonRegisterAllocator { michael@0: RegisterAllocator_LSRA, michael@0: RegisterAllocator_Backtracking, michael@0: RegisterAllocator_Stupid michael@0: }; michael@0: michael@0: enum IonGvnKind { michael@0: GVN_Optimistic, michael@0: GVN_Pessimistic michael@0: }; michael@0: michael@0: struct JitOptions michael@0: { michael@0: bool checkGraphConsistency; michael@0: #ifdef CHECK_OSIPOINT_REGISTERS michael@0: bool checkOsiPointRegisters; michael@0: #endif michael@0: bool checkRangeAnalysis; michael@0: bool compileTryCatch; michael@0: bool disableGvn; michael@0: bool disableLicm; michael@0: bool disableInlining; michael@0: bool disableEdgeCaseAnalysis; michael@0: bool disableRangeAnalysis; michael@0: bool disableUce; michael@0: bool disableEaa; michael@0: bool eagerCompilation; michael@0: bool forceDefaultIonUsesBeforeCompile; michael@0: uint32_t forcedDefaultIonUsesBeforeCompile; michael@0: bool forceGvnKind; michael@0: IonGvnKind forcedGvnKind; michael@0: bool forceRegisterAllocator; michael@0: IonRegisterAllocator forcedRegisterAllocator; michael@0: bool limitScriptSize; michael@0: bool osr; michael@0: uint32_t baselineUsesBeforeCompile; michael@0: uint32_t exceptionBailoutThreshold; michael@0: uint32_t frequentBailoutThreshold; michael@0: uint32_t maxStackArgs; michael@0: uint32_t osrPcMismatchesBeforeRecompile; michael@0: uint32_t smallFunctionMaxBytecodeLength_; michael@0: uint32_t usesBeforeCompilePar; michael@0: bool profileInlineFrames; michael@0: michael@0: JitOptions(); michael@0: bool isSmallFunction(JSScript *script) const; michael@0: void setEagerCompilation(); michael@0: void setUsesBeforeCompile(uint32_t useCount); michael@0: void resetUsesBeforeCompile(); michael@0: }; michael@0: michael@0: extern JitOptions js_JitOptions; michael@0: michael@0: } // namespace jit michael@0: } // namespace js michael@0: michael@0: #endif // JS_ION michael@0: michael@0: #endif /* jit_JitOptions_h */