[前][次][番号順一覧][スレッド一覧]

ruby-changes:50330

From: nobu <ko1@a...>
Date: Sat, 17 Feb 2018 10:30:13 +0900 (JST)
Subject: [ruby-changes:50330] nobu:r62445 (trunk): prefixed functions exported for mjit

nobu	2018-02-17 10:30:05 +0900 (Sat, 17 Feb 2018)

  New Revision: 62445

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62445

  Log:
    prefixed functions exported for mjit

  Modified files:
    trunk/vm_eval.c
    trunk/vm_insnhelper.c
    trunk/vm_insnhelper.h
    trunk/vm_method.c
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 62444)
+++ vm_insnhelper.c	(revision 62445)
@@ -1569,10 +1569,6 @@ static inline VALUE vm_call_method(rb_ex https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1569
 
 static vm_call_handler vm_call_iseq_setup_func(const struct rb_call_info *ci, const int param_size, const int local_size);
 
-extern rb_method_definition_t *method_definition_create(rb_method_type_t type, ID mid);
-extern void method_definition_set(const rb_method_entry_t *me, rb_method_definition_t *def, void *opts);
-extern int rb_method_definition_eq(const rb_method_definition_t *d1, const rb_method_definition_t *d2);
-
 static const rb_iseq_t *
 def_iseq_ptr(rb_method_definition_t *def)
 {
@@ -2034,9 +2030,10 @@ vm_call_opt_send(rb_execution_context_t https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2030
 
     if (!(ci->mid = rb_check_id(&sym))) {
 	if (rb_method_basic_definition_p(CLASS_OF(calling->recv), idMethodMissing)) {
-	    VALUE exc = make_no_method_exception(rb_eNoMethodError, 0, calling->recv,
-						 rb_long2int(calling->argc), &TOPN(i),
-						 ci->flag & (VM_CALL_FCALL|VM_CALL_VCALL));
+	    VALUE exc =
+		rb_make_no_method_exception(rb_eNoMethodError, 0, calling->recv,
+					    rb_long2int(calling->argc), &TOPN(i),
+					    ci->flag & (VM_CALL_FCALL|VM_CALL_VCALL));
 	    rb_exc_raise(exc);
 	}
 	TOPN(i) = rb_str_intern(sym);
@@ -2215,9 +2212,9 @@ aliased_callable_method_entry(const rb_c https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2212
 	    RB_OBJ_WRITE(me, &me->def->body.alias.original_me, cme);
 	}
 	else {
-	    method_definition_set((rb_method_entry_t *)me,
-				  method_definition_create(VM_METHOD_TYPE_ALIAS, me->def->original_id),
-				  (void *)cme);
+	    rb_method_definition_t *def =
+		rb_method_definition_create(VM_METHOD_TYPE_ALIAS, me->def->original_id);
+	    rb_method_definition_set((rb_method_entry_t *)me, def, (void *)cme);
 	}
     }
     else {
Index: vm_insnhelper.h
===================================================================
--- vm_insnhelper.h	(revision 62444)
+++ vm_insnhelper.h	(revision 62445)
@@ -184,8 +184,12 @@ enum vm_regan_acttype { https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.h#L184
 #define GET_GLOBAL_CONSTANT_STATE() (ruby_vm_global_constant_state)
 #define INC_GLOBAL_CONSTANT_STATE() (++ruby_vm_global_constant_state)
 
-extern VALUE make_no_method_exception(VALUE exc, VALUE format, VALUE obj,
-				      int argc, const VALUE *argv, int priv);
+extern rb_method_definition_t *rb_method_definition_create(rb_method_type_t type, ID mid);
+extern void rb_method_definition_set(const rb_method_entry_t *me, rb_method_definition_t *def, void *opts);
+extern int rb_method_definition_eq(const rb_method_definition_t *d1, const rb_method_definition_t *d2);
+
+extern VALUE rb_make_no_method_exception(VALUE exc, VALUE format, VALUE obj,
+					 int argc, const VALUE *argv, int priv);
 
 static inline struct vm_throw_data *
 THROW_DATA_NEW(VALUE val, const rb_control_frame_t *cf, VALUE st)
Index: vm_eval.c
===================================================================
--- vm_eval.c	(revision 62444)
+++ vm_eval.c	(revision 62445)
@@ -640,8 +640,8 @@ rb_method_missing(int argc, const VALUE https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L640
 }
 
 MJIT_FUNC_EXPORTED VALUE
-make_no_method_exception(VALUE exc, VALUE format, VALUE obj,
-			 int argc, const VALUE *argv, int priv)
+rb_make_no_method_exception(VALUE exc, VALUE format, VALUE obj,
+			    int argc, const VALUE *argv, int priv)
 {
     int n = 0;
     enum {
@@ -700,8 +700,8 @@ raise_method_missing(rb_execution_contex https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L700
     }
 
     {
-	exc = make_no_method_exception(exc, format, obj, argc, argv,
-				       last_call_status & (MISSING_FCALL|MISSING_VCALL));
+	exc = rb_make_no_method_exception(exc, format, obj, argc, argv,
+					  last_call_status & (MISSING_FCALL|MISSING_VCALL));
 	if (!(last_call_status & MISSING_MISSING)) {
 	    rb_vm_pop_cfunc_frame();
 	}
@@ -891,9 +891,9 @@ send_internal(int argc, const VALUE *arg https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L891
     id = rb_check_id(&vid);
     if (!id) {
 	if (rb_method_basic_definition_p(CLASS_OF(recv), idMethodMissing)) {
-	    VALUE exc = make_no_method_exception(rb_eNoMethodError, 0,
-						 recv, argc, argv,
-						 scope != CALL_PUBLIC);
+	    VALUE exc = rb_make_no_method_exception(rb_eNoMethodError, 0,
+						    recv, argc, argv,
+						    scope != CALL_PUBLIC);
 	    rb_exc_raise(exc);
 	}
 	if (!SYMBOL_P(*argv)) {
Index: vm_method.c
===================================================================
--- vm_method.c	(revision 62444)
+++ vm_method.c	(revision 62445)
@@ -224,7 +224,7 @@ setup_method_cfunc_struct(rb_method_cfun https://github.com/ruby/ruby/blob/trunk/vm_method.c#L224
 }
 
 MJIT_FUNC_EXPORTED void
-method_definition_set(const rb_method_entry_t *me, rb_method_definition_t *def, void *opts)
+rb_method_definition_set(const rb_method_entry_t *me, rb_method_definition_t *def, void *opts)
 {
     *(rb_method_definition_t **)&me->def = def;
 
@@ -338,7 +338,7 @@ method_definition_reset(const rb_method_ https://github.com/ruby/ruby/blob/trunk/vm_method.c#L338
 }
 
 MJIT_FUNC_EXPORTED rb_method_definition_t *
-method_definition_create(rb_method_type_t type, ID mid)
+rb_method_definition_create(rb_method_type_t type, ID mid)
 {
     rb_method_definition_t *def;
     def = ZALLOC(rb_method_definition_t);
@@ -429,8 +429,8 @@ rb_method_entry_complement_defined_class https://github.com/ruby/ruby/blob/trunk/vm_method.c#L429
     METHOD_ENTRY_FLAGS_COPY(me, src_me);
     METHOD_ENTRY_COMPLEMENTED_SET(me);
     if (!def) {
-	def = method_definition_create(VM_METHOD_TYPE_REFINED, called_id);
-	method_definition_set(me, def, &refined);
+	def = rb_method_definition_create(VM_METHOD_TYPE_REFINED, called_id);
+	rb_method_definition_set(me, def, &refined);
     }
 
     VM_ASSERT(RB_TYPE_P(me->owner, T_MODULE));
@@ -460,6 +460,7 @@ make_method_entry_refined(VALUE owner, r https://github.com/ruby/ruby/blob/trunk/vm_method.c#L460
 	    struct rb_method_entry_struct *orig_me;
 	    VALUE owner;
 	} refined;
+	rb_method_definition_t *def;
 
 	rb_vm_check_redefinition_opt_method(me, me->owner);
 
@@ -471,7 +472,8 @@ make_method_entry_refined(VALUE owner, r https://github.com/ruby/ruby/blob/trunk/vm_method.c#L472
 	METHOD_ENTRY_FLAGS_COPY(refined.orig_me, me);
 	refined.owner = owner;
 
-	method_definition_set(me, method_definition_create(VM_METHOD_TYPE_REFINED, me->called_id), (void *)&refined);
+	def = rb_method_definition_create(VM_METHOD_TYPE_REFINED, me->called_id);
+	rb_method_definition_set(me, def, (void *)&refined);
 	METHOD_ENTRY_VISI_SET(me, METHOD_VISI_PUBLIC);
     }
 }
@@ -593,8 +595,8 @@ rb_method_entry_make(VALUE klass, ID mid https://github.com/ruby/ruby/blob/trunk/vm_method.c#L595
 
     /* create method entry */
     me = rb_method_entry_create(mid, defined_class, visi, NULL);
-    if (def == NULL) def = method_definition_create(type, original_id);
-    method_definition_set(me, def, opts);
+    if (def == NULL) def = rb_method_definition_create(type, original_id);
+    rb_method_definition_set(me, def, opts);
 
     rb_clear_method_cache_by_class(klass);
 

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]