[uim-commit] r1511 - branches/r5rs/sigscheme
yamaken at freedesktop.org
yamaken at freedesktop.org
Sun Sep 18 01:31:15 PDT 2005
Author: yamaken
Date: 2005-09-18 01:31:12 -0700 (Sun, 18 Sep 2005)
New Revision: 1511
Modified:
branches/r5rs/sigscheme/sigscheme.h
branches/r5rs/sigscheme/sigschemetype.h
Log:
* This commit prepares a new efficient values passing. The
implementation will follow after the internal reorganization by Jun
Inoue
* sigscheme/sigscheme.h
- (SCM_USE_VALUECONS): New macro
* sigscheme/sigschemetype.h
- (ScmObjType): Add ScmValueCons
- (struct ScmObjInternal_): Disable value_pack when
SCM_USE_VALUECONS is true
- (SCM_AS_VALUECONS, SCM_VALUECONSP, SCM_ENTYPE_VALUECONS,
SCM_VALUECONS_CAR, SCM_VALUECONS_CDR): New macro
Modified: branches/r5rs/sigscheme/sigscheme.h
===================================================================
--- branches/r5rs/sigscheme/sigscheme.h 2005-09-18 08:13:59 UTC (rev 1510)
+++ branches/r5rs/sigscheme/sigscheme.h 2005-09-18 08:31:12 UTC (rev 1511)
@@ -79,6 +79,7 @@
#define SCM_STRICT_ARGCHECK 0 /* enable strict argument check */
#define SCM_ACCESSOR_ASSERT 0 /* enable strict type check with accessor */
#define SCM_GCC4_READY_GC 0 /* use experimental gcc4-ready stack protection */
+#define SCM_USE_VALUECONS 0 /* use experimental values passing */
/* dependency resolution */
#if SCM_COMPAT_SIOD
Modified: branches/r5rs/sigscheme/sigschemetype.h
===================================================================
--- branches/r5rs/sigscheme/sigschemetype.h 2005-09-18 08:13:59 UTC (rev 1510)
+++ branches/r5rs/sigscheme/sigschemetype.h 2005-09-18 08:31:12 UTC (rev 1511)
@@ -90,7 +90,11 @@
ScmPort = 8,
ScmContinuation = 9,
ScmEtc = 10,
+#if SCM_USE_VALUECONS
+ ScmValueCons = 11,
+#else
ScmValuePacket = 11,
+#endif
ScmFreeCell = 12,
ScmCPointer = 20,
@@ -262,9 +266,11 @@
ScmContInfo *cont_info;
} continuation;
+#if !SCM_USE_VALUECONS
struct ScmValuePacket {
ScmObj values;
} value_pack;
+#endif
struct ScmCPointer {
void *data;
@@ -300,7 +306,11 @@
#define SCM_AS_VECTOR(a) (SCM_ASSERT_TYPE(SCM_VECTORP(a), (a)))
#define SCM_AS_PORT(a) (SCM_ASSERT_TYPE(SCM_PORTP(a), (a)))
#define SCM_AS_CONTINUATION(a) (SCM_ASSERT_TYPE(SCM_CONTINUATIONP(a), (a)))
+#if SCM_USE_VALUECONS
+#define SCM_AS_VALUECONS(a) (SCM_ASSERT_TYPE(SCM_VALUECONSP(a), (a)))
+#else
#define SCM_AS_VALUEPACKET(a) (SCM_ASSERT_TYPE(SCM_VALUEPACKETP(a), (a)))
+#endif /* SCM_USE_VALUECONS */
#define SCM_AS_C_POINTER(a) (SCM_ASSERT_TYPE(SCM_C_POINTERP(a), (a)))
#define SCM_AS_C_FUNCPOINTER(a) (SCM_ASSERT_TYPE(SCM_C_FUNCPOINTERP(a), (a)))
@@ -396,10 +406,18 @@
#define SCM_CONTINUATION_JMPENV(a) (SCM_AS_CONTINUATION(a)->obj.continuation.cont_info->jmp_env)
#define SCM_CONTINUATION_SET_CONTINFO(a, cinfo) (SCM_CONTINUATION_CONTINFO(a) = (cinfo))
+#if SCM_USE_VALUECONS
+/* to modify a ValueCons, rewrite its type to cons by SCM_ENTYPE_CONS(vcons) */
+#define SCM_VALUECONSP(a) (SCM_TYPE(a) == ScmValueCons)
+#define SCM_ENTYPE_VALUECONS(a) (SCM_ENTYPE((a), ScmValueCons))
+#define SCM_VALUECONS_CAR(a) (SCM_AS_VALUE_CONS(a)->obj.cons.car)
+#define SCM_VALUECONS_CDR(a) (SCM_AS_VALUE_CONS(a)->obj.cons.cdr)
+#else /* SCM_USE_VALUECONS */
#define SCM_VALUEPACKETP(a) (SCM_TYPE(a) == ScmValuePacket)
#define SCM_ENTYPE_VALUEPACKET(a) (SCM_ENTYPE((a), ScmValuePacket))
#define SCM_VALUEPACKET_VALUES(a) (SCM_AS_VALUEPACKET(a)->obj.value_pack.values)
#define SCM_VALUEPACKET_SET_VALUES(a, v) (SCM_VALUEPACKET_VALUES(a) = (v))
+#endif /* SCM_USE_VALUECONS */
/*============================================================================
Etcetra Variables (Special Constants like SCM_NULL)
More information about the uim-commit
mailing list