diff options
Diffstat (limited to 'src/settings.js')
-rw-r--r-- | src/settings.js | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/src/settings.js b/src/settings.js index c8114059..a9a72425 100644 --- a/src/settings.js +++ b/src/settings.js @@ -23,8 +23,8 @@ var QUANTUM_SIZE = 4; // This is the size of an individual field in a structure. // Changing this from the default of 4 is deprecated. var TARGET_X86 = 0; // For i386-pc-linux-gnu -var TARGET_LE32 = 1; // For le32-unknown-nacl. 1 is normal, 2 is for the fastcomp llvm - // backend using pnacl abi simplification +var TARGET_ASMJS_UNKNOWN_EMSCRIPTEN = 1; // For asmjs-unknown-emscripten. 1 is normal, 2 is for the fastcomp llvm + // backend using emscripten-customized abi simplification var CORRECT_SIGNS = 1; // Whether we make sure to convert unsigned values to signed values. // Decreases performance with additional runtime checks. Might not be @@ -39,7 +39,7 @@ var CHECK_SIGNS = 0; // Runtime errors for signing issues that need correcting. var ASSERTIONS = 1; // Whether we should add runtime assertions, for example to // check that each allocation to the stack does not - // exceed it's size, whether all allocations (stack and static) are + // exceed its size, whether all allocations (stack and static) are // of positive size, etc., whether we should throw if we encounter a bad __label__, i.e., // if code flow runs into a fault // ASSERTIONS == 2 gives even more runtime checks @@ -133,6 +133,7 @@ var PRECISE_F32 = 0; // 0: Use JS numbers for floating-point values. These are 6 // therefore recommended. var SIMD = 0; // Whether to emit SIMD code ( https://github.com/johnmccutchan/ecmascript_simd ) +var CLOSURE_COMPILER = 0; // Whether closure compiling is being run on this output var CLOSURE_ANNOTATIONS = 0; // If set, the generated code will be annotated for the closure // compiler. This potentially lets closure optimize the code better. @@ -164,8 +165,14 @@ var OUTLINING_LIMIT = 0; // A function size above which we try to automatically // throughput. It is hard to say what values to start testing // with, but something around 20,000 to 100,000 might make sense. // (The unit size is number of AST nodes.) + // Outlining decreases maximum function size, but does so at the + // cost of increasing overall code size as well as performance + // (outlining itself makes code less optimized, and requires + // emscripten to disable some passes that are incompatible with + // it). var AGGRESSIVE_VARIABLE_ELIMINATION = 0; // Run aggressiveVariableElimination in js-optimizer.js +var SIMPLIFY_IFS = 1; // Whether to simplify ifs in js-optimizer.js // Generated code debugging options var SAFE_HEAP = 0; // Check each write to the heap, for example, this will give a clear @@ -224,6 +231,19 @@ var LIBRARY_DEBUG = 0; // Print out when we enter a library call (library*.js). var SOCKET_DEBUG = 0; // Log out socket/network data transfer. var SOCKET_WEBRTC = 0; // Select socket backend, either webrtc or websockets. +// As well as being configurable at compile time via the "-s" option the WEBSOCKET_URL and WEBSOCKET_SUBPROTOCOL +// settings may configured at run time via the Module object e.g. +// Module['websocket'] = {subprotocol: 'base64, binary, text'}; +// Module['websocket'] = {url: 'wss://', subprotocol: 'base64'}; +// Run time configuration may be useful as it lets an application select multiple different services. +var WEBSOCKET_URL = 'ws://'; // A string containing either a WebSocket URL prefix (ws:// or wss://) or a complete + // RFC 6455 URL - "ws[s]:" "//" host [ ":" port ] path [ "?" query ]. + // In the (default) case of only a prefix being specified the URL will be constructed from + // prefix + addr + ':' + port + // where addr and port are derived from the socket connect/bind/accept calls. +var WEBSOCKET_SUBPROTOCOL = 'binary'; // A string containing a comma separated list of WebSocket subprotocols + // as would be present in the Sec-WebSocket-Protocol header. + var OPENAL_DEBUG = 0; // Print out debugging information from our OpenAL implementation. var GL_ASSERTIONS = 0; // Adds extra checks for error situations in the GL library. Can impact performance. @@ -311,10 +331,14 @@ var EXPORTED_FUNCTIONS = ['_main', '_malloc']; // through LLVM dead code elimination, and also made accessible outside of // the generated code even after running closure compiler (on "Module"). // Note the necessary prefix of "_". + // Note also that this is the full list of exported functions - if you + // have a main() function and want it to run, you must include it in this + // list (as _main is by default in this value, and if you override it + // without keeping it there, you are in effect removing it). var EXPORT_ALL = 0; // If true, we export all the symbols. Note that this does *not* affect LLVM, so it can // still eliminate functions as dead. This just exports them on the Module object. var EXPORT_BINDINGS = 0; // Export all bindings generator functions (prefixed with emscripten_bind_). This - // is necessary to use the bindings generator with asm.js + // is necessary to use the WebIDL binder or bindings generator with asm.js var RETAIN_COMPILER_SETTINGS = 0; // Remembers the values of these settings, and makes them accessible // through Runtime.getCompilerSetting and emscripten_get_compiler_setting. // To see what is retained, look for compilerSettings in the generated code. @@ -446,7 +470,7 @@ var HEADLESS = 0; // If 1, will include shim code that tries to 'fake' a browser var BENCHMARK = 0; // If 1, will just time how long main() takes to execute, and not // print out anything at all whatsoever. This is useful for benchmarking. -var ASM_JS = 0; // If 1, generate code in asm.js format. If 2, emits the same code except +var ASM_JS = 1; // If 1, generate code in asm.js format. If 2, emits the same code except // for omitting 'use asm' var PGO = 0; // Enables profile-guided optimization in the form of runtime checks for |