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; } /**************************************************************************** 214565
AsmJS.h 3817 \ /* 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 2726 1793
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. 345039
WasmBaselineCompile.h 3158
WasmBCClass-inl.h 1752
WasmBCClass.h 67270
WasmBCCodegen-inl.h 14900
WasmBCDefs.h 6351
WasmBCFrame.cpp 18552
WasmBCFrame.h 46527
WasmBCMemory.cpp 83631
WasmBCRegDefs-inl.h 3974
WasmBCRegDefs.h 23589
WasmBCRegMgmt-inl.h 12025
WasmBCStk.h 9198
WasmBCStkMgmt-inl.h 31373
WasmBinary.cpp 8977
WasmBinary.h 27238
WasmBuiltins.cpp 68076
WasmBuiltins.h 10561
WasmCode.cpp 39657
WasmCode.h 29518
WasmCodegenConstants.h 2052
WasmCodegenTypes.cpp 6594
WasmCodegenTypes.h 24586
WasmCompile.cpp 30255
WasmCompile.h 4033
WasmCompileArgs.h 6869
WasmConstants.h 26126
WasmContext.h 1244
WasmDebug.cpp 17388
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. 7181
WasmDebugFrame.cpp static 5741
WasmDebugFrame.h 7285
WasmException.h 962
WasmExprType.h 9680
WasmFrame.h 18630
WasmFrameIter.cpp 62591
WasmFrameIter.h 9096
WasmGC.cpp 10254
WasmGC.h 18103
WasmGcObject.cpp static 24562
WasmGcObject.h Base type for typed objects. 14209
WasmGenerator.cpp limitedSize= 38386
WasmGenerator.h 8722
WasmInitExpr.cpp eager 19076
WasmInitExpr.h 3247
WasmInstance-inl.h 926
WasmInstance.cpp 94680
WasmInstance.h 21041
WasmInstanceData.h 3302
WasmIntrinsic.cpp static 7772
WasmIntrinsic.h 2154
WasmIntrinsic.yaml 7347
WasmIonCompile.cpp 274457
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. 176302
WasmJS.h 23165
WasmLog.cpp 2017
WasmLog.h 1361
WasmMemory.cpp 15498
WasmMemory.h 7997
WasmModule.cpp 37696
WasmModule.h 8413
WasmModuleTypes.cpp static 4907
WasmModuleTypes.h 19824
WasmOpIter.cpp 26295
WasmOpIter.h 118230
WasmProcess.cpp 13367
WasmProcess.h 2286
WasmRealm.cpp 4869
WasmRealm.h 2719
WasmSerialize.cpp 41195
WasmSerialize.h 11165
WasmShareable.h 2563
WasmSignalHandlers.cpp 36695
WasmSignalHandlers.h 2802
WasmStubs.cpp 114546
WasmStubs.h 11375
WasmTable.cpp static 11987
WasmTable.h 4791
WasmTypeDecls.h 3039
WasmTypeDef.cpp 12733
WasmTypeDef.h 37979
WasmUtility.h 2401
WasmValidate.cpp 100645
WasmValidate.h 9988
WasmValType.cpp 5782
WasmValType.h 24677
WasmValue.cpp 20719
WasmValue.h 21200