]> gitweb.factorcode.org Git - factor.git/commitdiff
Code cleanups
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 7 May 2009 17:33:31 +0000 (12:33 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Thu, 7 May 2009 17:33:31 +0000 (12:33 -0500)
basis/math/intervals/intervals.factor
vm/code_gc.cpp
vm/cpu-x86.32.S
vm/cpu-x86.64.S

index 0bc25605e738cf1e51b69ee23f713306490472e1..767197a975721c2f01df860426714ebe3a3f0618 100755 (executable)
@@ -48,6 +48,8 @@ TUPLE: interval { from read-only } { to read-only } ;
 
 : (a,inf] ( a -- interval ) 1/0. (a,b] ; inline
 
+: [0,inf] ( -- interval ) 0 [a,inf] ; foldable
+
 : [-inf,inf] ( -- interval ) full-interval ; inline
 
 : compare-endpoints ( p1 p2 quot -- ? )
@@ -262,7 +264,7 @@ TUPLE: interval { from read-only } { to read-only } ;
 : interval-abs ( i1 -- i2 )
     {
         { [ dup empty-interval eq? ] [ ] }
-        { [ dup full-interval eq? ] [ drop 0 [a,inf] ] }
+        { [ dup full-interval eq? ] [ drop [0,inf] ] }
         { [ 0 over interval-contains? ] [ (interval-abs) { 0 t } suffix points>interval ] }
         [ (interval-abs) points>interval ]
     } cond ;
@@ -376,7 +378,7 @@ SYMBOL: incomparable
 : interval-log2 ( i1 -- i2 )
     {
         { empty-interval [ empty-interval ] }
-        { full-interval [ 0 [a,inf] ] }
+        { full-interval [ [0,inf] ] }
         [
             to>> first 1 max dup most-positive-fixnum >
             [ drop full-interval interval-log2 ]
index 59110d13f8a8fac81d24c44428eb552ca7000767..48cf8f76618e0f8bab03624092493d30496a7c4b 100755 (executable)
@@ -303,7 +303,7 @@ cell heap_size(heap *heap)
 }
 
 /* Compute where each block is going to go, after compaction */
-       cell compute_heap_forwarding(heap *heap, unordered_map<heap_block *,char *> &forwarding)
+cell compute_heap_forwarding(heap *heap, unordered_map<heap_block *,char *> &forwarding)
 {
        heap_block *scan = first_block(heap);
        char *address = (char *)first_block(heap);
@@ -324,7 +324,7 @@ cell heap_size(heap *heap)
        return (cell)address - heap->seg->start;
 }
 
-       void compact_heap(heap *heap, unordered_map<heap_block *,char *> &forwarding)
+void compact_heap(heap *heap, unordered_map<heap_block *,char *> &forwarding)
 {
        heap_block *scan = first_block(heap);
 
index a1ce83932ee27cf50b904728c7baa563b8e1a489..ff45f480660d4bca162466c7cea71c35579db604 100755 (executable)
@@ -1,9 +1,5 @@
 #include "asm.h"
 
-/* Note that primitive word definitions are compiled with
-__attribute__((regparm 2), so the pointer to the word object is passed in EAX,
-and the callstack top is passed in EDX */
-
 #define ARG0 %eax
 #define ARG1 %edx
 #define STACK_REG %esp
@@ -59,9 +55,9 @@ DEF(bool,check_sse2,(void)):
        mov %edx,%eax
        ret
 
-DEF(F_FASTCALL void,primitive_inline_cache_miss,(void)):
+DEF(void,primitive_inline_cache_miss,(void)):
        mov (%esp),%ebx
-DEF(F_FASTCALL void,primitive_inline_cache_miss_tail,(void)):
+DEF(void,primitive_inline_cache_miss_tail,(void)):
        sub $8,%esp
        push %ebx
        call MANGLE(inline_cache_miss)
index 0ace3543084dd4aaeed9c940c65e35498518bb08..6b2faa1c0bbad6318ec73d23c47670bce1276a0e 100644 (file)
@@ -72,9 +72,9 @@ DEF(void,set_callstack,(F_STACK_FRAME *to, F_STACK_FRAME *from, CELL length, voi
        call *ARG3                         /* call memcpy */
        ret                                /* return _with new stack_ */
 
-DEF(F_FASTCALL void,primitive_inline_cache_miss,(void)):
+DEF(void,primitive_inline_cache_miss,(void)):
        mov (%rsp),%rbx
-DEF(F_FASTCALL void,primitive_inline_cache_miss_tail,(void)):
+DEF(void,primitive_inline_cache_miss_tail,(void)):
        sub $STACK_PADDING,%rsp
        mov %rbx,ARG0
        call MANGLE(inline_cache_miss)