1 %dec-d ,
] "intrinsic" set-word-prop
-GENERIC: load-value ( vreg n value -- )
-
-M: computed load-value ( vreg n value -- )
- drop %peek-d , ;
-
-M: literal load-value ( vreg n value -- )
- nip literal-value %immediate , ;
-
: value/vreg-list ( in -- list )
[ 0 swap length 1 - ] keep
[ >r 2dup r> 3list >r 1 - >r 1 + r> r> ] map 2nip ;
#! by GC, and is indexed through a table.
dup fixnum? swap f eq? or ;
-: push-1 ( obj -- )
- 0 swap literal-value dup
+GENERIC: load-value ( vreg n value -- )
+
+M: computed load-value ( vreg n value -- )
+ drop %peek-d , ;
+
+M: literal load-value ( vreg n value -- )
+ nip literal-value dup
immediate? [ %immediate ] [ %indirect ] ifte , ;
+: push-1 ( value -- ) >r 0 0 r> load-value ;
+
M: #push linearize-node* ( node -- )
node-out-d dup length dup %inc-d ,
1 - swap [ push-1 0 over %replace-d , ] each drop ;
M: absolute-16/16 fixup ( absolute -- ) >absolute fixup-16/16 ;
-: absolute-16/16 ( word -- ) <absolute-16/16> deferred-xt ;
+: absolute-16/16 ( word -- )
+ <absolute-16/16> deferred-xt 0 1 rel-address ;
: compiling? ( word -- ? )
#! A word that is compiling or already compiled will not be
M: tuple hashcode ( vec -- n )
#! If the capacity is two, then all we have is the class
#! slot and delegate.
- dup length 2 number= [
+ dup array-capacity 2 number= [
drop 0
] [
2 swap array-nth hashcode
: #call ( word -- node ) param-node <#call> ;
NODE: #call-label
-: #call-label ( label -- node ) param-node <#call> ;
+: #call-label ( label -- node ) param-node <#call-label> ;
NODE: #push
: #push ( outputs -- node ) d-tail out-d-node <#push> ;
void ffi_dlopen(DLL *dll)
{
- void *dllptr;
-
- dllptr = dlopen(to_c_string(untag_string(dll->path)), RTLD_LAZY);
+ void *dllptr = dlopen(to_c_string(untag_string(dll->path)), RTLD_LAZY);
if(dllptr == NULL)
{
void ffi_dlclose(DLL *dll)
{
- if(dlclose(dll->dll) == -1)
+ if(dlclose(dll->dll) != NULL)
{
general_error(ERROR_FFI,tag_object(
from_c_string(dlerror())));
{
char wd[MAXPATHLEN];
maybe_garbage_collection();
- if(getcwd(wd,MAXPATHLEN) < 0)
+ if(getcwd(wd,MAXPATHLEN) == NULL)
io_error();
box_c_string(wd);
}