[uim-commit] r2074 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Mon Nov 7 11:54:11 PST 2005
Author: yamaken
Date: 2005-11-07 11:54:05 -0800 (Mon, 07 Nov 2005)
New Revision: 2074
Modified:
branches/r5rs/sigscheme/operations-srfi34.c
branches/r5rs/sigscheme/sigschemeinternal.h
branches/r5rs/sigscheme/storage-continuation.c
branches/r5rs/sigscheme/storage.c
Log:
* This commit is first step to reorganize continuation and exception
handling reorganization. This change hides internal representation
of continuation object into storage-continuation.c and
operations-srfi34.c. I'll make the continuation object
SCM_OBJ_COMPACT capable in next step as declared in [Anthy-dev
2530].
* sigscheme/sigschemeinternal.h
- (INVALID_CONTINUATION_JMPENV): Removed
- (INVALID_CONTINUATION_OPAQUE): New macro
- (CONTINUATION_JMPENV, CONTINUATION_SET_JMPENV): Move to
storage-continuation.c
- (CONTINUATION_DYNEXT, CONTINUATION_SET_DYNEXT): Move to
storage-continuation.c and operations-srfi34.c
* sigscheme/storage.c
- (scm_current_dynamic_extent): Removed
- (Scm_NewContinuation): Initialize both slot with
INVALID_CONTINUATION_OPAQUE. Dynamic extent slot initialization
has been moved to caller
* sigscheme/storage-continuation.c
- (CONTINUATION_JMPENV, CONTINUATION_SET_JMPENV,
CONTINUATION_DYNEXT, CONTINUATION_SET_DYNEXT): Moved from
sigschemeinternal.h
- (continuation_stack_unwind, Scm_CallContinuation): Replace
INVALID_CONTINUATION_JMPENV with INVALID_CONTINUATION_OPAQUE
- (Scm_CallWithCurrentContinuation): Add dynamic extent slot
initialization of continuation object
* sigscheme/operations-srfi34.c
- (scm_current_dynamic_extent): Add extern decl
- (CONTINUATION_DYNEXT, CONTINUATION_SET_DYNEXT): Moved from
sigschemeinternal.h
- (ScmOp_SRFI34_with_exception_handler, ScmExp_SRFI34_guard): Add
dynamic extent slot initialization of continuation object
Modified: branches/r5rs/sigscheme/operations-srfi34.c
===================================================================
--- branches/r5rs/sigscheme/operations-srfi34.c 2005-11-07 16:14:59 UTC (rev 2073)
+++ branches/r5rs/sigscheme/operations-srfi34.c 2005-11-07 19:54:05 UTC (rev 2074)
@@ -50,12 +50,18 @@
/*=======================================
File Local Macro Declarations
=======================================*/
+/* FIXME: make internal representation hidden */
#define CONTINUATION_JMPENV SCM_CONTINUATION_OPAQUE0
#define CONTINUATION_SET_JMPENV SCM_CONTINUATION_SET_OPAQUE0
+#define CONTINUATION_DYNEXT SCM_CONTINUATION_OPAQUE1
+#define CONTINUATION_SET_DYNEXT SCM_CONTINUATION_SET_OPAQUE1
/*=======================================
Variable Declarations
=======================================*/
+/* storage-continuation.c */
+extern ScmObj scm_current_dynamic_extent;
+
ScmObj scm_exception_handlers = NULL;
ScmObj scm_exception_continuations = NULL;
@@ -103,6 +109,7 @@
ASSERT_PROCEDUREP(thunk);
CONTINUATION_SET_JMPENV(cont, &jmpenv);
+ CONTINUATION_SET_DYNEXT(cont, scm_current_dynamic_extent);
if (setjmp(CONTINUATION_JMPENV(cont))) {
ret = Scm_call(CURRENT_EXCEPTION_HANDLER(), LIST_1(exception_thrown_obj));
POP_EXCEPTION_CONTINUATION();
@@ -144,6 +151,7 @@
/* check if return from "raise" */
CONTINUATION_SET_JMPENV(cont, &jmpenv);
+ CONTINUATION_SET_DYNEXT(cont, scm_current_dynamic_extent);
if (setjmp(CONTINUATION_JMPENV(cont))) {
POP_EXCEPTION_CONTINUATION();
env = Scm_ExtendEnvironment(LIST_1(var), LIST_1(exception_thrown_obj), env);
Modified: branches/r5rs/sigscheme/sigschemeinternal.h
===================================================================
--- branches/r5rs/sigscheme/sigschemeinternal.h 2005-11-07 16:14:59 UTC (rev 2073)
+++ branches/r5rs/sigscheme/sigschemeinternal.h 2005-11-07 19:54:05 UTC (rev 2074)
@@ -318,11 +318,7 @@
#endif /* SCM_USE_SRFI34 */
/* Macros For Handling Continuation Object */
-#define INVALID_CONTINUATION_JMPENV NULL
-#define CONTINUATION_JMPENV SCM_CONTINUATION_OPAQUE0
-#define CONTINUATION_SET_JMPENV SCM_CONTINUATION_SET_OPAQUE0
-#define CONTINUATION_DYNEXT SCM_CONTINUATION_OPAQUE1
-#define CONTINUATION_SET_DYNEXT SCM_CONTINUATION_SET_OPAQUE1
+#define INVALID_CONTINUATION_OPAQUE NULL
/* Symbol Name Hash Size */
#define NAMEHASH_SIZE 1024
Modified: branches/r5rs/sigscheme/storage-continuation.c
===================================================================
--- branches/r5rs/sigscheme/storage-continuation.c 2005-11-07 16:14:59 UTC (rev 2073)
+++ branches/r5rs/sigscheme/storage-continuation.c 2005-11-07 19:54:05 UTC (rev 2074)
@@ -58,10 +58,16 @@
*/
#define SCM_NESTED_CONTINUATION_ONLY 1
+#define CONTINUATION_JMPENV SCM_CONTINUATION_OPAQUE0
+#define CONTINUATION_SET_JMPENV SCM_CONTINUATION_SET_OPAQUE0
+#define CONTINUATION_DYNEXT SCM_CONTINUATION_OPAQUE1
+#define CONTINUATION_SET_DYNEXT SCM_CONTINUATION_SET_OPAQUE1
+
/*=======================================
Variable Declarations
=======================================*/
/* dynamic extent */
+/* FIXME: make static */
ScmObj scm_current_dynamic_extent = NULL;
/* temporary store for a object returned from a continuation */
@@ -227,7 +233,7 @@
cont = continuation_stack_pop();
if (FALSEP(cont))
return SCM_FALSE;
- CONTINUATION_SET_JMPENV(cont, INVALID_CONTINUATION_JMPENV);
+ CONTINUATION_SET_JMPENV(cont, INVALID_CONTINUATION_OPAQUE);
} while (!EQ(dest_cont, cont));
return dest_cont;
@@ -242,6 +248,7 @@
cont = Scm_NewContinuation();
CONTINUATION_SET_JMPENV(cont, &env);
+ CONTINUATION_SET_DYNEXT(cont, scm_current_dynamic_extent);
#if SCM_NESTED_CONTINUATION_ONLY
continuation_stack_push(cont);
#endif
@@ -287,7 +294,7 @@
env = CONTINUATION_JMPENV(cont);
- if (env != INVALID_CONTINUATION_JMPENV
+ if (env != INVALID_CONTINUATION_OPAQUE
#if SCM_NESTED_CONTINUATION_ONLY
&& CONTINUATIONP(continuation_stack_unwind(cont))
#endif
Modified: branches/r5rs/sigscheme/storage.c
===================================================================
--- branches/r5rs/sigscheme/storage.c 2005-11-07 16:14:59 UTC (rev 2073)
+++ branches/r5rs/sigscheme/storage.c 2005-11-07 19:54:05 UTC (rev 2074)
@@ -86,9 +86,6 @@
static ScmCell unbound_cell, undef_cell;
#endif
-/* storage-continuation.c */
-extern ScmObj scm_current_dynamic_extent;
-
/*=======================================
File Local Function Declarations
=======================================*/
@@ -295,8 +292,8 @@
ScmObj obj = SigScm_NewObjFromHeap();
SCM_ENTYPE_CONTINUATION(obj);
- CONTINUATION_SET_JMPENV(obj, INVALID_CONTINUATION_JMPENV);
- CONTINUATION_SET_DYNEXT(obj, scm_current_dynamic_extent);
+ SCM_CONTINUATION_SET_OPAQUE0(obj, INVALID_CONTINUATION_OPAQUE);
+ SCM_CONTINUATION_SET_OPAQUE1(obj, INVALID_CONTINUATION_OPAQUE);
return obj;
}
More information about the uim-commit
mailing list