1 ///////////////////////////////////////////////////////////////////////////////
4 // LSIIT - ULP - CNRS - INRIA - FRANCE //
6 // This program is free software: you can redistribute it and/or modify //
7 // it under the terms of the GNU General Public License as published by //
8 // the Free Software Foundation, either version 3 of the License, or //
9 // (at your option) any later version. //
11 // This program is distributed in the hope that it will be useful, //
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
14 // GNU General Public License for more details. //
16 // You should have received a copy of the GNU General Public License //
17 // along with this program. If not, see <http://www.gnu.org/licenses/>. //
19 // http://isaacproject.u-strasbg.fr/ //
20 ///////////////////////////////////////////////////////////////////////////////
23 + name := PROFIL_SLOT;
25 - copyright := "2003-2007 Benoit Sonntag";
28 - author := "Sonntag Benoit (bsonntag@loria.fr)";
29 - comment := "Method with costumization";
33 + parent_profil:Expanded PROFIL;
37 - slot:SLOT <- slot_code;
39 - is_interrupt:BOOLEAN <- slot_code.id_section.is_interrupt;
40 - is_external:BOOLEAN <- slot_code.id_section.is_external;
42 + slot_code:SLOT_CODE;
44 + is_context_sensitive:BOOLEAN;
45 // BSBS: Le bloc passé en argument peux ne pas etre context sensitive
46 // Et puis, cet stat peu changer dans le temps...
48 - set_context_sensitive <-
50 is_context_sensitive := TRUE;
57 - make s:SLOT_CODE with call_lst:FAST_ARRAY[EXPR] verify is_first:BOOLEAN :FAST_ARRAY[WRITE] <-
60 + item_lst:FAST_ARRAY[ITM_ARGUMENT];
62 + type_multiple:ITM_TYPE_MULTI;
63 + type_mono:ITM_TYPE_MONO;
64 + result:FAST_ARRAY[WRITE];
68 (s.id_section.is_external).if {
71 name := ALIAS_STR.get_intern (s.name);
74 type_self := ITM_TYPE_SELF.to_run;
77 item_lst := s.base_slot.argument_list;
78 argument_list := FAST_ARRAY[LOCAL].create_with_capacity (s.base_slot.argument_count);
79 (item_lst.lower).to (item_lst.upper) do { j:INTEGER;
80 item_lst.item j.to_run argument_list;
82 ((s.id_section.is_external) && {argument_list.count > 1}).if {
83 (argument_list.lower+1).to (argument_list.upper) do { j:INTEGER;
84 loc := argument_list.item j;
85 loc.set_ensure_count 1;
86 loc.write (loc.position) value (
87 EXTERNAL_C.create (loc.position) text "/* External slot */"
88 access NULL persistant FALSE type (loc.type)
94 (s.base_slot.type != ITM_TYPE_MONO.type_void).if {
95 type_multiple ?= s.base_slot.type;
96 (type_multiple != NULL).if {
97 result_list := FAST_ARRAY[LOCAL].create_with_capacity (type_multiple.count - 1);
99 0.to (type_multiple.upper - 1) do { k:INTEGER;
100 typ := type_multiple.item k.to_run;
101 loc := typ.get (s.position) result idx_result;
102 result_list.add_last loc;
103 idx_result := idx_result + 1;
105 typ := type_multiple.last.to_run;
107 type_mono ?= s.base_slot.type;
108 typ := type_mono.to_run;
110 result_last := typ.get (s.position) result idx_result;
113 result := write_argument call_lst;
115 context := CONTEXT.push_extern (slot_code.position) profil Self;
116 code := list_current;
117 slot_code.create_code is_first;
129 parent_profil.remove_inline;
130 slot_code.remove_profil Self;
135 parent_profil.remove;
136 slot_code.remove_profil Self;
143 - is_static:BOOLEAN <- (! slot.id_section.is_interrupt) && {! slot.id_section.is_external};