Line | Count | Source |
1 | /* | |
2 | * Copyright (c) Meta Platforms, Inc. and affiliates. | |
3 | * | |
4 | * This source code is licensed under the MIT license found in the | |
5 | * LICENSE file in the root directory of this source tree. | |
6 | */ | |
7 | ||
8 | #include "hermes/InternalBytecode/InternalBytecode.h" | |
9 | #include "hermes/BCGen/HBC/BytecodeFileFormat.h" | |
10 | ||
11 | namespace hermes { | |
12 | namespace vm { | |
13 | ||
14 | 99 | llvh::ArrayRef<uint8_t> getInternalBytecode() { |
15 | // Bytecode is required to be aligned, so ensure we don't fail to load it | |
16 | // at runtime. | |
17 | 99 | alignas(hbc::BYTECODE_ALIGNMENT) static const uint8_t InternalBytecode[] = { |
18 | 99 | #ifdef HERMES_CMAKE_BUILD |
19 | 99 | #include "InternalBytecode.inc" |
20 | #else | |
21 | #include "hermes/InternalBytecode/InternalBytecode.inc" | |
22 | #endif | |
23 | 99 | }; |
24 | ||
25 | 99 | return llvh::makeArrayRef(InternalBytecode, sizeof(InternalBytecode)); |
26 | 99 | } |
27 | } // namespace vm | |
28 | } // namespace hermes |