@@ -516,7 +516,7 @@ rb_yjit_threshold_hit(const rb_iseq_t *iseq, uint64_t entry_calls)
516516static inline rb_jit_func_t
517517yjit_compile (rb_execution_context_t * ec )
518518{
519- const rb_iseq_t * iseq = rb_cfp_iseq (ec -> cfp );
519+ const rb_iseq_t * iseq = CFP_ISEQ (ec -> cfp );
520520 struct rb_iseq_constant_body * body = ISEQ_BODY (iseq );
521521
522522 // Increment the ISEQ's call counter and trigger JIT compilation if not compiled
@@ -536,7 +536,7 @@ yjit_compile(rb_execution_context_t *ec)
536536static inline rb_jit_func_t
537537zjit_compile (rb_execution_context_t * ec )
538538{
539- const rb_iseq_t * iseq = rb_cfp_iseq (ec -> cfp );
539+ const rb_iseq_t * iseq = CFP_ISEQ (ec -> cfp );
540540 struct rb_iseq_constant_body * body = ISEQ_BODY (iseq );
541541
542542 if (body -> jit_entry == NULL ) {
@@ -605,7 +605,7 @@ jit_exec(rb_execution_context_t *ec)
605605static inline rb_jit_func_t
606606jit_compile_exception (rb_execution_context_t * ec )
607607{
608- const rb_iseq_t * iseq = rb_cfp_iseq (ec -> cfp );
608+ const rb_iseq_t * iseq = CFP_ISEQ (ec -> cfp );
609609 struct rb_iseq_constant_body * body = ISEQ_BODY (iseq );
610610
611611#if USE_ZJIT
@@ -941,7 +941,7 @@ rb_control_frame_t *
941941rb_vm_get_binding_creatable_next_cfp (const rb_execution_context_t * ec , const rb_control_frame_t * cfp )
942942{
943943 while (!RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P (ec , cfp )) {
944- if (rb_cfp_has_iseq (cfp )) {
944+ if (CFP_ISEQ (cfp )) {
945945 return (rb_control_frame_t * )cfp ;
946946 }
947947 cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME (cfp );
@@ -1119,7 +1119,7 @@ vm_make_env_each(const rb_execution_context_t * const ec, rb_control_frame_t *co
11191119 }
11201120 }
11211121
1122- const rb_iseq_t * iseq = rb_cfp_iseq (cfp );
1122+ const rb_iseq_t * iseq = CFP_ISEQ (cfp );
11231123 if (!VM_FRAME_RUBYFRAME_P (cfp )) {
11241124 local_size = VM_ENV_DATA_SIZE ;
11251125 }
@@ -1689,8 +1689,8 @@ rb_vm_make_binding(const rb_execution_context_t *ec, const rb_control_frame_t *s
16891689 GetBindingPtr (bindval , bind );
16901690 vm_bind_update_env (bindval , bind , envval );
16911691 RB_OBJ_WRITE (bindval , & bind -> block .as .captured .self , cfp -> self );
1692- RB_OBJ_WRITE (bindval , & bind -> block .as .captured .code .iseq , rb_cfp_iseq (cfp ));
1693- RB_OBJ_WRITE (bindval , & bind -> pathobj , ISEQ_BODY (rb_cfp_iseq (ruby_level_cfp ))-> location .pathobj );
1692+ RB_OBJ_WRITE (bindval , & bind -> block .as .captured .code .iseq , CFP_ISEQ (cfp ));
1693+ RB_OBJ_WRITE (bindval , & bind -> pathobj , ISEQ_BODY (CFP_ISEQ (ruby_level_cfp ))-> location .pathobj );
16941694 bind -> first_lineno = rb_vm_get_sourceline (ruby_level_cfp );
16951695
16961696 return bindval ;
@@ -1997,9 +1997,9 @@ rb_vm_invoke_proc_with_self(rb_execution_context_t *ec, rb_proc_t *proc, VALUE s
19971997VALUE *
19981998rb_vm_svar_lep (const rb_execution_context_t * ec , const rb_control_frame_t * cfp )
19991999{
2000- while (!rb_cfp_has_pc (cfp ) || !rb_cfp_has_iseq (cfp )) {
2000+ while (!CFP_PC (cfp ) || !CFP_ISEQ (cfp )) {
20012001 if (VM_FRAME_TYPE (cfp ) == VM_FRAME_MAGIC_IFUNC ) {
2002- struct vm_ifunc * ifunc = (struct vm_ifunc * )rb_cfp_iseq (cfp );
2002+ struct vm_ifunc * ifunc = (struct vm_ifunc * )CFP_ISEQ (cfp );
20032003 return ifunc -> svar_lep ;
20042004 }
20052005 else {
@@ -2082,7 +2082,7 @@ rb_sourcefile(void)
20822082 const rb_control_frame_t * cfp = rb_vm_get_ruby_level_next_cfp (ec , ec -> cfp );
20832083
20842084 if (cfp ) {
2085- return RSTRING_PTR (rb_iseq_path (rb_cfp_iseq (cfp )));
2085+ return RSTRING_PTR (rb_iseq_path (CFP_ISEQ (cfp )));
20862086 }
20872087 else {
20882088 return 0 ;
@@ -2111,7 +2111,7 @@ rb_source_location(int *pline)
21112111
21122112 if (cfp && VM_FRAME_RUBYFRAME_P (cfp )) {
21132113 if (pline ) * pline = rb_vm_get_sourceline (cfp );
2114- return rb_iseq_path (rb_cfp_iseq (cfp ));
2114+ return rb_iseq_path (CFP_ISEQ (cfp ));
21152115 }
21162116 else {
21172117 if (pline ) * pline = 0 ;
@@ -2593,7 +2593,7 @@ hook_before_rewind(rb_execution_context_t *ec, bool cfp_returning_with_value, in
25932593 return ;
25942594 }
25952595 else {
2596- const rb_iseq_t * iseq = rb_cfp_iseq (ec -> cfp );
2596+ const rb_iseq_t * iseq = CFP_ISEQ (ec -> cfp );
25972597 rb_hook_list_t * local_hooks = NULL ;
25982598 unsigned int local_hooks_cnt = iseq -> aux .exec .local_hooks_cnt ;
25992599 if (RB_UNLIKELY (local_hooks_cnt > 0 )) {
@@ -2889,7 +2889,7 @@ vm_exec_handle_exception(rb_execution_context_t *ec, enum ruby_tag_type state, V
28892889 cont_pc = cont_sp = 0 ;
28902890 catch_iseq = NULL ;
28912891
2892- while (rb_cfp_pc (ec -> cfp ) == 0 || rb_cfp_iseq (ec -> cfp ) == 0 ) {
2892+ while (CFP_PC (ec -> cfp ) == 0 || CFP_ISEQ (ec -> cfp ) == 0 ) {
28932893 if (UNLIKELY (VM_FRAME_TYPE (ec -> cfp ) == VM_FRAME_MAGIC_CFUNC )) {
28942894 EXEC_EVENT_HOOK_AND_POP_FRAME (ec , RUBY_EVENT_C_RETURN , ec -> cfp -> self ,
28952895 rb_vm_frame_method_entry (ec -> cfp )-> def -> original_id ,
@@ -2903,7 +2903,7 @@ vm_exec_handle_exception(rb_execution_context_t *ec, enum ruby_tag_type state, V
29032903 }
29042904
29052905 rb_control_frame_t * const cfp = ec -> cfp ;
2906- epc = rb_cfp_pc (cfp ) - ISEQ_BODY (rb_cfp_iseq (cfp ))-> iseq_encoded ;
2906+ epc = CFP_PC (cfp ) - ISEQ_BODY (CFP_ISEQ (cfp ))-> iseq_encoded ;
29072907
29082908 escape_cfp = NULL ;
29092909 if (state == TAG_BREAK || state == TAG_RETURN ) {
@@ -2916,7 +2916,7 @@ vm_exec_handle_exception(rb_execution_context_t *ec, enum ruby_tag_type state, V
29162916 THROW_DATA_STATE_SET (err , state = TAG_BREAK );
29172917 }
29182918 else {
2919- ct = ISEQ_BODY (rb_cfp_iseq (cfp ))-> catch_table ;
2919+ ct = ISEQ_BODY (CFP_ISEQ (cfp ))-> catch_table ;
29202920 if (ct ) for (i = 0 ; i < ct -> size ; i ++ ) {
29212921 entry = UNALIGNED_MEMBER_PTR (ct , entries [i ]);
29222922 if (entry -> start < epc && entry -> end >= epc ) {
@@ -2950,7 +2950,7 @@ vm_exec_handle_exception(rb_execution_context_t *ec, enum ruby_tag_type state, V
29502950 }
29512951
29522952 if (state == TAG_RAISE ) {
2953- ct = ISEQ_BODY (rb_cfp_iseq (cfp ))-> catch_table ;
2953+ ct = ISEQ_BODY (CFP_ISEQ (cfp ))-> catch_table ;
29542954 if (ct ) for (i = 0 ; i < ct -> size ; i ++ ) {
29552955 entry = UNALIGNED_MEMBER_PTR (ct , entries [i ]);
29562956 if (entry -> start < epc && entry -> end >= epc ) {
@@ -2966,7 +2966,7 @@ vm_exec_handle_exception(rb_execution_context_t *ec, enum ruby_tag_type state, V
29662966 }
29672967 }
29682968 else if (state == TAG_RETRY ) {
2969- ct = ISEQ_BODY (rb_cfp_iseq (cfp ))-> catch_table ;
2969+ ct = ISEQ_BODY (CFP_ISEQ (cfp ))-> catch_table ;
29702970 if (ct ) for (i = 0 ; i < ct -> size ; i ++ ) {
29712971 entry = UNALIGNED_MEMBER_PTR (ct , entries [i ]);
29722972 if (entry -> start < epc && entry -> end >= epc ) {
@@ -2982,7 +2982,7 @@ vm_exec_handle_exception(rb_execution_context_t *ec, enum ruby_tag_type state, V
29822982 escape_cfp = THROW_DATA_CATCH_FRAME (err );
29832983 if (cfp == escape_cfp ) {
29842984 zjit_materialize_frames (cfp );
2985- cfp -> pc = ISEQ_BODY (rb_cfp_iseq (cfp ))-> iseq_encoded + entry -> cont ;
2985+ cfp -> pc = ISEQ_BODY (CFP_ISEQ (cfp ))-> iseq_encoded + entry -> cont ;
29862986 ec -> errinfo = Qnil ;
29872987 return Qundef ;
29882988 }
@@ -3000,7 +3000,7 @@ vm_exec_handle_exception(rb_execution_context_t *ec, enum ruby_tag_type state, V
30003000 /* otherwise = dontcare */
30013001 }[state ];
30023002
3003- ct = ISEQ_BODY (rb_cfp_iseq (cfp ))-> catch_table ;
3003+ ct = ISEQ_BODY (CFP_ISEQ (cfp ))-> catch_table ;
30043004 if (ct ) for (i = 0 ; i < ct -> size ; i ++ ) {
30053005 entry = UNALIGNED_MEMBER_PTR (ct , entries [i ]);
30063006
@@ -3013,7 +3013,7 @@ vm_exec_handle_exception(rb_execution_context_t *ec, enum ruby_tag_type state, V
30133013 }
30143014 else if (entry -> type == type ) {
30153015 zjit_materialize_frames (cfp );
3016- cfp -> pc = ISEQ_BODY (rb_cfp_iseq (cfp ))-> iseq_encoded + entry -> cont ;
3016+ cfp -> pc = ISEQ_BODY (CFP_ISEQ (cfp ))-> iseq_encoded + entry -> cont ;
30173017 cfp -> sp = vm_base_ptr (cfp ) + entry -> sp ;
30183018
30193019 if (state != TAG_REDO ) {
@@ -3027,7 +3027,7 @@ vm_exec_handle_exception(rb_execution_context_t *ec, enum ruby_tag_type state, V
30273027 }
30283028 }
30293029 else {
3030- ct = ISEQ_BODY (rb_cfp_iseq (cfp ))-> catch_table ;
3030+ ct = ISEQ_BODY (CFP_ISEQ (cfp ))-> catch_table ;
30313031 if (ct ) for (i = 0 ; i < ct -> size ; i ++ ) {
30323032 entry = UNALIGNED_MEMBER_PTR (ct , entries [i ]);
30333033 if (entry -> start < epc && entry -> end >= epc ) {
@@ -3049,7 +3049,7 @@ vm_exec_handle_exception(rb_execution_context_t *ec, enum ruby_tag_type state, V
30493049 rb_iseq_check (catch_iseq );
30503050 zjit_materialize_frames (cfp ); // vm_base_ptr looks at cfp->_iseq
30513051 cfp -> sp = vm_base_ptr (cfp ) + cont_sp ;
3052- cfp -> pc = ISEQ_BODY (rb_cfp_iseq (cfp ))-> iseq_encoded + cont_pc ;
3052+ cfp -> pc = ISEQ_BODY (CFP_ISEQ (cfp ))-> iseq_encoded + cont_pc ;
30533053
30543054 /* push block frame */
30553055 cfp -> sp [0 ] = (VALUE )err ;
@@ -3733,7 +3733,7 @@ rb_execution_context_mark(const rb_execution_context_t *ec)
37333733 VM_ASSERT (!!VM_ENV_FLAGS (ep , VM_ENV_FLAG_ESCAPED ) == vm_ep_in_heap_p_ (ec , ep ));
37343734
37353735 rb_gc_mark_movable (cfp -> self );
3736- rb_gc_mark_movable ((VALUE )rb_cfp_iseq (cfp ));
3736+ rb_gc_mark_movable ((VALUE )CFP_ISEQ (cfp ));
37373737 // Mark block_code directly (not through rb_zjit_cfp_block_code)
37383738 // because rb_iterate0 may write a valid ifunc after JIT frame push.
37393739 rb_gc_mark_movable ((VALUE )cfp -> block_code );
@@ -4611,7 +4611,7 @@ rb_vm_set_progname(VALUE filename)
46114611 -- cfp ;
46124612
46134613 filename = rb_str_new_frozen (filename );
4614- rb_iseq_pathobj_set (rb_cfp_iseq (cfp ), filename , rb_iseq_realpath (rb_cfp_iseq (cfp )));
4614+ rb_iseq_pathobj_set (CFP_ISEQ (cfp ), filename , rb_iseq_realpath (CFP_ISEQ (cfp )));
46154615}
46164616
46174617extern const struct st_hash_type rb_fstring_hash_type ;
@@ -4943,7 +4943,7 @@ vm_analysis_operand(int insn, int n, VALUE op)
49434943 HASH_ASET (ihash , INT2FIX (n ), ophash );
49444944 }
49454945 /* intern */
4946- valstr = rb_insn_operand_intern (rb_cfp_iseq (GET_EC ()-> cfp ), insn , n , op , 0 , 0 , 0 , 0 );
4946+ valstr = rb_insn_operand_intern (CFP_ISEQ (GET_EC ()-> cfp ), insn , n , op , 0 , 0 , 0 , 0 );
49474947
49484948 /* set count */
49494949 if (NIL_P (cv = rb_hash_aref (ophash , valstr ))) {
@@ -5145,7 +5145,7 @@ vm_collect_usage_operand(int insn, int n, VALUE op)
51455145 if (RUBY_DTRACE_INSN_OPERAND_ENABLED ()) {
51465146 VALUE valstr ;
51475147
5148- valstr = rb_insn_operand_intern (rb_cfp_iseq (GET_EC ()-> cfp ), insn , n , op , 0 , 0 , 0 , 0 );
5148+ valstr = rb_insn_operand_intern (CFP_ISEQ (GET_EC ()-> cfp ), insn , n , op , 0 , 0 , 0 , 0 );
51495149
51505150 RUBY_DTRACE_INSN_OPERAND (RSTRING_PTR (valstr ), rb_insns_name (insn ));
51515151 RB_GC_GUARD (valstr );
0 commit comments