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; } /**************************************************************************** 212388
AsmJS.h 3566
cranelift 6 \ /* 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 2725 1896
TypedObject-inl.h static 794
TypedObject.cpp static 23143
TypedObject.h Base type for typed objects. 9241
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. 336115
WasmBaselineCompile.h 3158
WasmBCClass-inl.h 2049
WasmBCClass.h 65448
WasmBCCodegen-inl.h 14643
WasmBCDefs.h 6350
WasmBCFrame.cpp 18551
WasmBCFrame.h 46527
WasmBCMemory.cpp 83691
WasmBCRegDefs-inl.h 3974
WasmBCRegDefs.h 23559
WasmBCRegMgmt-inl.h 12075
WasmBCStk.h 6755
WasmBCStkMgmt-inl.h 31373
WasmBinary.cpp 8977
WasmBinary.h 31036
WasmBuiltins.cpp 67633
WasmBuiltins.h 10435
WasmCode.cpp 41491
WasmCode.h 30336
WasmCodegenConstants.h 2052
WasmCodegenTypes.cpp 6896
WasmCodegenTypes.h 24286
WasmCompile.cpp 31278
WasmCompile.h 4033
WasmCompileArgs.h 7210
WasmConstants.h 28456
WasmContext.h 1244
WasmCraneliftCompile.cpp 26067
WasmCraneliftCompile.h 1881
WasmDebug.cpp 17329
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. 7466
WasmDebugFrame.cpp static 5671
WasmDebugFrame.h 7537
WasmException.h 962
WasmExprType.h 9562
WasmFrame.h 19389
WasmFrameIter.cpp 64990
WasmFrameIter.h 9058
WasmGC.cpp 10254
WasmGC.h 18103
WasmGenerator.cpp limitedSize= 41474
WasmGenerator.h 9223
WasmInitExpr.cpp eager 14977
WasmInitExpr.h 3194
WasmInstance-inl.h 926
WasmInstance.cpp 87161
WasmInstance.h 20417
WasmInstanceData.h 3302
WasmIntrinsic.cpp static 7696
WasmIntrinsic.h 2154
WasmIntrinsic.yaml 7347
WasmIonCompile.cpp 223801
WasmIonCompile.h 1524
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. 181868
WasmJS.h 23433
WasmLog.cpp 2017
WasmLog.h 1361
WasmMemory.cpp 16739
WasmMemory.h 7763
WasmModule.cpp 37216
WasmModule.h 8470
WasmModuleTypes.cpp static 4907
WasmModuleTypes.h 20097
WasmOpIter.cpp 24513
WasmOpIter.h 102997
WasmProcess.cpp 13311
WasmProcess.h 2286
WasmRealm.cpp 4869
WasmRealm.h 2719
WasmSerialize.cpp 36753
WasmSerialize.h 10253
WasmShareable.h 2563
WasmSignalHandlers.cpp 36273
WasmSignalHandlers.h 2802
WasmStubs.cpp 116460
WasmStubs.h 11343
WasmTable.cpp static 11630
WasmTable.h 4620
WasmTypeDecls.h 3347
WasmTypeDef.cpp 17477
WasmTypeDef.h 28167
WasmUtility.h 2401
WasmValidate.cpp 100580
WasmValidate.h 9407
WasmValType.cpp 4614
WasmValType.h 20416
WasmValue.cpp 19889
WasmValue.h 20267