/src/hermes/lib/InternalBytecode/InternalBytecode.cpp
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 | 53 | 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 | 53 | alignas(hbc::BYTECODE_ALIGNMENT) static const uint8_t InternalBytecode[] = { |
18 | 53 | #ifdef HERMES_CMAKE_BUILD |
19 | 53 | #include "InternalBytecode.inc" |
20 | | #else |
21 | | #include "hermes/InternalBytecode/InternalBytecode.inc" |
22 | | #endif |
23 | 53 | }; |
24 | | |
25 | 53 | return llvh::makeArrayRef(InternalBytecode, sizeof(InternalBytecode)); |
26 | 53 | } |
27 | | } // namespace vm |
28 | | } // namespace hermes |