diff options
author | Gurusamy Sarathy <gsar@cpan.org> | 1999-06-09 18:03:01 +0000 |
---|---|---|
committer | Gurusamy Sarathy <gsar@cpan.org> | 1999-06-09 18:03:01 +0000 |
commit | cea2e8a9dd23747fd2b66edc86c58c64e9970321 (patch) | |
tree | 50e1ad203239e885681b4e804c46363e763ca432 /ext/ByteLoader | |
parent | f019efd000a9017df645fb6c4cce1e7401ac9445 (diff) | |
download | perl-cea2e8a9dd23747fd2b66edc86c58c64e9970321.tar.gz |
more complete support for implicit thread/interpreter pointer,
enabled via -DPERL_IMPLICIT_CONTEXT (all changes are noops
without that enabled):
- USE_THREADS now enables PERL_IMPLICIT_CONTEXT, so dTHR
is a noop; tests pass on Solaris; should be faster now!
- MULTIPLICITY has been tested with and without
PERL_IMPLICIT_CONTEXT on Solaris
- improved function database now merged with embed.pl
- everything except the varargs functions have foo(a,b,c) macros
to provide compatibility
- varargs functions default to compatibility variants that
get the context pointer using dTHX
- there should be almost no source compatibility issues as a
result of all this
- dl_foo.xs changes other than dl_dlopen.xs untested
- still needs documentation, fixups for win32 etc
Next step: migrate most non-mutex variables from perlvars.h
to intrpvar.h
p4raw-id: //depot/perl@3524
Diffstat (limited to 'ext/ByteLoader')
-rw-r--r-- | ext/ByteLoader/ByteLoader.xs | 2 | ||||
-rw-r--r-- | ext/ByteLoader/bytecode.h | 4 | ||||
-rw-r--r-- | ext/ByteLoader/byterun.c | 5 | ||||
-rw-r--r-- | ext/ByteLoader/byterun.h | 25 |
4 files changed, 31 insertions, 5 deletions
diff --git a/ext/ByteLoader/ByteLoader.xs b/ext/ByteLoader/ByteLoader.xs index dd300be3be..e927d16f31 100644 --- a/ext/ByteLoader/ByteLoader.xs +++ b/ext/ByteLoader/ByteLoader.xs @@ -16,7 +16,7 @@ static I32 #ifdef PERL_OBJECT byteloader_filter(CPerlObj *pPerl, int idx, SV *buf_sv, int maxlen) #else -byteloader_filter(int idx, SV *buf_sv, int maxlen) +byteloader_filter(pTHX_ int idx, SV *buf_sv, int maxlen) #endif { dTHR; diff --git a/ext/ByteLoader/bytecode.h b/ext/ByteLoader/bytecode.h index abab1e41d8..e743583b61 100644 --- a/ext/ByteLoader/bytecode.h +++ b/ext/ByteLoader/bytecode.h @@ -111,7 +111,7 @@ typedef IV IV64; #define BSET_pv_free(pv) Safefree(pv.xpv_pv) #define BSET_pregcomp(o, arg) \ ((PMOP*)o)->op_pmregexp = arg ? \ - CALLREGCOMP(arg, arg + bytecode_pv.xpv_cur, ((PMOP*)o)) : 0 + CALLREGCOMP(aTHX_ arg, arg + bytecode_pv.xpv_cur, ((PMOP*)o)) : 0 #define BSET_newsv(sv, arg) sv = NEWSV(666,0); SvUPGRADE(sv, arg) #define BSET_newop(o, arg) o = (OP*)safemalloc(optype_size[arg]) #define BSET_newopn(o, arg) STMT_START { \ @@ -132,7 +132,7 @@ typedef IV IV64; arg = OP_GREPSTART; \ o->op_ppaddr = PL_ppaddr[arg]; \ } STMT_END -#define BSET_op_ppaddr(o, arg) croak("op_ppaddr not yet implemented") +#define BSET_op_ppaddr(o, arg) Perl_croak(aTHX_ "op_ppaddr not yet implemented") #define BSET_curpad(pad, arg) STMT_START { \ PL_comppad = (AV *)arg; \ pad = AvARRAY(arg); \ diff --git a/ext/ByteLoader/byterun.c b/ext/ByteLoader/byterun.c index ab5b5fc6dc..e124c23efc 100644 --- a/ext/ByteLoader/byterun.c +++ b/ext/ByteLoader/byterun.c @@ -51,7 +51,8 @@ bset_obj_store(void *obj, I32 ix) return obj; } -void byterun(struct bytestream bs) +void +byterun(pTHX_ struct bytestream bs) { dTHR; int insn; @@ -894,7 +895,7 @@ void byterun(struct bytestream bs) break; } default: - croak("Illegal bytecode instruction %d\n", insn); + Perl_croak(aTHX_ "Illegal bytecode instruction %d\n", insn); /* NOTREACHED */ } } diff --git a/ext/ByteLoader/byterun.h b/ext/ByteLoader/byterun.h index f95f9f8de2..c293160340 100644 --- a/ext/ByteLoader/byterun.h +++ b/ext/ByteLoader/byterun.h @@ -154,3 +154,28 @@ enum { OPt_COP /* 11 */ }; +EXT int PL_optype_size[] +#ifdef DOINIT += { + sizeof(OP), + sizeof(UNOP), + sizeof(BINOP), + sizeof(LOGOP), + sizeof(CONDOP), + sizeof(LISTOP), + sizeof(PMOP), + sizeof(SVOP), + sizeof(GVOP), + sizeof(PVOP), + sizeof(LOOP), + sizeof(COP) +} +#endif /* DOINIT */ +; + +#define INIT_SPECIALSV_LIST STMT_START { \ + PL_specialsv_list[0] = Nullsv; \ + PL_specialsv_list[1] = &PL_sv_undef; \ + PL_specialsv_list[2] = &PL_sv_yes; \ + PL_specialsv_list[3] = &PL_sv_no; \ + } STMT_END |