summaryrefslogtreecommitdiff
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-12 09:59:06 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-08-12 09:59:06 +0000
commit596eecd76d28ad02039462b3d090615ed7fb01e2 (patch)
treebcf31ddec1897a71cbab90632420ca34cb1f07b8 /vm_insnhelper.c
parent456dc8bceec09a954aa0ea8f575f63c66ffb4e80 (diff)
* vm.c, vm_insnhelper.c (vm_define_method): move
function place. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18538 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c40
1 files changed, 0 insertions, 40 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index a886685be6..0fe9902418 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -1061,46 +1061,6 @@ vm_get_cvar_base(NODE *cref)
return klass;
}
-static inline void
-vm_define_method(rb_thread_t *th, VALUE obj, ID id, rb_iseq_t *miseq,
- rb_num_t is_singleton, NODE *cref)
-{
- NODE *newbody;
- VALUE klass = cref->nd_clss;
- int noex = cref->nd_visi;
-
- if (NIL_P(klass)) {
- rb_raise(rb_eTypeError, "no class/module to add method");
- }
-
- if (is_singleton) {
- if (FIXNUM_P(obj) || SYMBOL_P(obj)) {
- rb_raise(rb_eTypeError,
- "can't define singleton method \"%s\" for %s",
- rb_id2name(id), rb_obj_classname(obj));
- }
-
- if (OBJ_FROZEN(obj)) {
- rb_error_frozen("object");
- }
-
- klass = rb_singleton_class(obj);
- noex = NOEX_PUBLIC;
- }
-
- /* dup */
- COPY_CREF(miseq->cref_stack, cref);
- miseq->klass = klass;
- miseq->defined_method_id = id;
- newbody = NEW_NODE(RUBY_VM_METHOD_NODE, 0, miseq->self, 0);
- rb_add_method(klass, id, newbody, noex);
-
- if (!is_singleton && noex == NOEX_MODFUNC) {
- rb_add_method(rb_singleton_class(klass), id, newbody, NOEX_PUBLIC);
- }
- INC_VM_STATE_VERSION();
-}
-
static inline NODE *
vm_method_search(VALUE id, VALUE klass, IC ic)
{