}
#endif
case OP_METHOD:
- SvREFCNT_dec(cMETHOPx(o)->op_class_sv);
#ifdef USE_ITHREADS
if (cMETHOPx(o)->op_class_targ) {
pad_swipe(cMETHOPx(o)->op_class_targ, 1);
cMETHOPx(o)->op_class_targ = 0;
}
+#else
+ SvREFCNT_dec(cMETHOPx(o)->op_class_sv);
+ cMETHOPx(o)->op_class_sv = NULL;
#endif
break;
case OP_CONST:
/* Relocate all the METHOP's SVs to the pad for thread safety. */
case OP_METHOD_NAMED:
op_relocate_sv(&cMETHOPx(o)->op_u.op_meth_sv, &o->op_targ);
- case OP_METHOD:
- if (cMETHOPx(o)->op_class_sv)
- op_relocate_sv(&cMETHOPx(o)->op_class_sv, &cMETHOPx(o)->op_class_targ);
break;
#endif
methop->op_next = (OP*)methop;
}
- methop->op_class_sv = NULL;
+#ifdef USE_ITHREADS
methop->op_class_targ = 0;
+#else
+ methop->op_class_sv = NULL;
+#endif
CHANGE_TYPE(methop, type);
methop = (METHOP*) CHECKOP(type, methop);
/* cache const class' name to speedup class method calls */
if (const_class) {
STRLEN len;
+ SV* shared;
const char* str = SvPV(const_class, len);
- if (len) cMETHOPx(cvop)->op_class_sv = newSVpvn_share(
- str, SvUTF8(const_class) ? -len : len, 0
- );
+ if (len) {
+ shared = newSVpvn_share(
+ str, SvUTF8(const_class) ? -len : len, 0
+ );
+#ifdef USE_ITHREADS
+ op_relocate_sv(&shared, &cMETHOPx(cvop)->op_class_targ);
+#else
+ cMETHOPx(cvop)->op_class_sv = shared;
+#endif
+ }
}
break;
}
OP* op_first; /* optree for method name */
SV* op_meth_sv; /* static method name */
} op_u;
- SV* op_class_sv; /* static class name */
+#ifdef USE_ITHREADS
PADOFFSET op_class_targ; /* pad index for class name if threaded */
+#else
+ SV* op_class_sv; /* static class name */
+#endif
};
struct pmop {
# define cSVOPx_svp(v) (cSVOPx(v)->op_sv \
? &cSVOPx(v)->op_sv : &PAD_SVl((v)->op_targ))
# define cMETHOPx_class(v) (cMETHOPx(v)->op_class_targ ? \
- PAD_SVl(cMETHOPx(v)->op_class_targ) : cMETHOPx(v)->op_class_sv)
+ PAD_SVl(cMETHOPx(v)->op_class_targ) : NULL)
#else
# define cGVOPx_gv(o) ((GV*)cSVOPx(o)->op_sv)
# ifndef PERL_CORE