aboutsummaryrefslogtreecommitdiffstats
path: root/insns.def
diff options
context:
space:
mode:
Diffstat (limited to 'insns.def')
-rw-r--r--insns.def33
1 files changed, 20 insertions, 13 deletions
diff --git a/insns.def b/insns.def
index 96614b2a36..c971026cf6 100644
--- a/insns.def
+++ b/insns.def
@@ -236,7 +236,7 @@ getclassvariable
/* "class variable access from toplevel" warning can be hooked. */
// attr bool leaf = false; /* has rb_warning() */
{
- val = rb_cvar_get(vm_get_cvar_base(rb_vm_get_cref(GET_EP()), GET_CFP()), id);
+ val = rb_cvar_get(vm_get_cvar_base(vm_get_cref(GET_EP()), GET_CFP()), id);
}
/* Set value of class variable id of klass as val. */
@@ -249,7 +249,7 @@ setclassvariable
// attr bool leaf = false; /* has rb_warning() */
{
vm_ensure_not_refinement_module(GET_SELF());
- rb_cvar_set(vm_get_cvar_base(rb_vm_get_cref(GET_EP()), GET_CFP()), id, val);
+ rb_cvar_set(vm_get_cvar_base(vm_get_cref(GET_EP()), GET_CFP()), id, val);
}
/* Get constant variable id. If klass is Qnil, constants
@@ -358,17 +358,6 @@ putspecialobject
val = vm_get_special_object(GET_EP(), type);
}
-/* put iseq value. */
-DEFINE_INSN
-putiseq
-(ISEQ iseq)
-()
-(VALUE ret)
-// attr bool handles_sp = false; /* of course it doesn't */
-{
- ret = (VALUE)iseq;
-}
-
/* put string val. string will be copied. */
DEFINE_INSN
putstring
@@ -748,6 +737,24 @@ defineclass
NEXT_INSN();
}
+DEFINE_INSN
+definemethod
+(ID id, ISEQ iseq)
+()
+()
+{
+ vm_define_method(ec, Qnil, id, (VALUE)iseq, FALSE);
+}
+
+DEFINE_INSN
+definesmethod
+(ID id, ISEQ iseq)
+(VALUE obj)
+()
+{
+ vm_define_method(ec, obj, id, (VALUE)iseq, TRUE);
+}
+
/**********************************************************/
/* deal with control flow 2: method/iterator */
/**********************************************************/