Gauche trunk の Flonum 対応

Lingr 経由。VM経由の Flonum 演算の計算途中に現れるテンポラリなFlonumをスタックに alloc するらしい。
以前からスタックに割り当てるというキーワードは聞いていたが、「ネイティブスタック?」「VMスタック?」そんなのできるのか?と思ったら、専用のスタックがあるのですね。なるほど。

#   define Scm_VMReturnFlonum(val)                                      \
        ({ ScmVM *vm__ = Scm_VM(); ScmFlonum *fp;                       \
           if (vm__->fpsp == vm__->fpstackEnd) Scm_VMFlushFPStack(vm__);\
           fp = vm__->fpsp++;                                           \
           *fp = (val);                                                 \
           SCM_MAKE_FLONUM_REG(fp);                                     \
        })
/* Many built-in arithmetic routines come with VM* variants, which
   are used when the resulting flonum is directly returned to the VM.
   Such routines share the body with their variants, with an extra
   flag 'vmp' that indicates whether the call is 'VM' variant or not.
   RETURN_FLONUM and RETURN_FLOBJ macros are used to hide the different
   flonum generation in such routines.
   RETURN_FLONUM takes double arg and returns ScmObj.
   RETURN_FLOBJ takes ScmObj (ScmFlonum*) and returns ScmObj.
*/