From 6224f72bf639f0ca7f774fe2738f2408b3e430ac Mon Sep 17 00:00:00 2001 From: Gurusamy Sarathy Date: Mon, 15 Jun 1998 08:51:54 +0000 Subject: back out previous change (it breaks PERL_OBJECT) p4raw-id: //depot/perl@1136 --- pod/perldiag.pod | 9 +------ pod/perlguts.pod | 73 -------------------------------------------------------- 2 files changed, 1 insertion(+), 81 deletions(-) (limited to 'pod') diff --git a/pod/perldiag.pod b/pod/perldiag.pod index e35ad46619..8dd2f823a0 100644 --- a/pod/perldiag.pod +++ b/pod/perldiag.pod @@ -1380,11 +1380,6 @@ ignored. (F) Your machine apparently doesn't implement ioctl(), which is pretty strange for a machine that supports C. -=item JMPENV_JUMP(%d) is bogus - -(S) Either some extension is trying to raise an exception type that is not -supported by the JMPENV API, or memory has been corrupted. See L. - =item junk on end of regexp (P) The regular expression parser is confused. @@ -1920,9 +1915,7 @@ was string. =item panic: top_env -(X) An attempt was made to throw some sort of exception when there -was no exception stack. Either perl failed to initialize properly, or -the JMPENV API is being misused. See L. +(P) The compiler attempted to do a goto, or something weird like that. =item panic: yylex diff --git a/pod/perlguts.pod b/pod/perlguts.pod index dce6ca5752..fb52ecfcb7 100644 --- a/pod/perlguts.pod +++ b/pod/perlguts.pod @@ -1252,79 +1252,6 @@ is being used. For a complete description of the PerlIO abstraction, consult L. -=head2 Exception Trapping (JMPENV API) - -As of 5.005, the internal exception trapping mechanism is replaceable -at run-time. - -For a concrete example of usage, see perl.c in the perl source -distribution. Only a general outline is presented here. - -The C macro is used to set up a exception handling switch. -C takes two arguments. The first argument is a table of -exception handlers: - - struct tryvtbl { - /* [0] executed before JMPENV_POP - [1] executed after JMPENV_POP - (NULL pointers are OK) */ - char *try_context; - void (*try_normal [2]) _((CPERLproto_ void*)); - void (*try_abnormal [2]) _((CPERLproto_ void*)); - void (*try_exception [2]) _((CPERLproto_ void*)); - void (*try_myexit [2]) _((CPERLproto_ void*)); - }; - typedef struct tryvtbl TRYVTBL; - -Each of the functions correspond to the exception types that -are currently supported. The two functions in each array are meant -to be run before and after the exception context is exited, respectively, -via C. - -The second argument to C is an opaque pointer that is passed -as a first argument to each of the handler functions. This is usually -a structure specific to each particular exception switch containing both -the return value and the arguments to the handler functions. - -Any of the handler function pointers can be C except for -C, which is the only thing executed by C -after setting up the exception context. Any code executed by -C is free to throw one of the three supported exceptions -using C. C can be called with one of the -following values: - - #define JMP_ABNORMAL 1 /* shouldn't happen */ - #define JMP_MYEXIT 2 /* exit */ - #define JMP_EXCEPTION 3 /* die */ - -Control then resumes at the exception switch, which calls the handler -corresponding to the type of exception that was thrown. More exceptions -can be thrown while in the handler, and the process repeats until one of -the handlers return normally. - -In other words, depending on how C is called, either -C, C, or C are executed. -If C is invoked yet again before the try handler completes -then execution will B at the try handler which corresponds to the -most recent C. Care should be taken to avoid infinite -loops. - -Once the try handler[0] finishes, execution moves on to one of the try -handlers that are run after the exception context is exited (i.e. -handler[1]). However, the difference between the two types of handlers -is that exceptions raised in handlers run after exiting the exception -context are no longer caught by the C. Of course, they may -be caught at some outer exception trap set up for the purpose. Therefore, -C at this point will not be trapped; it will jump to the -previous C. This is useful for propagating exceptions to the -top of the stack. - -WARNING: At the time of this writing, the C compiler backend -does not support exception traps that are configurable at runtime. It -only knows how to handle exceptions thrown with longjmp() (which is what -the default exception mechanism in perl provides). This will be corrected -in a future release. - =head2 Putting a C value on Perl stack A lot of opcodes (this is an elementary operation in the internal perl -- cgit v1.2.1