aot_emit_gc.h 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. /*
  2. * Copyright (C) 2019 Intel Corporation. All rights reserved.
  3. * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. */
  5. #ifndef _AOT_EMIT_GC_H_
  6. #define _AOT_EMIT_GC_H_
  7. #include "aot_compiler.h"
  8. #include "aot_runtime.h"
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. #if WASM_ENABLE_GC != 0
  13. bool
  14. aot_call_aot_create_func_obj(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  15. LLVMValueRef func_idx, LLVMValueRef *p_gc_obj);
  16. bool
  17. aot_call_aot_obj_is_instance_of(AOTCompContext *comp_ctx,
  18. AOTFuncContext *func_ctx, LLVMValueRef gc_obj,
  19. LLVMValueRef heap_type, LLVMValueRef *castable);
  20. bool
  21. aot_call_wasm_obj_is_type_of(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  22. LLVMValueRef gc_obj, LLVMValueRef heap_type,
  23. LLVMValueRef *castable);
  24. bool
  25. aot_call_aot_rtt_type_new(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  26. LLVMValueRef type_index, LLVMValueRef *rtt_type);
  27. bool
  28. aot_compile_op_ref_as_non_null(AOTCompContext *comp_ctx,
  29. AOTFuncContext *func_ctx);
  30. bool
  31. aot_compile_op_struct_new(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  32. uint32 type_index, bool init_with_default);
  33. bool
  34. aot_compile_op_struct_get(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  35. uint32 type_index, uint32 field_idx, bool sign);
  36. bool
  37. aot_compile_op_struct_set(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  38. uint32 type_index, uint32 field_idx);
  39. bool
  40. aot_compile_op_array_new(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  41. uint32 type_index, bool init_with_default,
  42. bool fixed_size, uint32 array_len);
  43. bool
  44. aot_compile_op_array_new_data(AOTCompContext *comp_ctx,
  45. AOTFuncContext *func_ctx, uint32 type_index,
  46. uint32 data_seg_index);
  47. bool
  48. aot_array_obj_length(AOTCompContext *comp_ctx, LLVMValueRef array_obj,
  49. LLVMValueRef *p_array_len);
  50. bool
  51. aot_array_obj_elem_addr(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  52. LLVMValueRef array_obj, LLVMValueRef elem_idx,
  53. LLVMValueRef *p_elem_data, uint8 array_elem_type);
  54. bool
  55. aot_compile_op_array_get(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  56. uint32 type_index, bool sign);
  57. bool
  58. aot_compile_op_array_set(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  59. uint32 type_index);
  60. bool
  61. aot_compile_op_array_fill(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  62. uint32 type_index);
  63. bool
  64. aot_compile_op_array_copy(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  65. uint32 type_index, uint32 src_type_index);
  66. bool
  67. aot_compile_op_array_len(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx);
  68. bool
  69. aot_compile_op_i31_new(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx);
  70. bool
  71. aot_compile_op_i31_get(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  72. bool sign);
  73. bool
  74. aot_compile_op_ref_test(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  75. int32 heap_type, bool nullable);
  76. bool
  77. aot_compile_op_ref_cast(AOTCompContext *comp_ctx, AOTFuncContext *func_ctx,
  78. int32 heap_type, bool nullable);
  79. bool
  80. aot_compile_op_extern_internalize(AOTCompContext *comp_ctx,
  81. AOTFuncContext *func_ctx);
  82. bool
  83. aot_compile_op_extern_externalize(AOTCompContext *comp_ctx,
  84. AOTFuncContext *func_ctx);
  85. #endif
  86. #ifdef __cplusplus
  87. } /* end of extern "C" */
  88. #endif
  89. #endif /* end of _AOT_EMIT_GC_H_ */