aot_comp_option.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #ifndef __AOT_COMP_OPTION_H__
  6. #define __AOT_COMP_OPTION_H__
  7. typedef struct {
  8. /* Enables or disables bounds checks for stack frames. When enabled, the AOT
  9. * compiler generates code to check if the stack pointer is within the
  10. * bounds of the current stack frame (and if not, traps). */
  11. bool bounds_checks;
  12. /* Enables or disables instruction pointer (IP) tracking.*/
  13. bool ip;
  14. /* Enables or disables tracking instruction pointer of a trap. Only takes
  15. * effect when `ip` is enabled.*/
  16. bool trap_ip;
  17. /* Enables or disables parameters, locals and stack operands. */
  18. bool values;
  19. /* If enabled, stack frame is generated at the beginning of each
  20. * function (frame-per-function mode). Otherwise, stack frame is
  21. * generated before each call of a function (frame-per-call mode). */
  22. bool frame_per_function;
  23. } AOTCallStackFeatures;
  24. void
  25. aot_call_stack_features_init_default(AOTCallStackFeatures *features);
  26. typedef enum {
  27. AOT_STACK_FRAME_OFF = 0,
  28. /* Use a small stack frame data structure (AOTTinyFrame) */
  29. AOT_STACK_FRAME_TYPE_TINY,
  30. /* Use a regular stack frame data structure (AOTFrame) */
  31. AOT_STACK_FRAME_TYPE_STANDARD,
  32. } AOTStackFrameType;
  33. typedef struct AOTCompOption {
  34. bool is_jit_mode;
  35. bool is_indirect_mode;
  36. char *target_arch;
  37. char *target_abi;
  38. char *target_cpu;
  39. char *cpu_features;
  40. bool is_sgx_platform;
  41. bool enable_bulk_memory;
  42. bool enable_thread_mgr;
  43. bool enable_tail_call;
  44. bool enable_simd;
  45. bool enable_ref_types;
  46. bool enable_gc;
  47. bool enable_aux_stack_check;
  48. AOTStackFrameType aux_stack_frame_type;
  49. AOTCallStackFeatures call_stack_features;
  50. bool enable_perf_profiling;
  51. bool enable_memory_profiling;
  52. bool disable_llvm_intrinsics;
  53. bool disable_llvm_lto;
  54. bool enable_llvm_pgo;
  55. bool enable_stack_estimation;
  56. bool quick_invoke_c_api_import;
  57. char *use_prof_file;
  58. uint32_t opt_level;
  59. uint32_t size_level;
  60. uint32_t output_format;
  61. uint32_t bounds_checks;
  62. uint32_t stack_bounds_checks;
  63. uint32_t segue_flags;
  64. char **custom_sections;
  65. uint32_t custom_sections_count;
  66. const char *stack_usage_file;
  67. const char *llvm_passes;
  68. const char *builtin_intrinsics;
  69. } AOTCompOption, *aot_comp_option_t;
  70. #endif