[svn commit] r432 - trunk/gc
jimb at red-bean.com
jimb at red-bean.com
Sat Apr 2 16:56:34 CST 2005
Author: jimb
Date: Sat Apr 2 16:56:33 2005
New Revision: 432
Modified:
trunk/gc/excepts.c
trunk/gc/excepts.h
trunk/gc/procedures.c
trunk/gc/strings.c
Log:
Add mn_call argument to mn__set_exception and mn__get_exception. These
currently use a mn__per_thread variable, and we'll probably want to replace
that with a 'struct thread' field, so let's prep the interface now.
Modified: trunk/gc/excepts.c
==============================================================================
--- trunk/gc/excepts.c (original)
+++ trunk/gc/excepts.c Sat Apr 2 16:56:33 2005
@@ -11,13 +11,17 @@
#include "excepts.h"
#include "strings.h"
+
+/* We should probably move this to 'struct thread', and avoid using __thread
+ where we don't need it. Thus, mn__set_exception and mn__get_exception
+ take a call argument, even though it's unused. */
static mn__per_thread mn_ref *pending_exception;
/* Incoherent exception accessors. */
void
-mn__set_exception (tagged_t except)
+mn__set_exception (mn_call *c, tagged_t except)
{
if (pending_exception)
mn__free_global_ref (pending_exception);
@@ -29,7 +33,7 @@
tagged_t
-mn__get_exception (void)
+mn__get_exception (mn_call *c)
{
if (pending_exception)
return pending_exception->obj;
@@ -48,7 +52,7 @@
{
tagged_t x = ref ? ref->obj : mn__unique_false ();
- mn__set_exception (x);
+ mn__set_exception (c, x);
}
mn__end_incoherent (c);
}
@@ -61,7 +65,7 @@
mn__begin_incoherent (c);
{
- tagged_t x = mn__get_exception ();
+ tagged_t x = mn__get_exception (c);
if (x == mn__unique_false ())
r = 0;
Modified: trunk/gc/excepts.h
==============================================================================
--- trunk/gc/excepts.h (original)
+++ trunk/gc/excepts.h Sat Apr 2 16:56:33 2005
@@ -7,11 +7,11 @@
/* Set the calling thread's current exception to EXCEPT. If EXCEPT is
mn__unique_false (), clear the current exception. */
-void mn__set_exception (tagged_t except);
+void mn__set_exception (mn_call *, tagged_t except);
/* Return the calling thread's current exception, or mn__unique_false
() if there is none. */
-tagged_t mn__get_exception (void);
+tagged_t mn__get_exception (mn_call *);
/* Return a global reference to a simple exception whose text is MESSAGE.
You must be incoherent to call this function. */
Modified: trunk/gc/procedures.c
==============================================================================
--- trunk/gc/procedures.c (original)
+++ trunk/gc/procedures.c Sat Apr 2 16:56:33 2005
@@ -246,7 +246,7 @@
if (! mn__is_procedure (proc->obj))
{
- mn__set_exception (not_procedure_exception->obj);
+ mn__set_exception (c, not_procedure_exception->obj);
return mn__unique_non_value ();
}
p = mn__untag_procedure (proc->obj);
@@ -254,7 +254,7 @@
num_actuals = mn__length (actuals->obj);
if (num_actuals == -1)
{
- mn__set_exception (args_not_proper_list_exception->obj);
+ mn__set_exception (c, args_not_proper_list_exception->obj);
return mn__unique_non_value ();
}
@@ -262,7 +262,7 @@
? num_actuals < p->num_formals
: num_actuals != p->num_formals)
{
- mn__set_exception (call_arity_exception->obj);
+ mn__set_exception (c, call_arity_exception->obj);
return mn__unique_non_value ();
}
@@ -282,7 +282,7 @@
encounter pairs here. */
if (! mn__pair_p (tail))
{
- mn__set_exception (args_not_proper_list_exception->obj);
+ mn__set_exception (c, args_not_proper_list_exception->obj);
return mn__unique_non_value ();
}
@@ -431,7 +431,7 @@
result = mn__untag_pair (result_ref->obj)->car;
else
{
- mn__set_exception (return_arity_exception->obj);
+ mn__set_exception (c, return_arity_exception->obj);
result = mn__unique_non_value ();
}
}
Modified: trunk/gc/strings.c
==============================================================================
--- trunk/gc/strings.c (original)
+++ trunk/gc/strings.c Sat Apr 2 16:56:33 2005
@@ -95,7 +95,7 @@
}
else
{
- mn__set_exception (conversion_exception->obj);
+ mn__set_exception (c, conversion_exception->obj);
return NULL;
}
}
More information about the Minor
mailing list