diff options
author | Michaël Zasso <targos@protonmail.com> | 2018-03-07 08:54:53 +0100 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2018-03-07 16:48:52 +0100 |
commit | 88786fecff336342a56e6f2e7ff3b286be716e47 (patch) | |
tree | 92e6ba5b8ac8dae1a058988d20c9d27bfa654390 /deps/v8/src/wasm/wasm-constants.h | |
parent | 4e86f9b5ab83cbabf43839385bf383e6a7ef7d19 (diff) | |
download | node-new-88786fecff336342a56e6f2e7ff3b286be716e47.tar.gz |
deps: update V8 to 6.5.254.31
PR-URL: https://github.com/nodejs/node/pull/18453
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Yang Guo <yangguo@chromium.org>
Reviewed-By: Ali Ijaz Sheikh <ofrobots@google.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Diffstat (limited to 'deps/v8/src/wasm/wasm-constants.h')
-rw-r--r-- | deps/v8/src/wasm/wasm-constants.h | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/deps/v8/src/wasm/wasm-constants.h b/deps/v8/src/wasm/wasm-constants.h new file mode 100644 index 0000000000..5e7ce1e4f5 --- /dev/null +++ b/deps/v8/src/wasm/wasm-constants.h @@ -0,0 +1,83 @@ +// Copyright 2015 the V8 project authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef V8_WASM_CONSTANTS_H_ +#define V8_WASM_CONSTANTS_H_ + +namespace v8 { +namespace internal { +namespace wasm { + +// Binary encoding of the module header. +constexpr uint32_t kWasmMagic = 0x6d736100; +constexpr uint32_t kWasmVersion = 0x01; + +// Binary encoding of local types. +enum ValueTypeCode : uint8_t { + kLocalVoid = 0x40, + kLocalI32 = 0x7f, + kLocalI64 = 0x7e, + kLocalF32 = 0x7d, + kLocalF64 = 0x7c, + kLocalS128 = 0x7b +}; +// Binary encoding of other types. +constexpr uint8_t kWasmFunctionTypeCode = 0x60; +constexpr uint8_t kWasmAnyFunctionTypeCode = 0x70; + +// Binary encoding of import/export kinds. +enum ImportExportKindCode : uint8_t { + kExternalFunction = 0, + kExternalTable = 1, + kExternalMemory = 2, + kExternalGlobal = 3 +}; + +// Binary encoding of maximum and shared flags for memories. +enum MaximumFlag : uint8_t { kNoMaximumFlag = 0, kHasMaximumFlag = 1 }; + +enum MemoryFlags : uint8_t { + kNoMaximum = 0, + kMaximum = 1, + kSharedNoMaximum = 2, + kSharedAndMaximum = 3 +}; + +// Binary encoding of sections identifiers. +enum SectionCode : int8_t { + kUnknownSectionCode = 0, // code for unknown sections + kTypeSectionCode = 1, // Function signature declarations + kImportSectionCode = 2, // Import declarations + kFunctionSectionCode = 3, // Function declarations + kTableSectionCode = 4, // Indirect function table and other tables + kMemorySectionCode = 5, // Memory attributes + kGlobalSectionCode = 6, // Global declarations + kExportSectionCode = 7, // Exports + kStartSectionCode = 8, // Start function declaration + kElementSectionCode = 9, // Elements section + kCodeSectionCode = 10, // Function code + kDataSectionCode = 11, // Data segments + kNameSectionCode = 12, // Name section (encoded as a string) + kExceptionSectionCode = 13, // Exception section + + // Helper values + kFirstSectionInModule = kTypeSectionCode, + kLastKnownModuleSection = kExceptionSectionCode, +}; + +// Binary encoding of name section kinds. +enum NameSectionKindCode : uint8_t { kModule = 0, kFunction = 1, kLocal = 2 }; + +constexpr uint32_t kWasmPageSize = 0x10000; +constexpr int kInvalidExceptionTag = -1; + +// TODO(wasm): Wrap WasmCodePosition in a struct. +using WasmCodePosition = int; +constexpr WasmCodePosition kNoCodePosition = -1; + +} // namespace wasm +} // namespace internal +} // namespace v8 + +#endif // V8_WASM_CONSTANTS_H_ |