Project

General

Profile

Feature #16282 ยป 0001-Wrap-call-data-with-an-IMEMO-object.patch

tenderlovemaking (Aaron Patterson), 10/29/2019 12:13 AM

View differences:

ext/objspace/objspace.c
634 634
	imemo_type_ids[8] = rb_intern("imemo_tmpbuf");
635 635
        imemo_type_ids[9] = rb_intern("imemo_ast");
636 636
        imemo_type_ids[10] = rb_intern("imemo_parser_strterm");
637
        imemo_type_ids[11] = rb_intern("imemo_call_data");
637 638
    }
638 639

  
639 640
    rb_objspace_each_objects(count_imemo_objects_i, (void *)hash);
ext/objspace/objspace_dump.c
208 208
	TYPE_STR(tmpbuf);
209 209
	TYPE_STR(ast);
210 210
	TYPE_STR(parser_strterm);
211
	TYPE_STR(call_data);
211 212
      default:
212 213
	return "unknown";
213 214
#undef TYPE_STR
gc.c
2338 2338
      case imemo_ifunc:
2339 2339
      case imemo_memo:
2340 2340
      case imemo_parser_strterm:
2341
      case imemo_call_data:
2341 2342
        break;
2342 2343
      default:
2343 2344
        /* unreachable */
......
2826 2827
          case imemo_parser_strterm:
2827 2828
            RB_DEBUG_COUNTER_INC(obj_imemo_parser_strterm);
2828 2829
            break;
2830
          case imemo_call_data:
2831
            RB_DEBUG_COUNTER_INC(obj_imemo_call_data);
2832
            break;
2829 2833
	  default:
2830 2834
            /* unreachable */
2831 2835
	    break;
......
5227 5231
      case imemo_parser_strterm:
5228 5232
	rb_strterm_mark(obj);
5229 5233
	return;
5234
      case imemo_call_data:
5235
	return;
5230 5236
#if VM_CHECK_MODE > 0
5231 5237
      default:
5232 5238
	VM_UNREACHABLE(gc_mark_imemo);
......
8095 8101
        break;
8096 8102
      case imemo_parser_strterm:
8097 8103
      case imemo_tmpbuf:
8104
      case imemo_call_data:
8098 8105
        break;
8099 8106
      default:
8100 8107
        rb_bug("not reachable %d", imemo_type(obj));
internal.h
1109 1109
    imemo_iseq           =  7,
1110 1110
    imemo_tmpbuf         =  8,
1111 1111
    imemo_ast            =  9,
1112
    imemo_parser_strterm = 10
1112
    imemo_parser_strterm = 10,
1113
    imemo_call_data      = 11
1113 1114
};
1114 1115
#define IMEMO_MASK   0x0f
1115 1116

  
......
2387 2388
    struct rb_call_cache cc;
2388 2389
    struct rb_call_info ci;
2389 2390
};
2391

  
2390 2392
VALUE rb_funcallv_with_cc(struct rb_call_data*, VALUE, ID, int, const VALUE*)
2391 2393
#if GCC_VERSION_SINCE(3, 3, 0) && defined(__OPTIMIZE__)
2392 2394
__attribute__((__visibility__("default"), __nonnull__(1)))
2393 2395
# define rb_funcallv(recv, mid, argc, argv) \
2394 2396
    __extension__({ \
2395 2397
        static struct rb_call_data rb_funcallv_data = { { 0, }, { 0, }, }; \
2398
        static VALUE wrapper = 0; \
2399
        if (!wrapper) { \
2400
            wrapper = rb_imemo_new(imemo_call_data, 0, 0, 0, (VALUE)&rb_funcallv_data); \
2401
            rb_gc_register_mark_object(wrapper); \
2402
        } \
2396 2403
        rb_funcallv_with_cc(&rb_funcallv_data, recv, mid, argc, argv); \
2397 2404
    })
2398 2405
#endif
2399
-