]> gitweb.factorcode.org Git - factor.git/commitdiff
further PowerPC fixes
authorSlava Pestov <slava@factorcode.org>
Wed, 8 Jun 2005 08:49:05 +0000 (08:49 +0000)
committerSlava Pestov <slava@factorcode.org>
Wed, 8 Jun 2005 08:49:05 +0000 (08:49 +0000)
library/compiler/intrinsics.factor
library/compiler/linearizer.factor
library/compiler/xt.factor
library/generic/tuple.factor
library/inference/dataflow.factor
native/unix/ffi.c
native/unix/file.c

index fc993b9792d1b5deaa0997dc31b33eff2462b7c4..99b4cbecad6dbe240cde7db8114a5a8432b64def 100644 (file)
@@ -134,14 +134,6 @@ sequences words ;
     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 ;
index a4e1d9aaeec7ddd285aee548222319866a509bb0..4f589dcf0a60bd50ca019229ad0d7f3e533381cb 100644 (file)
@@ -42,10 +42,17 @@ M: #call-label linearize-node* ( node -- )
     #! 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 ;
index fa70a0fc071d8b29bc77836feca10ae60190614d..b61570e5ea81ea942143e09ba69ecda5bcf5c8ef 100644 (file)
@@ -115,7 +115,8 @@ C: absolute-16/16 ( word -- )
 
 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
index 15efffd2017e074f219f0a58e25eab95c62ac1f9..f394599ab42d069c77a347276c0c485fb7b3e649 100644 (file)
@@ -199,7 +199,7 @@ M: tuple clone ( tuple -- tuple )
 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
index daa9281547ebff4834658e96908a6ad9ae3dbdb6..cf6f52a8b21adc8f20c5bda57a3e7641c964a4b1 100644 (file)
@@ -34,7 +34,7 @@ NODE: #call
 : #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> ;
index be5fd30cd9c65dfc9bbe8958e1305873421df864..8c258abc9774751fdfa1e7dacb7b00015cf638fb 100644 (file)
@@ -9,9 +9,7 @@ void init_ffi(void)
 
 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)
        {
@@ -37,7 +35,7 @@ void *ffi_dlsym(DLL *dll, F_STRING *symbol)
 
 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())));
index da343f4df3355fe9e7b6e6cd2d4f4468efb5e355..763ff6f460de288475fcde9dc0a396395b07e4b3 100644 (file)
@@ -58,7 +58,7 @@ void primitive_cwd(void)
 {
        char wd[MAXPATHLEN];
        maybe_garbage_collection();
-       if(getcwd(wd,MAXPATHLEN) < 0)
+       if(getcwd(wd,MAXPATHLEN) == NULL)
                io_error();
        box_c_string(wd);
 }