Name Description Size
AsmJS.cpp / // A wasm module can either use no memory, a unshared memory (ArrayBuffer) or // shared memory (SharedArrayBuffer). enum class MemoryUsage { None = false, Unshared = 1, Shared = 2 }; // The asm.js valid heap lengths are precisely the WASM valid heap lengths for // ARM greater or equal to MinHeapLength static const size_t MinHeapLength = PageSize; // An asm.js heap can in principle be up to INT32_MAX bytes but requirements // on the format restrict it further to the largest pseudo-ARM-immediate. // See IsValidAsmJSHeapLength(). static const uint64_t MaxHeapLength = 0x7f000000; static uint64_t RoundUpToNextValidAsmJSHeapLength(uint64_t length) { if (length <= MinHeapLength) { return MinHeapLength; } return wasm::RoundUpToNextValidARMImmediate(length); } static uint64_t DivideRoundingUp(uint64_t a, uint64_t b) { return (a + (b - 1)) / b; } /**************************************************************************** 214416
AsmJS.h 3602 \ /* This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at */ #ifndef %(includeguard)s #define %(includeguard)s /* This file is generated by wasm/ Do not edit! */ %(contents)s #endif // %(includeguard)s 5161 1848
WasmAnyRef.cpp 3546
WasmAnyRef.h 14614
WasmBaselineCompile.cpp [SMDOC] WebAssembly baseline compiler (RabaldrMonkey) For now, see WasmBCClass.h for general comments about the compiler's structure. ---------------- General assumptions for 32-bit vs 64-bit code: - A 32-bit register can be extended in-place to a 64-bit register on 64-bit systems. - Code that knows that Register64 has a '.reg' member on 64-bit systems and '.high' and '.low' members on 32-bit systems, or knows the implications thereof, is #ifdef JS_PUNBOX64. All other code is #if(n)?def JS_64BIT. Coding standards are a little fluid: - In "small" code generating functions (eg emitMultiplyF64, emitQuotientI32, and surrounding functions; most functions fall into this class) where the meaning is obvious: Old school: - if there is a single source + destination register, it is called 'r' - if there is one source and a different destination, they are called 'rs' and 'rd' - if there is one source + destination register and another source register they are called 'r' and 'rs' - if there are two source registers and a destination register they are called 'rs0', 'rs1', and 'rd'. The new thing: - what is called 'r' in the old-school naming scheme is increasingly called 'rsd' in source+dest cases. - Generic temp registers are named /temp[0-9]?/ not /tmp[0-9]?/. - Registers can be named non-generically for their function ('rp' for the 'pointer' register and 'rv' for the 'value' register are typical) and those names may or may not have an 'r' prefix. - "Larger" code generating functions make their own rules. 385214
WasmBaselineCompile.h 3158
WasmBCClass-inl.h 4162
WasmBCClass.h 72329
WasmBCCodegen-inl.h 14900
WasmBCDefs.h 6500
WasmBCFrame.cpp 19215
WasmBCFrame.h 52213
WasmBCMemory.cpp 94408
WasmBCRegDefs-inl.h 3974
WasmBCRegDefs.h 23690
WasmBCRegMgmt-inl.h 12025
WasmBCStk.h 9198
WasmBCStkMgmt-inl.h 31753
WasmBinary.cpp 8977
WasmBinary.h 28785
WasmBuiltinModule.cpp reportOOM 13189
WasmBuiltinModule.h 4848
WasmBuiltinModule.yaml 11578
WasmBuiltins.cpp 78110
WasmBuiltins.h 11612
WasmCode.cpp 44843
WasmCode.h 31097
WasmCodegenConstants.h 3027
WasmCodegenTypes.cpp 9623
WasmCodegenTypes.h 32210
WasmCompile.cpp 34754
WasmCompile.h 4405
WasmCompileArgs.h 8173
WasmConstants.h 29141
WasmContext.h 1244
WasmDebug.cpp 17481
WasmDebug.h [SMDOC] Wasm debug traps There is a single debug trap handler for the process, WasmHandleDebugTrap in WasmBuiltins.cpp. That function is invoked through the Debug Trap Stub, generated by GenerateDebugTrapStub in WasmStubs.cpp. When any function in an instance needs to trap for any reason (enter frame, leave frame, breakpoint, or single-stepping) then a pointer to the Debug Trap Stub is installed in the Instance. Debug-enabled code will look for this pointer and call it if it is not null. WasmHandleDebugTrap may therefore be called very frequently when any function in the instance is being debugged, and must filter the trap against the tables in the DebugState. It can make use of the return address for the call, which identifies the site uniquely. In order to greatly reduce the frequency of calls to the Debug Trap Stub, an array of flag bits, one per function, is attached to the instance. The code at the breakable point calls a shared stub within the function containing the breakable point to check whether the bit is set for the function. If it is not set, the stub can return to its caller immediately; if the bit is set, the stub will jump to the installed Debug Trap Stub. 7249
WasmDebugFrame.cpp static 5951
WasmDebugFrame.h 7316
WasmDump.cpp 7038
WasmDump.h 1914
WasmException.h 1642
WasmExprType.h 9680
WasmFeatures.cpp 11353
WasmFeatures.h 4282
WasmFrame.h 18642
WasmFrameIter.cpp 69564
WasmFrameIter.h 9349
WasmGC.cpp 11826
WasmGC.h 19714
WasmGcObject-inl.h static 14017
WasmGcObject.cpp 25322
WasmGcObject.h 22640
WasmGenerator.cpp limitedSize= 43102
WasmGenerator.h 9175
WasmInitExpr.cpp 20352
WasmInitExpr.h 4200
WasmInstance-inl.h 926
WasmInstance.cpp 127418
WasmInstance.h 27495
WasmInstanceData.h 6155
WasmIonCompile.cpp 313593
WasmIonCompile.h 1823
WasmJS.cpp [SMDOC] WebAssembly code rules (evolving) TlsContext.get() is only to be invoked from functions that have been invoked _directly_ by generated code as cold(!) Builtin calls, from code that is only used by signal handlers, or from helper functions that have been called _directly_ from a simulator. All other code shall pass in a JSContext* to functions that need it, or an Instance* or Instance* since the context is available through them. Code that uses TlsContext.get() shall annotate each such call with the reason why the call is OK. 175527
WasmJS.h 20273
WasmLog.cpp 2017
WasmLog.h 1361
WasmMemory.cpp 15549
WasmMemory.h 8824
WasmModule.cpp 36268
WasmModule.h 8275
WasmModuleTypes.cpp static 5608
WasmModuleTypes.h 21967
WasmOpIter.cpp 27162
WasmOpIter.h 133074
WasmProcess.cpp 14573
WasmProcess.h 2413
WasmRealm.cpp 4928
WasmRealm.h 2770
WasmSerialize.cpp 44832
WasmSerialize.h 11741
WasmShareable.h 2563
WasmSignalHandlers.cpp 36941
WasmSignalHandlers.h 2802
WasmStaticTypeDefs.cpp 1332
WasmStaticTypeDefs.h 1247
WasmStubs.cpp 113427
WasmStubs.h 11375
WasmSummarizeInsn.cpp 53325
WasmSummarizeInsn.h wasm_WasmSummarizeInsn_h 1381
WasmTable.cpp static 14714
WasmTable.h 5229
WasmTypeDecls.h 3016
WasmTypeDef.cpp 19582
WasmTypeDef.h 51803
WasmUtility.h 2427
WasmValidate.cpp 111347
WasmValidate.h 12979
WasmValType.cpp 8835
WasmValType.h 27630
WasmValue.cpp 26655
WasmValue.h 19199