2024-02-06 12:47:11 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2019 Intel Corporation. All rights reserved.
|
|
|
|
* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __AOT_COMP_OPTION_H__
|
|
|
|
#define __AOT_COMP_OPTION_H__
|
|
|
|
|
2024-10-07 22:35:46 +00:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2024-09-05 13:44:06 +00:00
|
|
|
typedef struct {
|
|
|
|
/* Enables or disables bounds checks for stack frames. When enabled, the AOT
|
|
|
|
* compiler generates code to check if the stack pointer is within the
|
|
|
|
* bounds of the current stack frame (and if not, traps). */
|
|
|
|
bool bounds_checks;
|
|
|
|
|
2024-09-11 08:08:37 +00:00
|
|
|
/* Enables or disables instruction pointer (IP) tracking. */
|
2024-09-05 13:44:06 +00:00
|
|
|
bool ip;
|
|
|
|
|
2024-09-11 08:08:37 +00:00
|
|
|
/* Enables or disables function index in the stack trace. Please note that
|
|
|
|
* function index can be recovered from the instruction pointer using
|
|
|
|
* ip2function.py script, so enabling this feature along with `ip` might
|
|
|
|
* often be redundant.
|
|
|
|
* This option will automatically be enabled for GC and Perf Profiling mode.
|
|
|
|
*/
|
|
|
|
bool func_idx;
|
|
|
|
|
2024-09-05 13:44:06 +00:00
|
|
|
/* Enables or disables tracking instruction pointer of a trap. Only takes
|
2024-09-11 08:08:37 +00:00
|
|
|
* effect when `ip` is enabled. */
|
2024-09-05 13:44:06 +00:00
|
|
|
bool trap_ip;
|
|
|
|
|
|
|
|
/* Enables or disables parameters, locals and stack operands. */
|
|
|
|
bool values;
|
2024-09-10 01:05:23 +00:00
|
|
|
|
|
|
|
/* If enabled, stack frame is generated at the beginning of each
|
|
|
|
* function (frame-per-function mode). Otherwise, stack frame is
|
|
|
|
* generated before each call of a function (frame-per-call mode). */
|
|
|
|
bool frame_per_function;
|
2024-09-05 13:44:06 +00:00
|
|
|
} AOTCallStackFeatures;
|
|
|
|
|
2024-09-10 01:05:23 +00:00
|
|
|
void
|
|
|
|
aot_call_stack_features_init_default(AOTCallStackFeatures *features);
|
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
AOT_STACK_FRAME_OFF = 0,
|
|
|
|
/* Use a small stack frame data structure (AOTTinyFrame) */
|
|
|
|
AOT_STACK_FRAME_TYPE_TINY,
|
|
|
|
/* Use a regular stack frame data structure (AOTFrame) */
|
|
|
|
AOT_STACK_FRAME_TYPE_STANDARD,
|
|
|
|
} AOTStackFrameType;
|
|
|
|
|
2024-02-06 12:47:11 +00:00
|
|
|
typedef struct AOTCompOption {
|
|
|
|
bool is_jit_mode;
|
|
|
|
bool is_indirect_mode;
|
|
|
|
char *target_arch;
|
|
|
|
char *target_abi;
|
|
|
|
char *target_cpu;
|
|
|
|
char *cpu_features;
|
|
|
|
bool is_sgx_platform;
|
|
|
|
bool enable_bulk_memory;
|
|
|
|
bool enable_thread_mgr;
|
|
|
|
bool enable_tail_call;
|
|
|
|
bool enable_simd;
|
|
|
|
bool enable_ref_types;
|
|
|
|
bool enable_gc;
|
|
|
|
bool enable_aux_stack_check;
|
2024-09-10 01:05:23 +00:00
|
|
|
AOTStackFrameType aux_stack_frame_type;
|
2024-09-05 13:44:06 +00:00
|
|
|
AOTCallStackFeatures call_stack_features;
|
2024-02-06 12:47:11 +00:00
|
|
|
bool enable_perf_profiling;
|
|
|
|
bool enable_memory_profiling;
|
|
|
|
bool disable_llvm_intrinsics;
|
|
|
|
bool disable_llvm_lto;
|
|
|
|
bool enable_llvm_pgo;
|
|
|
|
bool enable_stack_estimation;
|
|
|
|
bool quick_invoke_c_api_import;
|
2024-09-29 04:50:59 +00:00
|
|
|
bool enable_shared_heap;
|
2024-02-06 12:47:11 +00:00
|
|
|
char *use_prof_file;
|
|
|
|
uint32_t opt_level;
|
|
|
|
uint32_t size_level;
|
|
|
|
uint32_t output_format;
|
|
|
|
uint32_t bounds_checks;
|
|
|
|
uint32_t stack_bounds_checks;
|
|
|
|
uint32_t segue_flags;
|
|
|
|
char **custom_sections;
|
|
|
|
uint32_t custom_sections_count;
|
|
|
|
const char *stack_usage_file;
|
|
|
|
const char *llvm_passes;
|
|
|
|
const char *builtin_intrinsics;
|
|
|
|
} AOTCompOption, *aot_comp_option_t;
|
|
|
|
|
|
|
|
#endif
|