[SCM] Lisaac compiler branch, master, updated. lisaac-0.12-383-g0964c40
Benoit Sonntag
sonntag at icps.u-strasbg.fr
Mon Aug 3 23:31:55 UTC 2009
The following commit has been merged in the master branch:
commit 0964c40bf03f646406fb9f591a8b0acd04df86cb
Author: Benoit Sonntag <sonntag at icps.u-strasbg.fr>
Date: Tue Aug 4 01:31:49 2009 +0200
light bug for block context
diff --git a/src/code_life/read.li b/src/code_life/read.li
index 299837c..5758d54 100644
--- a/src/code_life/read.li
+++ b/src/code_life/read.li
@@ -84,8 +84,8 @@ Section Public
variable.intern_name.print; '\n'.print;
"style [".print; variable.style.print; "]\n".print;
warning_error (position,"READ : Compiler BUG! (require_first = NULL) ");
- list_current.debug_display;
- die_with_code 0;
+ //list_current.debug_display;
+ //die_with_code 0;
//crash_with_message "BUG READ : require_first = NULL";
};
diff --git a/src/item/itm_object.li b/src/item/itm_object.li
index 64b03e3..11fafb3 100644
--- a/src/item/itm_object.li
+++ b/src/item/itm_object.li
@@ -36,12 +36,15 @@ Section Inherit
Section Public
- - context_extern:LOCAL;
+ - bottom_index:INTEGER;
- - set_context_extern l:LOCAL <-
+ - clean_bottom_index <-
(
- context_extern := l;
+ bottom_index := stack_local.upper + 1;
+ context_extern := NULL;
);
+
+ - context_extern:LOCAL;
- lookup n:STRING_CONSTANT :LOCAL <-
( + result:LOCAL;
@@ -54,15 +57,16 @@ Section Public
};
(j >= stack_local.lower).if {
result := stack_local.item j;
-
- /*
- ((j < CONTEXT.limit_context) && {result.style != '-'}).if {
- context_extern := result;
+
+ ((j < bottom_index) && {result.style != '-'}).if {
+ bottom_index := j;
+ context_extern := result;
};
- */
+
}.elseif {profil_slot != NULL} then {
result := profil_slot.lookup n;
((result != NULL) && {result.name != ALIAS_STR.variable_self}).if {
+ bottom_index := -1;
context_extern := result;
};
};
diff --git a/src/profil.li b/src/profil.li
index c68a105..418ca9d 100644
--- a/src/profil.li
+++ b/src/profil.li
@@ -536,6 +536,11 @@ Section Private
} else {
buffer.append "Inlinable.";
};
+ (is_context_sensitive).if {
+ buffer.append " Context_sensitive.";
+ } else {
+ buffer.append " No Context_sensitive.";
+ };
buffer.add_last '\n';
);
diff --git a/src/profil_block.li b/src/profil_block.li
index a86085e..76752c2 100644
--- a/src/profil_block.li
+++ b/src/profil_block.li
@@ -126,7 +126,7 @@ Section Public
old_list := list_current;
profil_current := Self;
list_current := LIST.create (list.position);
- ITM_OBJECT.set_context_extern NULL;
+ ITM_OBJECT.clean_bottom_index;
// Add context debug.
(debug_level_option != 0).if {
context := TYPE_CONTEXT.default.new_local (list.position)
@@ -180,7 +180,9 @@ Section Public
result.remove; // BSBS: Il y a un petit gachi...
r_list := ALIAS_ARRAY[TYPE_FULL].alias r_list;
//
- context_extern := ITM_OBJECT.context_extern;
+ (ITM_OBJECT.bottom_index <= stack_local.upper).if {
+ context_extern := ITM_OBJECT.context_extern;
+ };
to_type_block := TYPE_BLOCK.get_direct a_list and_result r_list;
stack_local.remove_since stack_top;
//
diff --git a/src2/code_life/read.li b/src2/code_life/read.li
index cb394fd..e02cf5c 100644
--- a/src2/code_life/read.li
+++ b/src2/code_life/read.li
@@ -84,8 +84,8 @@ Section Public
variable.intern_name.print; '\n'.print;
"style [".print; variable.style.print; "]\n".print;
warning_error (position,"READ : Compiler BUG! (require_first = NULL) ");
- list_current.debug_display;
- die_with_code 0;
+ //list_current.debug_display;
+ //die_with_code 0;
//crash_with_message "BUG READ : require_first = NULL";
};
diff --git a/src2/item/itm_object.li b/src2/item/itm_object.li
index 64b03e3..c603b42 100644
--- a/src2/item/itm_object.li
+++ b/src2/item/itm_object.li
@@ -38,11 +38,14 @@ Section Public
- context_extern:LOCAL;
- - set_context_extern l:LOCAL <-
+ - bottom_index:INTEGER;
+
+ - clean_bottom_index <-
(
- context_extern := l;
- );
-
+ bottom_index := stack_local.upper + 1;
+ context_extern := NULL;
+ );
+
- lookup n:STRING_CONSTANT :LOCAL <-
( + result:LOCAL;
+ j:INTEGER;
@@ -55,14 +58,15 @@ Section Public
(j >= stack_local.lower).if {
result := stack_local.item j;
- /*
- ((j < CONTEXT.limit_context) && {result.style != '-'}).if {
- context_extern := result;
+ ((j < bottom_index) && {result.style != '-'}).if {
+ bottom_index := j;
+ context_extern := result;
};
- */
+
}.elseif {profil_slot != NULL} then {
result := profil_slot.lookup n;
((result != NULL) && {result.name != ALIAS_STR.variable_self}).if {
+ bottom_index := -1;
context_extern := result;
};
};
diff --git a/src2/profil_block.li b/src2/profil_block.li
index 582ec8e..12b3eed 100644
--- a/src2/profil_block.li
+++ b/src2/profil_block.li
@@ -126,7 +126,7 @@ Section Public
old_list := list_current;
profil_current := Self;
list_current := LIST.create (list.position);
- ITM_OBJECT.set_context_extern NULL;
+ ITM_OBJECT.clean_bottom_index;
// Add context debug.
(debug_level_option != 0).if {
context := TYPE_CONTEXT.default.new_local (list.position)
@@ -180,7 +180,9 @@ Section Public
result.remove; // BSBS: Il y a un petit gachi...
r_list := ALIAS_ARRAY(TYPE_FULL).alias r_list;
//
- context_extern := ITM_OBJECT.context_extern;
+ (ITM_OBJECT.bottom_index <= stack_local.upper).if {
+ context_extern := ITM_OBJECT.context_extern;
+ };
to_type_block := TYPE_BLOCK.get_direct a_list and_result r_list;
stack_local.remove_since stack_top;
//
--
Lisaac compiler
More information about the Lisaac-commits
mailing list