2023-03-07 10:17:25 +03:00
|
|
|
// This file is parsed by tool/rjit/generate.rb to generate rjit_c.rb
|
2023-03-07 10:15:30 +03:00
|
|
|
#ifndef RJIT_C_H
|
|
|
|
#define RJIT_C_H
|
2022-09-05 07:53:46 +03:00
|
|
|
|
|
|
|
#include "ruby/internal/config.h"
|
2023-02-14 10:57:40 +03:00
|
|
|
#include "internal/string.h"
|
2023-03-05 10:20:54 +03:00
|
|
|
#include "internal/struct.h"
|
2023-03-03 10:44:57 +03:00
|
|
|
#include "internal/variable.h"
|
2022-09-05 07:53:46 +03:00
|
|
|
#include "vm_core.h"
|
|
|
|
#include "vm_callinfo.h"
|
|
|
|
#include "builtin.h"
|
2022-11-30 08:32:16 +03:00
|
|
|
#include "ccan/list/list.h"
|
2023-03-07 10:17:25 +03:00
|
|
|
#include "rjit.h"
|
2022-10-03 18:14:32 +03:00
|
|
|
#include "shape.h"
|
2022-09-05 07:53:46 +03:00
|
|
|
|
2023-03-07 10:17:25 +03:00
|
|
|
extern uint8_t *rb_rjit_mem_block;
|
2022-12-12 08:42:25 +03:00
|
|
|
|
2023-03-07 10:17:25 +03:00
|
|
|
#define RJIT_RUNTIME_COUNTERS(...) struct rb_rjit_runtime_counters { size_t __VA_ARGS__; };
|
2023-03-07 10:15:30 +03:00
|
|
|
RJIT_RUNTIME_COUNTERS(
|
2023-03-07 10:17:25 +03:00
|
|
|
rjit_insns_count,
|
2023-02-07 02:07:58 +03:00
|
|
|
|
2023-03-22 08:12:43 +03:00
|
|
|
send_args_splat_kw_splat,
|
2023-02-08 12:48:32 +03:00
|
|
|
send_args_splat,
|
2023-03-22 08:55:23 +03:00
|
|
|
send_args_splat_not_array,
|
|
|
|
send_args_splat_length_not_equal,
|
2023-03-26 08:13:35 +03:00
|
|
|
send_args_splat_cfunc_var_args,
|
2023-03-22 08:55:23 +03:00
|
|
|
send_args_splat_arity_error,
|
|
|
|
send_args_splat_ruby2_hash,
|
2023-04-02 22:56:27 +03:00
|
|
|
send_args_splat_cfunc_zuper,
|
|
|
|
send_args_splat_cfunc_ruby2_keywords,
|
2023-02-07 02:07:58 +03:00
|
|
|
send_kw_splat,
|
2023-02-08 12:48:32 +03:00
|
|
|
send_kwarg,
|
2023-03-22 08:12:43 +03:00
|
|
|
send_klass_megamorphic,
|
2023-02-07 02:07:58 +03:00
|
|
|
send_missing_cme,
|
|
|
|
send_private,
|
2023-03-04 08:50:49 +03:00
|
|
|
send_protected_check_failed,
|
2023-02-07 02:07:58 +03:00
|
|
|
send_tailcall,
|
2023-02-16 10:43:53 +03:00
|
|
|
send_notimplemented,
|
|
|
|
send_missing,
|
2023-02-09 01:24:10 +03:00
|
|
|
send_bmethod,
|
|
|
|
send_alias,
|
2023-02-16 10:43:53 +03:00
|
|
|
send_undef,
|
2023-02-09 01:24:10 +03:00
|
|
|
send_zsuper,
|
|
|
|
send_refined,
|
2023-02-10 01:38:41 +03:00
|
|
|
send_stackoverflow,
|
2023-02-10 08:49:35 +03:00
|
|
|
send_arity,
|
2023-02-11 08:06:02 +03:00
|
|
|
send_c_tracing,
|
2023-03-19 08:57:31 +03:00
|
|
|
send_is_a_class_mismatch,
|
2023-03-19 09:13:25 +03:00
|
|
|
send_instance_of_class_mismatch,
|
2023-04-02 21:07:50 +03:00
|
|
|
send_keywords,
|
2023-02-07 02:07:58 +03:00
|
|
|
|
2023-02-25 01:48:02 +03:00
|
|
|
send_blockiseq,
|
|
|
|
send_block_handler,
|
2023-03-01 09:50:04 +03:00
|
|
|
send_block_setup,
|
2023-03-05 00:39:04 +03:00
|
|
|
send_block_not_nil,
|
2023-03-05 08:13:01 +03:00
|
|
|
send_block_not_proxy,
|
2023-04-02 21:01:23 +03:00
|
|
|
send_block_arg,
|
2023-02-25 01:48:02 +03:00
|
|
|
|
2023-03-05 08:35:45 +03:00
|
|
|
send_iseq_kwparam,
|
2023-04-02 03:24:06 +03:00
|
|
|
send_iseq_accepts_no_kwarg,
|
|
|
|
send_iseq_has_opt,
|
|
|
|
send_iseq_has_kwrest,
|
2023-03-28 07:58:50 +03:00
|
|
|
send_iseq_ruby2_keywords,
|
|
|
|
send_iseq_has_rest_and_captured,
|
2023-04-02 07:47:28 +03:00
|
|
|
send_iseq_has_rest_and_kw_supplied,
|
2023-03-28 07:58:50 +03:00
|
|
|
send_iseq_has_no_kw,
|
|
|
|
send_iseq_zsuper,
|
|
|
|
send_iseq_materialized_block,
|
|
|
|
send_iseq_has_rest,
|
|
|
|
send_iseq_block_arg0_splat,
|
|
|
|
send_iseq_kw_call,
|
|
|
|
send_iseq_splat,
|
|
|
|
send_iseq_has_rest_and_optional,
|
|
|
|
send_iseq_arity_error,
|
|
|
|
send_iseq_missing_optional_kw,
|
2023-04-02 10:03:24 +03:00
|
|
|
send_iseq_too_many_kwargs,
|
|
|
|
send_iseq_kwargs_mismatch,
|
2023-04-02 20:46:27 +03:00
|
|
|
send_iseq_splat_with_kw,
|
|
|
|
send_iseq_splat_arity_error,
|
2023-04-03 00:44:40 +03:00
|
|
|
send_iseq_has_rest_and_splat_not_equal,
|
2023-02-10 03:25:06 +03:00
|
|
|
|
|
|
|
send_cfunc_variadic,
|
|
|
|
send_cfunc_too_many_args,
|
2023-02-15 10:44:44 +03:00
|
|
|
send_cfunc_ruby_array_varg,
|
2023-04-02 22:56:27 +03:00
|
|
|
send_cfunc_splat_with_kw,
|
|
|
|
send_cfunc_tracing,
|
|
|
|
send_cfunc_argc_mismatch,
|
|
|
|
send_cfunc_toomany_args,
|
2023-02-10 03:25:06 +03:00
|
|
|
|
2023-03-27 03:41:05 +03:00
|
|
|
send_attrset_splat,
|
|
|
|
send_attrset_kwarg,
|
|
|
|
send_attrset_method,
|
|
|
|
|
2023-02-09 01:36:55 +03:00
|
|
|
send_ivar_splat,
|
|
|
|
send_ivar_opt_send,
|
|
|
|
|
2023-02-17 09:29:58 +03:00
|
|
|
send_optimized_send_no_args,
|
|
|
|
send_optimized_send_not_sym_or_str,
|
2023-03-02 10:29:32 +03:00
|
|
|
send_optimized_send_mid_class_changed,
|
|
|
|
send_optimized_send_mid_id_changed,
|
2023-02-17 09:29:58 +03:00
|
|
|
send_optimized_send_null_mid,
|
|
|
|
send_optimized_send_send,
|
2023-03-05 08:35:45 +03:00
|
|
|
send_optimized_call_block,
|
|
|
|
send_optimized_call_kwarg,
|
|
|
|
send_optimized_call_splat,
|
2023-03-05 10:20:54 +03:00
|
|
|
send_optimized_struct_aref_error,
|
2023-02-17 09:29:58 +03:00
|
|
|
|
2023-03-05 09:42:03 +03:00
|
|
|
send_optimized_block_call,
|
|
|
|
send_optimized_struct_aset,
|
|
|
|
|
2023-03-05 10:20:54 +03:00
|
|
|
send_bmethod_not_iseq,
|
|
|
|
send_bmethod_blockarg,
|
2023-03-05 09:42:03 +03:00
|
|
|
|
2023-02-25 01:48:02 +03:00
|
|
|
invokesuper_me_changed,
|
2023-04-02 21:07:50 +03:00
|
|
|
invokesuper_block,
|
2023-02-25 01:48:02 +03:00
|
|
|
|
2023-03-13 08:27:43 +03:00
|
|
|
invokeblock_none,
|
|
|
|
invokeblock_symbol,
|
|
|
|
invokeblock_proc,
|
2023-03-13 08:27:43 +03:00
|
|
|
invokeblock_tag_changed,
|
|
|
|
invokeblock_iseq_block_changed,
|
2023-03-20 07:49:51 +03:00
|
|
|
invokeblock_iseq_arity,
|
|
|
|
invokeblock_iseq_arg0_splat,
|
2023-03-20 09:19:58 +03:00
|
|
|
invokeblock_ifunc_args_splat,
|
|
|
|
invokeblock_ifunc_kw_splat,
|
2023-04-02 10:03:24 +03:00
|
|
|
invokeblock_iseq_arg0_args_splat,
|
|
|
|
invokeblock_iseq_arg0_has_kw,
|
2023-03-13 08:27:43 +03:00
|
|
|
|
2023-02-08 11:47:01 +03:00
|
|
|
getivar_megamorphic,
|
2023-02-08 10:32:13 +03:00
|
|
|
getivar_not_heap,
|
2023-02-08 01:42:58 +03:00
|
|
|
getivar_special_const,
|
|
|
|
getivar_too_complex,
|
|
|
|
|
2023-02-14 09:23:22 +03:00
|
|
|
optaref_arg_not_fixnum,
|
2023-02-08 22:10:04 +03:00
|
|
|
optaref_argc_not_one,
|
2023-02-14 09:23:22 +03:00
|
|
|
optaref_recv_not_array,
|
|
|
|
optaref_recv_not_hash,
|
2023-02-08 22:10:04 +03:00
|
|
|
optaref_send,
|
|
|
|
|
2023-02-15 10:48:25 +03:00
|
|
|
optgetconst_not_cached,
|
|
|
|
optgetconst_cref,
|
2023-03-04 09:14:15 +03:00
|
|
|
optgetconst_cache_miss,
|
2023-02-15 10:48:25 +03:00
|
|
|
|
2023-03-03 08:14:26 +03:00
|
|
|
setivar_frozen,
|
|
|
|
setivar_not_heap,
|
|
|
|
setivar_megamorphic,
|
2023-03-03 10:44:57 +03:00
|
|
|
setivar_too_complex,
|
2023-03-03 08:14:26 +03:00
|
|
|
|
2023-02-16 08:26:04 +03:00
|
|
|
expandarray_splat,
|
|
|
|
expandarray_postarg,
|
|
|
|
expandarray_not_array,
|
|
|
|
expandarray_rhs_too_small,
|
|
|
|
|
2023-03-04 08:29:20 +03:00
|
|
|
getblockpp_block_param_modified,
|
|
|
|
getblockpp_block_handler_none,
|
|
|
|
getblockpp_not_gc_guarded,
|
|
|
|
getblockpp_not_iseq_block,
|
|
|
|
|
2023-02-07 11:00:09 +03:00
|
|
|
compiled_block_count
|
2022-12-27 09:46:40 +03:00
|
|
|
)
|
2023-03-07 10:15:30 +03:00
|
|
|
#undef RJIT_RUNTIME_COUNTERS
|
2023-03-07 10:17:25 +03:00
|
|
|
extern struct rb_rjit_runtime_counters rb_rjit_counters;
|
2022-12-27 09:46:40 +03:00
|
|
|
|
2023-03-07 10:15:30 +03:00
|
|
|
#endif /* RJIT_C_H */
|