memory_allocators.g.hh

Go to the documentation of this file.
00001 // This file is automatically generated, do not edit.
00002 
00003 #ifndef lestes__md__mem__memory_allocators_g_hh__included
00004 #define lestes__md__mem__memory_allocators_g_hh__included
00005 
00006 #include <lestes/md/common.hh>
00007 #include <lestes/std/map.hh>
00008 #include <lestes/md/mem/memory_allocator_bases.g.hh>
00009 
00010 #include <lestes/std/objectize_macros.hh>
00011 package(lestes);
00012 package(lang);
00013 package(cplus);
00014 package(sem);
00015 class ss_function_declaration;
00016 end_package(sem);
00017 end_package(cplus);
00018 end_package(lang);
00019 end_package(lestes);
00020 
00021 package(lestes);
00022 package(lang);
00023 package(cplus);
00024 package(sem);
00025 class ss_object_declaration;
00026 end_package(sem);
00027 end_package(cplus);
00028 end_package(lang);
00029 end_package(lestes);
00030 
00031 package(lestes);
00032 package(backend_v2);
00033 package(intercode);
00034 class pi_mem_factory;
00035 end_package(intercode);
00036 end_package(backend_v2);
00037 end_package(lestes);
00038 
00039 package(lestes);
00040 package(backend_v2);
00041 package(intercode);
00042 class pi_mf_stack;
00043 end_package(intercode);
00044 end_package(backend_v2);
00045 end_package(lestes);
00046 
00047 package(lestes);
00048 package(backend_v2);
00049 package(intercode);
00050 class pi_mf_decl;
00051 end_package(intercode);
00052 end_package(backend_v2);
00053 end_package(lestes);
00054 
00055 package(lestes);
00056 package(backend_v2);
00057 package(intercode);
00058 class pi_pi;
00059 end_package(intercode);
00060 end_package(backend_v2);
00061 end_package(lestes);
00062 
00063 package(lestes);
00064 package(backend_v2);
00065 package(intercode);
00066 class pi_sp;
00067 end_package(intercode);
00068 end_package(backend_v2);
00069 end_package(lestes);
00070 
00071 package(lestes);
00072 package(md);
00073 package(literals);
00074 class literal_info_base;
00075 end_package(literals);
00076 end_package(md);
00077 end_package(lestes);
00078 
00079 package(lestes);
00080 package(backend_v2);
00081 package(intercode);
00082 class pi_abstract_function_call;
00083 end_package(intercode);
00084 end_package(backend_v2);
00085 end_package(lestes);
00086 
00087 package(lestes);
00088 package(md);
00089 package(types);
00090 class tm_data_type_base;
00091 end_package(types);
00092 end_package(md);
00093 end_package(lestes);
00094 
00095 package(lestes);
00096 package(md);
00097 package(mem);
00098 
00099 
00100 class local_variable_allocator;
00101 class global_variable_allocator;
00102 
00103 
00104 //! Manager for local variable allocation.
00105 class local_variable_allocator : public local_variable_allocator_base {
00106 public:
00107         //! The method placement_calculated_get returns the value of the field local_variable_allocator::placement_calculated.
00108         bool placement_calculated_get() const;
00109 
00110         //! The method placement_calculated_set sets the field local_variable_allocator::placement_calculated to the given value.
00111         void placement_calculated_set(bool);
00112 
00113         //! The method preserved_space_size_get returns the value of the field local_variable_allocator::preserved_space_size.
00114         t_ssize preserved_space_size_get() const;
00115 
00116         //! The method preserved_space_size_set sets the field local_variable_allocator::preserved_space_size to the given value.
00117         void preserved_space_size_set(t_ssize);
00118 
00119         //! The method vars_space_start_offset_get returns the value of the field local_variable_allocator::vars_space_start_offset.
00120         t_ssize vars_space_start_offset_get() const;
00121 
00122         //! The method vars_space_start_offset_set sets the field local_variable_allocator::vars_space_start_offset to the given value.
00123         void vars_space_start_offset_set(t_ssize);
00124 
00125         //! The method tmps_space_start_offset_get returns the value of the field local_variable_allocator::tmps_space_start_offset.
00126         t_ssize tmps_space_start_offset_get() const;
00127 
00128         //! The method tmps_space_start_offset_set sets the field local_variable_allocator::tmps_space_start_offset to the given value.
00129         void tmps_space_start_offset_set(t_ssize);
00130 
00131         //! The method local_end_offset_get returns the value of the field local_variable_allocator::local_end_offset.
00132         t_ssize local_end_offset_get() const;
00133 
00134         //! The method local_end_offset_set sets the field local_variable_allocator::local_end_offset to the given value.
00135         void local_end_offset_set(t_ssize);
00136 
00137         //! The method singleton_instances_get returns the value of the field local_variable_allocator::singleton_instances.
00138         static ptr< ::lestes::std::map< srp< ::lestes::lang::cplus::sem::ss_function_declaration >, srp< local_variable_allocator > > > singleton_instances_get();
00139 
00140         //! The method singleton_instances_set sets the field local_variable_allocator::singleton_instances to the given value.
00141         static void singleton_instances_set(const ptr< ::lestes::std::map< srp< ::lestes::lang::cplus::sem::ss_function_declaration >, srp< local_variable_allocator > > > & );
00142 
00143         //! The method tmps_get returns the value of the field local_variable_allocator::tmps.
00144         ptr< ::lestes::std::list< srp< ::lestes::backend_v2::intercode::pi_mf_stack > > > tmps_get() const;
00145 
00146         //! The method tmps_set sets the field local_variable_allocator::tmps to the given value.
00147         void tmps_set(const ptr< ::lestes::std::list< srp< ::lestes::backend_v2::intercode::pi_mf_stack > > > & );
00148 
00149         //! The method variables_get returns the value of the field local_variable_allocator::variables.
00150         ptr< ::lestes::std::map< srp< ::lestes::lang::cplus::sem::ss_object_declaration >, srp< ::lestes::backend_v2::intercode::pi_mf_stack > > > variables_get() const;
00151 
00152         //! The method variables_set sets the field local_variable_allocator::variables to the given value.
00153         void variables_set(const ptr< ::lestes::std::map< srp< ::lestes::lang::cplus::sem::ss_object_declaration >, srp< ::lestes::backend_v2::intercode::pi_mf_stack > > > & );
00154 
00155         //! Allocates space for variable on the local stack.
00156         virtual ptr< ::lestes::backend_v2::intercode::pi_mem_factory > allocate_tmp(ptr< ::lestes::md::types::tm_data_type_base > type);
00157 
00158         //! Allocates space for variable on the local stack.
00159         virtual ptr< ::lestes::backend_v2::intercode::pi_mem_factory > allocate(ptr< ::lestes::lang::cplus::sem::ss_object_declaration > decl);
00160 
00161         //! Deallocates space for variable on the local stack.
00162         virtual void deallocate(ptr< ::lestes::backend_v2::intercode::pi_mem_factory > mem, ptr< ::lestes::backend_v2::intercode::pi_sp > psp, ptr< ::lestes::backend_v2::intercode::pi_sp > nsp);
00163 
00164         //! Calculates placement of local variables and parameters in memory.
00165         virtual void calculate_placement();
00166 
00167         //! Calculates placement of regular local variables in memory.
00168         void calculate_vars_placement();
00169 
00170         //! Calculates placement of temporal local variables in memory.
00171         void calculate_tmps_placement();
00172 
00173         //! Return allocator instance for specific function.
00174         static ptr< local_variable_allocator > instance(ptr< ::lestes::lang::cplus::sem::ss_function_declaration > function);
00175 
00176         
00177         //! First generated factory method for class local_variable_allocator.
00178         static ptr< local_variable_allocator > create (
00179                 ptr< ::lestes::lang::cplus::sem::ss_function_declaration > a__local_variable_allocator_base__function,
00180                 bool a__local_variable_allocator__placement_calculated,
00181                 t_ssize a__local_variable_allocator__preserved_space_size,
00182                 t_ssize a__local_variable_allocator__vars_space_start_offset,
00183                 t_ssize a__local_variable_allocator__tmps_space_start_offset,
00184                 t_ssize a__local_variable_allocator__local_end_offset,
00185                 ptr< ::lestes::std::list< srp< ::lestes::backend_v2::intercode::pi_mf_stack > > > a__local_variable_allocator__tmps,
00186                 ptr< ::lestes::std::map< srp< ::lestes::lang::cplus::sem::ss_object_declaration >, srp< ::lestes::backend_v2::intercode::pi_mf_stack > > > a__local_variable_allocator__variables);
00187 
00188         //! Second generated factory method for class local_variable_allocator.
00189         static ptr< local_variable_allocator > create (
00190                 ptr< ::lestes::lang::cplus::sem::ss_function_declaration > a__local_variable_allocator_base__function);
00191 
00192         
00193 
00194         //! for purposes of dumping
00195         virtual ptr<reflection_list> reflection_get() const;
00196         //! for purposes of dumping
00197         virtual ptr<field_list_list> field_values_get() const;
00198         
00199 protected:
00200         //! Generated constructor for class local_variable_allocator.
00201         local_variable_allocator (
00202                 ptr< ::lestes::lang::cplus::sem::ss_function_declaration > a__local_variable_allocator_base__function,
00203                 bool a__local_variable_allocator__placement_calculated,
00204                 t_ssize a__local_variable_allocator__preserved_space_size,
00205                 t_ssize a__local_variable_allocator__vars_space_start_offset,
00206                 t_ssize a__local_variable_allocator__tmps_space_start_offset,
00207                 t_ssize a__local_variable_allocator__local_end_offset,
00208                 ptr< ::lestes::std::list< srp< ::lestes::backend_v2::intercode::pi_mf_stack > > > a__local_variable_allocator__tmps,
00209                 ptr< ::lestes::std::map< srp< ::lestes::lang::cplus::sem::ss_object_declaration >, srp< ::lestes::backend_v2::intercode::pi_mf_stack > > > a__local_variable_allocator__variables);
00210 
00211         //! Marking routine for class local_variable_allocator. 
00212         virtual void gc_mark();
00213 
00214 private:
00215         //! Tells whether placement has been already calculated.
00216         bool placement_calculated;
00217         //! Space on function's stack used for storing preserved register.
00218         t_ssize preserved_space_size;
00219         //! Stack offset where space for regular variables starts.
00220         t_ssize vars_space_start_offset;
00221         //! Stack offset where space for temporal variables starts.
00222         t_ssize tmps_space_start_offset;
00223         //! Stack offset where the function's local space ends.
00224         t_ssize local_end_offset;
00225         static ptr< ::lestes::std::map< srp< ::lestes::lang::cplus::sem::ss_function_declaration >, srp< local_variable_allocator > > >  singleton_instances;
00226         //! Temporal variables.
00227         srp< ::lestes::std::list< srp< ::lestes::backend_v2::intercode::pi_mf_stack > > >  tmps;
00228         //! Regular variables.
00229         srp< ::lestes::std::map< srp< ::lestes::lang::cplus::sem::ss_object_declaration >, srp< ::lestes::backend_v2::intercode::pi_mf_stack > > >  variables;
00230         static ptr<reflection_list> reflection;
00231         
00232 }; // local_variable_allocator
00233 
00234 
00235 //! Manager for global variable allocation.
00236 class global_variable_allocator : public global_variable_allocator_base {
00237 public:
00238         //! The method singleton_instance_get returns the value of the field global_variable_allocator::singleton_instance.
00239         static ptr< global_variable_allocator > singleton_instance_get();
00240 
00241         //! The method singleton_instance_set sets the field global_variable_allocator::singleton_instance to the given value.
00242         static void singleton_instance_set(const ptr< global_variable_allocator > &);
00243 
00244         //! The method variables_get returns the value of the field global_variable_allocator::variables.
00245         ptr< ::lestes::std::map< srp< ::lestes::lang::cplus::sem::ss_object_declaration >, srp< ::lestes::backend_v2::intercode::pi_mf_decl > > > variables_get() const;
00246 
00247         //! The method variables_set sets the field global_variable_allocator::variables to the given value.
00248         void variables_set(const ptr< ::lestes::std::map< srp< ::lestes::lang::cplus::sem::ss_object_declaration >, srp< ::lestes::backend_v2::intercode::pi_mf_decl > > > & );
00249 
00250         //! The method values_get returns the value of the field global_variable_allocator::values.
00251         ptr< ::lestes::std::map< srp< ::lestes::backend_v2::intercode::pi_mem_factory >, srp< ::lestes::md::literals::literal_info_base > > > values_get() const;
00252 
00253         //! The method values_set sets the field global_variable_allocator::values to the given value.
00254         void values_set(const ptr< ::lestes::std::map< srp< ::lestes::backend_v2::intercode::pi_mem_factory >, srp< ::lestes::md::literals::literal_info_base > > > & );
00255 
00256         //! Allocates space for variable in global data storage.
00257         virtual ptr< ::lestes::backend_v2::intercode::pi_mem_factory > allocate(ptr< ::lestes::lang::cplus::sem::ss_object_declaration > decl);
00258 
00259         //! Initialiaze memory space in global data storage with given value.
00260         virtual void init_variable(ptr< ::lestes::backend_v2::intercode::pi_mem_factory > mem, ptr< ::lestes::md::literals::literal_info_base > value);
00261 
00262         //! Deallocates space for variable.
00263         virtual void deallocate(ptr< ::lestes::backend_v2::intercode::pi_mem_factory > mem, ptr< ::lestes::backend_v2::intercode::pi_sp > psp, ptr< ::lestes::backend_v2::intercode::pi_sp > nsp);
00264 
00265         //! Generates asm declarations for initialized global variables.
00266         void emit_asm_declarations_for_initialized(::std::ostream& output);
00267 
00268         //! Generates asm declarations for uninitialized global variables.
00269         void emit_asm_declarations_for_uninitialized(::std::ostream& output);
00270 
00271         //! Calculates placement of allocated variables in memory.
00272         virtual void calculate_placement();
00273 
00274         static ptr< global_variable_allocator > instance();
00275 
00276         
00277         //! First generated factory method for class global_variable_allocator.
00278         static ptr< global_variable_allocator > create (
00279                 ptr< ::lestes::std::map< srp< ::lestes::lang::cplus::sem::ss_object_declaration >, srp< ::lestes::backend_v2::intercode::pi_mf_decl > > > a__global_variable_allocator__variables,
00280                 ptr< ::lestes::std::map< srp< ::lestes::backend_v2::intercode::pi_mem_factory >, srp< ::lestes::md::literals::literal_info_base > > > a__global_variable_allocator__values);
00281 
00282         //! Second generated factory method for class global_variable_allocator.
00283         static ptr< global_variable_allocator > create (
00284                 );
00285 
00286         
00287 
00288         //! for purposes of dumping
00289         virtual ptr<reflection_list> reflection_get() const;
00290         //! for purposes of dumping
00291         virtual ptr<field_list_list> field_values_get() const;
00292         
00293 protected:
00294         //! Generated constructor for class global_variable_allocator.
00295         global_variable_allocator (
00296                 ptr< ::lestes::std::map< srp< ::lestes::lang::cplus::sem::ss_object_declaration >, srp< ::lestes::backend_v2::intercode::pi_mf_decl > > > a__global_variable_allocator__variables,
00297                 ptr< ::lestes::std::map< srp< ::lestes::backend_v2::intercode::pi_mem_factory >, srp< ::lestes::md::literals::literal_info_base > > > a__global_variable_allocator__values);
00298 
00299         //! Marking routine for class global_variable_allocator. 
00300         virtual void gc_mark();
00301 
00302 private:
00303         static ptr< global_variable_allocator > singleton_instance;
00304         //! Global variables that has benn alocated by the allocator.
00305         srp< ::lestes::std::map< srp< ::lestes::lang::cplus::sem::ss_object_declaration >, srp< ::lestes::backend_v2::intercode::pi_mf_decl > > >  variables;
00306         //! Initial values for initialized global variables.
00307         srp< ::lestes::std::map< srp< ::lestes::backend_v2::intercode::pi_mem_factory >, srp< ::lestes::md::literals::literal_info_base > > >  values;
00308         static ptr<reflection_list> reflection;
00309         
00310 }; // global_variable_allocator
00311 
00312 
00313 end_package(mem);
00314 end_package(md);
00315 end_package(lestes);
00316 
00317 #endif // lestes__md__mem__memory_allocators_g_hh__included

Generated on Mon Feb 12 18:22:41 2007 for lestes by doxygen 1.5.1-20070107