[SCM] Lisaac compiler branch, living-external, updated. lisaac-0.12-548-gf6e3b14

Mildred Ki'Lya silkensedai at online.fr
Thu Oct 8 17:06:22 UTC 2009


The following commit has been merged in the living-external branch:
commit 341a2a7fab2a89b57abae711b7eba02f686ac6f0
Author: Mildred Ki'Lya <silkensedai at online.fr>
Date:   Thu Oct 8 16:31:17 2009 +0200

    Added PROFIL.force_alive to prevent it from being removed

diff --git a/src/profil.li b/src/profil.li
index 95c9e0a..f82b662 100644
--- a/src/profil.li
+++ b/src/profil.li
@@ -48,6 +48,8 @@ Section Public
   - is_interrupt:BOOLEAN;
   
   - is_external:BOOLEAN;
+
+  - force_alive :BOOLEAN <- FALSE;
   
   + type_self:TYPE_FULL; 
     
@@ -220,12 +222,16 @@ Section Public
   
   - remove_inline <-
   (    
-    PROFIL_LIST.remove Self;    
+    force_alive.if_false {
+      PROFIL_LIST.remove Self;
+    };
   );
   
   - remove <-
-  ( 
-    code.remove;    
+  (
+    force_alive.if_false {
+      code.remove;
+    };
   );
   
   - search_tail_recursive:BOOLEAN <-
@@ -410,7 +416,7 @@ Section Public
     counter_function := counter_function + 1;
     //
     profil_current := Self;
-    ((link_count != 0) || {result_list.count != 0}).if {
+    ((force_alive) || {link_count != 0} || {result_list.count != 0}).if {
       ((cop_link_count != 0) && {result_list.count = 0}).if {
         // COP link.
         not_yet_implemented;
diff --git a/src/profil_slot.li b/src/profil_slot.li
index eb34c89..d4dd873 100644
--- a/src/profil_slot.li
+++ b/src/profil_slot.li
@@ -53,6 +53,8 @@ Section Public
     is_context_sensitive := TRUE;
   );
 
+  - force_alive :BOOLEAN <- ! is_static;
+
   //
   // Creation.
   //
@@ -117,13 +119,15 @@ Section Public
     code := list_current;
     arg_type_tmp := call_lst;
     //
-    // Arguments.    
+    // Arguments.
+    // (add LOCALs in argument_list with the correct static type)
     item_lst := s.argument_list;    
     argument_list := FAST_ARRAY(LOCAL).create_with_capacity (s.argument_count); 
     (item_lst.lower).to (item_lst.upper) do { j:INTEGER;
       item_lst.item j.to_run_in argument_list for Self;
     };
-    
+
+    // (write comment in locals from argument_list if in Section External)
     ((s.id_section.is_external) && {argument_list.count > 1}).if {
       (argument_list.lower+1).to (argument_list.upper) do { j:INTEGER;      
 	loc := argument_list.item j;
@@ -142,13 +146,20 @@ Section Public
       (tm.lower).to (tm.upper) do { k:INTEGER;	  
         typ := tm.item k.to_run_for Self;	
         loc := typ.get (s.position) result (k+1);
+        force_alive.if {
+          loc.increment_ensure_count;
+        };
         result_list.add_last loc;        
       };      
     } else {      
       ts ?= s.result_type;      
       (ts != ITM_TYPE_SIMPLE.type_void).if {
-        typ := ts.to_run_for Self;	                
-        result_list.add_last (typ.get (s.position) result 0);         
+        typ := ts.to_run_for Self;
+        loc := typ.get (s.position) result 0;
+        force_alive.if {
+          loc.increment_ensure_count;
+        };
+        result_list.add_last loc;         
       };
     };           
     //
@@ -165,14 +176,18 @@ Section Public
   
   - remove_inline <-
   (
-    parent_profil.remove_inline;
-    slot_code.remove_profil Self;    
+    force_alive.if_false {
+      parent_profil.remove_inline;
+      slot_code.remove_profil Self;
+    };
   );
   
   - remove <-
-  ( 
-    parent_profil.remove;
-    slot_code.remove_profil Self;            
+  (
+    force_alive.if_false {
+      parent_profil.remove;
+      slot_code.remove_profil Self;
+    };
   );
   
   //
diff --git a/src/variable/section_.li b/src/variable/section_.li
index 4d79f5d..89bcebb 100644
--- a/src/variable/section_.li
+++ b/src/variable/section_.li
@@ -89,6 +89,8 @@ Section Public
   - is_directory:BOOLEAN <- name = ALIAS_STR.section_directory;
   
   - is_external:BOOLEAN  <- name = ALIAS_STR.section_external;
+
+  - is_external_or_interrupt :BOOLEAN <- (is_external) || {is_interrupt};
   
   - is_private_style:BOOLEAN <-
   (

-- 
Lisaac compiler



More information about the Lisaac-commits mailing list