Refactor interpreter/AOT module instance layout (#1559)
Refactor the layout of interpreter and AOT module instance: - Unify the interp/AOT module instance, use the same WASMModuleInstance/ WASMMemoryInstance/WASMTableInstance data structures for both interpreter and AOT - Make the offset of most fields the same in module instance for both interpreter and AOT, append memory instance structure, global data and table instances to the end of module instance for interpreter mode (like AOT mode) - For extra fields in WASM module instance, use WASMModuleInstanceExtra to create a field `e` for interpreter - Change the LLVM JIT module instance creating process, LLVM JIT uses the WASM module and module instance same as interpreter/Fast-JIT mode. So that Fast JIT and LLVM JIT can access the same data structures, and make it possible to implement the Multi-tier JIT (tier-up from Fast JIT to LLVM JIT) in the future - Unify some APIs: merge some APIs for module instance and memory instance's related operations (only implement one copy) Note that the AOT ABI is same, the AOT file format, AOT relocation types, how AOT code accesses the AOT module instance and so on are kept unchanged. Refer to: https://github.com/bytecodealliance/wasm-micro-runtime/issues/1384
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
# Copyright (C) 2019 Intel Corporation. All rights reserved.
|
||||
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
|
||||
if (NOT DEFINED WAMR_ROOT_DIR)
|
||||
set (WAMR_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../)
|
||||
endif ()
|
||||
@ -50,23 +49,28 @@ if (NOT DEFINED WAMR_BUILD_TARGET)
|
||||
endif ()
|
||||
|
||||
################ optional according to settings ################
|
||||
if (WAMR_BUILD_INTERP EQUAL 1 OR WAMR_BUILD_JIT EQUAL 1
|
||||
OR WAMR_BUILD_FAST_JIT EQUAL 1)
|
||||
if (WAMR_BUILD_FAST_JIT EQUAL 1 OR WAMR_BUILD_JIT EQUAL 1)
|
||||
set (WAMR_BUILD_FAST_INTERP 0)
|
||||
endif ()
|
||||
if (WAMR_BUILD_FAST_JIT EQUAL 1 OR WAMR_BUILD_JIT EQUAL 1)
|
||||
# Enable classic interpreter if Fast JIT or LLVM JIT is enabled
|
||||
set (WAMR_BUILD_INTERP 1)
|
||||
set (WAMR_BUILD_FAST_INTERP 0)
|
||||
endif ()
|
||||
|
||||
if (WAMR_BUILD_INTERP EQUAL 1)
|
||||
include (${IWASM_DIR}/interpreter/iwasm_interp.cmake)
|
||||
endif ()
|
||||
|
||||
if (WAMR_BUILD_FAST_JIT EQUAL 1)
|
||||
include (${IWASM_DIR}/fast-jit/iwasm_fast_jit.cmake)
|
||||
endif ()
|
||||
|
||||
if (WAMR_BUILD_JIT EQUAL 1)
|
||||
# Enable AOT if LLVM JIT is enabled
|
||||
set (WAMR_BUILD_AOT 1)
|
||||
include (${IWASM_DIR}/compilation/iwasm_compl.cmake)
|
||||
endif ()
|
||||
|
||||
if (WAMR_BUILD_AOT EQUAL 1)
|
||||
include (${IWASM_DIR}/aot/iwasm_aot.cmake)
|
||||
if (WAMR_BUILD_JIT EQUAL 1)
|
||||
include (${IWASM_DIR}/compilation/iwasm_compl.cmake)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (NOT WAMR_BUILD_JIT EQUAL 1 AND WAMR_BUILD_FAST_JIT EQUAL 1)
|
||||
include (${IWASM_DIR}/fast-jit/iwasm_fast_jit.cmake)
|
||||
endif ()
|
||||
|
||||
if (WAMR_BUILD_APP_FRAMEWORK EQUAL 1)
|
||||
|
||||
Reference in New Issue
Block a user