js/src/jit/JitOptions.h

Sat, 03 Jan 2015 20:18:00 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 03 Jan 2015 20:18:00 +0100
branch
TOR_BUG_3246
changeset 7
129ffea94266
permissions
-rw-r--r--

Conditionally enable double key logic according to:
private browsing mode or privacy.thirdparty.isolate preference and
implement in GetCookieStringCommon and FindCookie where it counts...
With some reservations of how to convince FindCookie users to test
condition and pass a nullptr when disabling double key logic.

michael@0 1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
michael@0 2 * vim: set ts=8 sts=4 et sw=4 tw=99:
michael@0 3 * This Source Code Form is subject to the terms of the Mozilla Public
michael@0 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
michael@0 6
michael@0 7 #ifndef jit_JitOptions_h
michael@0 8 #define jit_JitOptions_h
michael@0 9
michael@0 10 #include "jit/IonTypes.h"
michael@0 11 #include "js/TypeDecls.h"
michael@0 12
michael@0 13 #ifdef JS_ION
michael@0 14
michael@0 15 namespace js {
michael@0 16 namespace jit {
michael@0 17
michael@0 18 // Longer scripts can only be compiled off thread, as these compilations
michael@0 19 // can be expensive and stall the main thread for too long.
michael@0 20 static const uint32_t MAX_OFF_THREAD_SCRIPT_SIZE = 100 * 1000;
michael@0 21 static const uint32_t MAX_MAIN_THREAD_SCRIPT_SIZE = 2 * 1000;
michael@0 22 static const uint32_t MAX_MAIN_THREAD_LOCALS_AND_ARGS = 256;
michael@0 23
michael@0 24 // DOM Worker runtimes don't have off thread compilation, but can also compile
michael@0 25 // larger scripts since this doesn't stall the main thread.
michael@0 26 static const uint32_t MAX_DOM_WORKER_SCRIPT_SIZE = 16 * 1000;
michael@0 27 static const uint32_t MAX_DOM_WORKER_LOCALS_AND_ARGS = 2048;
michael@0 28
michael@0 29 // Possible register allocators which may be used.
michael@0 30 enum IonRegisterAllocator {
michael@0 31 RegisterAllocator_LSRA,
michael@0 32 RegisterAllocator_Backtracking,
michael@0 33 RegisterAllocator_Stupid
michael@0 34 };
michael@0 35
michael@0 36 enum IonGvnKind {
michael@0 37 GVN_Optimistic,
michael@0 38 GVN_Pessimistic
michael@0 39 };
michael@0 40
michael@0 41 struct JitOptions
michael@0 42 {
michael@0 43 bool checkGraphConsistency;
michael@0 44 #ifdef CHECK_OSIPOINT_REGISTERS
michael@0 45 bool checkOsiPointRegisters;
michael@0 46 #endif
michael@0 47 bool checkRangeAnalysis;
michael@0 48 bool compileTryCatch;
michael@0 49 bool disableGvn;
michael@0 50 bool disableLicm;
michael@0 51 bool disableInlining;
michael@0 52 bool disableEdgeCaseAnalysis;
michael@0 53 bool disableRangeAnalysis;
michael@0 54 bool disableUce;
michael@0 55 bool disableEaa;
michael@0 56 bool eagerCompilation;
michael@0 57 bool forceDefaultIonUsesBeforeCompile;
michael@0 58 uint32_t forcedDefaultIonUsesBeforeCompile;
michael@0 59 bool forceGvnKind;
michael@0 60 IonGvnKind forcedGvnKind;
michael@0 61 bool forceRegisterAllocator;
michael@0 62 IonRegisterAllocator forcedRegisterAllocator;
michael@0 63 bool limitScriptSize;
michael@0 64 bool osr;
michael@0 65 uint32_t baselineUsesBeforeCompile;
michael@0 66 uint32_t exceptionBailoutThreshold;
michael@0 67 uint32_t frequentBailoutThreshold;
michael@0 68 uint32_t maxStackArgs;
michael@0 69 uint32_t osrPcMismatchesBeforeRecompile;
michael@0 70 uint32_t smallFunctionMaxBytecodeLength_;
michael@0 71 uint32_t usesBeforeCompilePar;
michael@0 72 bool profileInlineFrames;
michael@0 73
michael@0 74 JitOptions();
michael@0 75 bool isSmallFunction(JSScript *script) const;
michael@0 76 void setEagerCompilation();
michael@0 77 void setUsesBeforeCompile(uint32_t useCount);
michael@0 78 void resetUsesBeforeCompile();
michael@0 79 };
michael@0 80
michael@0 81 extern JitOptions js_JitOptions;
michael@0 82
michael@0 83 } // namespace jit
michael@0 84 } // namespace js
michael@0 85
michael@0 86 #endif // JS_ION
michael@0 87
michael@0 88 #endif /* jit_JitOptions_h */

mercurial