]> gitweb.factorcode.org Git - factor.git/commitdiff
Fix -pic command line switch, and enable PICs in user-space
authorSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 28 Apr 2009 23:06:10 +0000 (18:06 -0500)
committerSlava Pestov <slava@slava-pestovs-macbook-pro.local>
Tue, 28 Apr 2009 23:06:10 +0000 (18:06 -0500)
core/generic/single/single.factor
vm/factor.c
vm/run.h

index 636f55632dfa29daac5aaa1dac46ca598d761666..8154942c1656490237bb81928aba1894dece62d6 100644 (file)
@@ -245,6 +245,12 @@ M: f compile-engine ;
     generic-word get "methods" word-prop
     assoc-size 2 * next-power-of-2 f <array> ;
 
+: define-cold-call ( word -- )
+    #! Direct calls to the generic word (not tail calls or indirect calls)
+    #! will jump to the inline cache entry point instead of the megamorphic
+    #! dispatch entry point.
+    dup [ f inline-cache-miss ] curry [ ] like >>direct-entry-def drop ;
+
 M: single-combination perform-combination
     [
         dup build-decision-tree
@@ -256,5 +262,6 @@ M: single-combination perform-combination
                 make-empty-cache ,
                 [ lookup-method (execute) ] %
             ] [ ] make define
-        ] 2bi
+        ]
+        [ drop define-cold-call ] 2tri
     ] with-combination ;
\ No newline at end of file
index 1010e923ea0e49f487f40b10d2dc448ba97e57e0..56a72d5c1ed2e11bed8583c17d779c98a6d57594 100755 (executable)
@@ -26,6 +26,8 @@ void default_parameters(F_PARAMETERS *p)
        p->tenured_size = 4 * CELLS;
 #endif
 
+       p->max_pic_size = 3;
+
        p->secure_gc = false;
        p->fep = false;
 
@@ -100,8 +102,6 @@ void init_factor(F_PARAMETERS *p)
        p->tenured_size <<= 20;
        p->code_size <<= 20;
 
-       p->max_pic_size = 3;
-
        /* Disable GC during init as a sanity check */
        gc_off = true;
 
index 9a827d00ef308519f164e5a67b61b1f5569381c0..8f7ef73c0d4213d484be28a5af485c7a73364b66 100755 (executable)
--- a/vm/run.h
+++ b/vm/run.h
@@ -61,7 +61,7 @@ typedef enum {
        JIT_EXECUTE_CALL,
 
        /* Used by polymorphic inline cache generation in inline_cache.c */
-       PIC_TAG             = 53,
+       PIC_TAG             = 48,
        PIC_HI_TAG,
        PIC_TUPLE,
        PIC_HI_TAG_TUPLE,