From 940cb80d04d066d4fedfc4486ab57e435ee74514 Mon Sep 17 00:00:00 2001 From: Malcolm Beattie Date: Mon, 2 Feb 1998 15:51:39 +0000 Subject: Introduced thr->threadsvp and THREADSV() for faster per-thread variables. Moved threadnum to a per-interpreter variable and made dTHR and lock/unlock of sv_mutex bypass the get/lock unless more than one thread may be running. Minor tweaks to Thread.xs. p4raw-id: //depot/perl@453 --- pp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pp.c') diff --git a/pp.c b/pp.c index 7864089313..765f10b702 100644 --- a/pp.c +++ b/pp.c @@ -4314,7 +4314,7 @@ PP(pp_threadsv) if (op->op_private & OPpLVAL_INTRO) PUSHs(*save_threadsv(op->op_targ)); else - PUSHs(*av_fetch(thr->threadsv, op->op_targ, FALSE)); + PUSHs(THREADSV(op->op_targ)); RETURN; #else DIE("tried to access per-thread data in non-threaded perl"); -- cgit v1.2.1 From b6c543e345c32071a6c3c124ee19c0eb9bb3df41 Mon Sep 17 00:00:00 2001 From: Ilya Zakharevich Date: Thu, 29 Jan 1998 12:04:28 -0500 Subject: 5.004_56: patch for `use Fatal' again p4raw-id: //depot/perl@467 --- pp.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'pp.c') diff --git a/pp.c b/pp.c index 79d884d115..64411df5c2 100644 --- a/pp.c +++ b/pp.c @@ -360,9 +360,54 @@ PP(pp_prototype) SV *ret; ret = &sv_undef; + if (SvPOK(TOPs) && SvCUR(TOPs) >= 7) { + char *s = SvPVX(TOPs); + if (strnEQ(s, "CORE::", 6)) { + int code; + + code = keyword(s + 6, SvCUR(TOPs) - 6); + if (code < 0) { /* Overridable. */ +#define MAX_ARGS_OP ((sizeof(I32) - 1) * 2) + int i = 0, n = 0, seen_question = 0; + I32 oa; + char str[ MAX_ARGS_OP * 2 + 2 ]; /* One ';', one '\0' */ + + while (i < MAXO) { /* The slow way. */ + if (strEQ(s + 6, op_name[i]) || strEQ(s + 6, op_desc[i])) + goto found; + i++; + } + goto nonesuch; /* Should not happen... */ + found: + oa = opargs[i] >> OASHIFT; + while (oa) { + if (oa & OA_OPTIONAL) { + seen_question = 1; + str[n++] = ';'; + } else if (seen_question) + goto set; /* XXXX system, exec */ + if ((oa & (OA_OPTIONAL - 1)) >= OA_AVREF + && (oa & (OA_OPTIONAL - 1)) <= OA_HVREF) { + str[n++] = '\\'; + } + /* What to do with R ((un)tie, tied, (sys)read, recv)? */ + str[n++] = ("?$@@%&*$")[oa & (OA_OPTIONAL - 1)]; + oa = oa >> 4; + } + str[n++] = '\0'; + ret = sv_2mortal(newSVpv(str, n - 1)); + } else if (code) /* Non-Overridable */ + goto set; + else { /* None such */ + nonesuch: + croak("Cannot find an opnumber for \"%s\"", s+6); + } + } + } cv = sv_2cv(TOPs, &stash, &gv, FALSE); if (cv && SvPOK(cv)) ret = sv_2mortal(newSVpv(SvPVX(cv), SvCUR(cv))); + set: SETs(ret); RETURN; } -- cgit v1.2.1 From deb3007b1732b70253d84d2509424233377af1e9 Mon Sep 17 00:00:00 2001 From: "M. J. T. Guy" Date: Thu, 15 Jan 1998 11:53:06 +0000 Subject: Re: 5.004_04 vec() fails with 32-bit values p4raw-id: //depot/perl@471 --- pp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pp.c') diff --git a/pp.c b/pp.c index 64411df5c2..34e340d667 100644 --- a/pp.c +++ b/pp.c @@ -1911,7 +1911,7 @@ PP(pp_vec) } } - sv_setiv(TARG, (IV)retnum); + sv_setuv(TARG, (UV)retnum); PUSHs(TARG); RETURN; } -- cgit v1.2.1