| 1 | /***********************************************/ |
| 2 | /* Global only to current thread */ |
| 3 | /***********************************************/ |
| 4 | |
| 5 | /* Don't forget to re-run embed.pl to propagate changes! */ |
| 6 | |
| 7 | /* The 'T' prefix is only needed for vars that need appropriate #defines |
| 8 | * generated when built with or without USE_THREADS. It is also used |
| 9 | * to generate the appropriate export list for win32. |
| 10 | * |
| 11 | * When building without USE_THREADS, these variables will be truly global. |
| 12 | * When building without USE_THREADS but with MULTIPLICITY, these variables |
| 13 | * will be global per-interpreter. |
| 14 | * |
| 15 | * Avoid build-specific #ifdefs here, like DEBUGGING. That way, |
| 16 | * we can keep binary compatibility of the curinterp structure */ |
| 17 | |
| 18 | /* Important ones in the first cache line (if alignment is done right) */ |
| 19 | |
| 20 | PERLVAR(Tstack_sp, SV **) /* top of the stack */ |
| 21 | #ifdef OP_IN_REGISTER |
| 22 | PERLVAR(Topsave, OP *) |
| 23 | #else |
| 24 | PERLVAR(Top, OP *) /* currently executing op */ |
| 25 | #endif |
| 26 | PERLVAR(Tcurpad, SV **) /* active pad (lexicals+tmps) */ |
| 27 | |
| 28 | PERLVAR(Tstack_base, SV **) |
| 29 | PERLVAR(Tstack_max, SV **) |
| 30 | |
| 31 | PERLVAR(Tscopestack, I32 *) /* scopes we've ENTERed */ |
| 32 | PERLVAR(Tscopestack_ix, I32) |
| 33 | PERLVAR(Tscopestack_max,I32) |
| 34 | |
| 35 | PERLVAR(Tsavestack, ANY *) /* items that need to be restored |
| 36 | when LEAVEing scopes we've ENTERed */ |
| 37 | PERLVAR(Tsavestack_ix, I32) |
| 38 | PERLVAR(Tsavestack_max, I32) |
| 39 | |
| 40 | PERLVAR(Ttmps_stack, SV **) /* mortals we've made */ |
| 41 | PERLVARI(Ttmps_ix, I32, -1) |
| 42 | PERLVARI(Ttmps_floor, I32, -1) |
| 43 | PERLVAR(Ttmps_max, I32) |
| 44 | |
| 45 | PERLVAR(Tmarkstack, I32 *) /* stack_sp locations we're remembering */ |
| 46 | PERLVAR(Tmarkstack_ptr, I32 *) |
| 47 | PERLVAR(Tmarkstack_max, I32 *) |
| 48 | |
| 49 | PERLVAR(Tretstack, OP **) /* OPs we have postponed executing */ |
| 50 | PERLVAR(Tretstack_ix, I32) |
| 51 | PERLVAR(Tretstack_max, I32) |
| 52 | |
| 53 | PERLVAR(TSv, SV *) /* used to hold temporary values */ |
| 54 | PERLVAR(TXpv, XPV *) /* used to hold temporary values */ |
| 55 | |
| 56 | PERLVAR(Tstatbuf, Stat_t) |
| 57 | #ifdef HAS_TIMES |
| 58 | PERLVAR(Ttimesbuf, struct tms) |
| 59 | #endif |
| 60 | |
| 61 | /* Fields used by magic variables such as $@, $/ and so on */ |
| 62 | PERLVAR(Ttainted, bool) /* using variables controlled by $< */ |
| 63 | PERLVAR(Tcurpm, PMOP *) /* what to do \ interps in REs from */ |
| 64 | PERLVAR(Tnrs, SV *) |
| 65 | PERLVAR(Trs, SV *) /* input record separator $/ */ |
| 66 | PERLVAR(Tlast_in_gv, GV *) /* GV used in last <FH> */ |
| 67 | PERLVAR(Tofs, char *) /* output field separator $, */ |
| 68 | PERLVAR(Tofslen, STRLEN) |
| 69 | PERLVAR(Tdefoutgv, GV *) /* default FH for output */ |
| 70 | PERLVARI(Tchopset, char *, " \n-") /* $: */ |
| 71 | PERLVAR(Tformtarget, SV *) |
| 72 | PERLVAR(Tbodytarget, SV *) |
| 73 | PERLVAR(Ttoptarget, SV *) |
| 74 | |
| 75 | /* Stashes */ |
| 76 | PERLVAR(Tdefstash, HV *) /* main symbol table */ |
| 77 | PERLVAR(Tcurstash, HV *) /* symbol table for current package */ |
| 78 | |
| 79 | PERLVAR(Trestartop, OP *) /* propagating an error from croak? */ |
| 80 | PERLVARI(Tcurcop, COP * VOL, &compiling) |
| 81 | PERLVAR(Tin_eval, VOL int) /* trap "fatal" errors? */ |
| 82 | PERLVAR(Tdelaymagic, int) /* ($<,$>) = ... */ |
| 83 | PERLVAR(Tdirty, bool) /* in the middle of tearing things down? */ |
| 84 | PERLVAR(Tlocalizing, int) /* are we processing a local() list? */ |
| 85 | |
| 86 | PERLVAR(Tcurstack, AV *) /* THE STACK */ |
| 87 | PERLVAR(Tcurstackinfo, PERL_SI *) /* current stack + context */ |
| 88 | PERLVAR(Tmainstack, AV *) /* the stack when nothing funny is happening */ |
| 89 | PERLVAR(Ttop_env, JMPENV *) /* ptr. to current sigjmp() environment */ |
| 90 | PERLVAR(Tstart_env, JMPENV) /* empty startup sigjmp() environment */ |
| 91 | |
| 92 | /* statics "owned" by various functions */ |
| 93 | PERLVAR(Tav_fetch_sv, SV *) /* owned by av_fetch() */ |
| 94 | PERLVAR(Thv_fetch_sv, SV *) /* owned by hv_fetch() */ |
| 95 | PERLVAR(Thv_fetch_ent_mh, HE) /* owned by hv_fetch_ent() */ |
| 96 | |
| 97 | PERLVAR(Tmodcount, I32) /* how much mod()ification in assignment? */ |
| 98 | |
| 99 | /* XXX Sort stuff, firstgv secongv and so on? */ |
| 100 | /* XXX What about regexp stuff? */ |
| 101 | |
| 102 | /* Note that the variables below are all explicitly referenced in the code |
| 103 | * as thr->whatever and therefore don't need the 'T' prefix. */ |
| 104 | |
| 105 | #ifdef USE_THREADS |
| 106 | |
| 107 | PERLVAR(oursv, SV *) |
| 108 | PERLVAR(cvcache, HV *) |
| 109 | PERLVAR(self, perl_os_thread) /* Underlying thread object */ |
| 110 | PERLVAR(flags, U32) |
| 111 | PERLVAR(threadsv, AV *) /* Per-thread SVs ($_, $@ etc.) */ |
| 112 | PERLVAR(threadsvp, SV **) /* AvARRAY(threadsv) */ |
| 113 | PERLVAR(specific, AV *) /* Thread-specific user data */ |
| 114 | PERLVAR(errsv, SV *) /* Backing SV for $@ */ |
| 115 | PERLVAR(errhv, HV *) /* HV for what was %@ in pp_ctl.c */ |
| 116 | PERLVAR(mutex, perl_mutex) /* For the fields others can change */ |
| 117 | PERLVAR(tid, U32) |
| 118 | PERLVAR(prev, struct perl_thread *) |
| 119 | PERLVAR(next, struct perl_thread *) |
| 120 | /* Circular linked list of threads */ |
| 121 | |
| 122 | #ifdef HAVE_THREAD_INTERN |
| 123 | PERLVAR(i, struct thread_intern) |
| 124 | /* Platform-dependent internals */ |
| 125 | #endif |
| 126 | |
| 127 | PERLVAR(trailing_nul, char) /* For the sake of thrsv and oursv */ |
| 128 | |
| 129 | #endif /* USE_THREADS */ |