#include <memory_allocators.g.hh>
Inheritance diagram for lestes::md::mem::global_variable_allocator:

Definition at line 236 of file memory_allocators.g.hh.
| lestes::md::mem::global_variable_allocator::global_variable_allocator | ( | 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, | |
| ptr< ::lestes::std::map< srp< ::lestes::backend_v2::intercode::pi_mem_factory >, srp< ::lestes::md::literals::literal_info_base > > > | a__global_variable_allocator__values | |||
| ) | [protected] |
Generated constructor for class global_variable_allocator.
Generated constructor for class global_variable_allocator.
Definition at line 347 of file memory_allocators.g.cc.
Referenced by create().
00349 : global_variable_allocator_base(), variables(checked(a__global_variable_allocator__variables)), values(checked(a__global_variable_allocator__values)) 00350 {}
| ptr< global_variable_allocator > lestes::md::mem::global_variable_allocator::singleton_instance_get | ( | ) | [static] |
The method singleton_instance_get returns the value of the field global_variable_allocator::singleton_instance.
Definition at line 273 of file memory_allocators.g.cc.
References singleton_instance.
00274 { 00275 return singleton_instance; 00276 }
| void lestes::md::mem::global_variable_allocator::singleton_instance_set | ( | const ptr< global_variable_allocator > & | x | ) | [static] |
The method singleton_instance_set sets the field global_variable_allocator::singleton_instance to the given value.
| [in] | x | The new value to set global_variable_allocator::singleton_instance to. |
Definition at line 282 of file memory_allocators.g.cc.
References singleton_instance.
00283 { 00284 global_variable_allocator::singleton_instance = x; 00285 }
| ptr<::lestes::std::map< srp<::lestes::lang::cplus::sem::ss_object_declaration >, srp<::lestes::backend_v2::intercode::pi_mf_decl > > > lestes::md::mem::global_variable_allocator::variables_get | ( | ) | const |
The method variables_get returns the value of the field global_variable_allocator::variables.
Definition at line 291 of file memory_allocators.g.cc.
References variables.
Referenced by emit_asm_declarations_for_initialized(), and emit_asm_declarations_for_uninitialized().
00292 { 00293 return variables; 00294 }
| void lestes::md::mem::global_variable_allocator::variables_set | ( | const ptr< ::lestes::std::map< srp< ::lestes::lang::cplus::sem::ss_object_declaration >, srp< ::lestes::backend_v2::intercode::pi_mf_decl > > > & | x | ) |
The method variables_set sets the field global_variable_allocator::variables to the given value.
| [in] | x | The new value to set global_variable_allocator::variables to. |
Definition at line 300 of file memory_allocators.g.cc.
References variables.
00301 { 00302 global_variable_allocator::variables = x; 00303 }
| ptr<::lestes::std::map< srp<::lestes::backend_v2::intercode::pi_mem_factory >, srp<::lestes::md::literals::literal_info_base > > > lestes::md::mem::global_variable_allocator::values_get | ( | ) | const |
The method values_get returns the value of the field global_variable_allocator::values.
Definition at line 309 of file memory_allocators.g.cc.
References values.
Referenced by emit_asm_declarations_for_initialized(), and emit_asm_declarations_for_uninitialized().
00310 { 00311 return values; 00312 }
| void lestes::md::mem::global_variable_allocator::values_set | ( | const ptr< ::lestes::std::map< srp< ::lestes::backend_v2::intercode::pi_mem_factory >, srp< ::lestes::md::literals::literal_info_base > > > & | x | ) |
The method values_set sets the field global_variable_allocator::values to the given value.
| [in] | x | The new value to set global_variable_allocator::values to. |
Definition at line 318 of file memory_allocators.g.cc.
References values.
00319 { 00320 global_variable_allocator::values = x; 00321 }
| virtual ptr< ::lestes::backend_v2::intercode::pi_mem_factory > lestes::md::mem::global_variable_allocator::allocate | ( | ptr< ::lestes::lang::cplus::sem::ss_object_declaration > | decl | ) | [virtual] |
Allocates space for variable in global data storage.
Implements lestes::md::mem::global_variable_allocator_base.
| virtual void lestes::md::mem::global_variable_allocator::init_variable | ( | ptr< ::lestes::backend_v2::intercode::pi_mem_factory > | mem, | |
| ptr< ::lestes::md::literals::literal_info_base > | value | |||
| ) | [virtual] |
Initialiaze memory space in global data storage with given value.
Implements lestes::md::mem::global_variable_allocator_base.
| virtual void lestes::md::mem::global_variable_allocator::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 | |||
| ) | [virtual] |
| void lestes::md::mem::global_variable_allocator::emit_asm_declarations_for_initialized | ( | ::std::ostream & | output | ) |
Generates asm declarations for initialized global variables.
| output | Output stream. |
Definition at line 70 of file memory_allocators.cc.
References lestes::ui::code, lassert, lestes::md::string_replace(), values_get(), and variables_get().
00070 { 00071 lassert(output); 00072 00073 decl2mf_decl_map_type::iterator it; 00074 for(it=variables_get()->begin(); it!=variables_get()->end(); it++) { 00075 00076 mf2pi_li_map_type::iterator it2 = values_get()->find(it->second); 00077 00078 if ( it2==values_get()->end() ) { 00079 /* 00080 Variable is unitialized. 00081 It is emited by emit_asm_declarations_for_uninitialized call. 00082 */ 00083 continue; 00084 } 00085 00086 lstring code = tm_asm::ent_global_simple_decl_get(); 00087 00088 lstring id = name_mangler::instance()->mangle(it->first); 00089 lstring type = it2->second->get_asm_definition_type(); 00090 lstring value = it2->second->get_asm_definition_val(); 00091 00092 code = string_replace(code,"$id",id); 00093 code = string_replace(code,"$type",type); 00094 code = string_replace(code, "$value", value); 00095 output << code; 00096 } 00097 }
| void lestes::md::mem::global_variable_allocator::emit_asm_declarations_for_uninitialized | ( | ::std::ostream & | output | ) |
Generates asm declarations for uninitialized global variables.
| output | Output stream. |
Definition at line 104 of file memory_allocators.cc.
References lestes::ui::code, lassert, lestes::md::string_replace(), values_get(), and variables_get().
00104 { 00105 lassert(output); 00106 00107 decl2mf_decl_map_type::iterator it1; 00108 for(it1=variables_get()->begin(); it1!=variables_get()->end(); it1++) { 00109 00110 mf2pi_li_map_type::iterator it2 = values_get()->find(it1->second); 00111 00112 if ( it2!=values_get()->end() ) { 00113 /* 00114 Variable is itialized. 00115 It is emited by emit_asm_declarations_for_initialized call. 00116 */ 00117 continue; 00118 } 00119 00120 lstring code = tm_asm::ent_global_simple_decl_get(); 00121 00122 lstring id = name_mangler::instance()->mangle(it1->first); 00123 00124 ptr<tm_data_type_base> dt = it1->second->type_get(); 00125 lstring type; 00126 00127 ::std::ostringstream oss; 00128 oss << "resb " << dt->bitwidth_get()/8; 00129 type = oss.str(); 00130 00131 code = string_replace(code,"$id",id); 00132 code = string_replace(code,"$type",type); 00133 code = string_replace(code, "$value", ""); 00134 output << code; 00135 } 00136 }
| void lestes::md::mem::global_variable_allocator::calculate_placement | ( | ) | [virtual] |
Calculates placement of allocated variables in memory.
Implements lestes::md::mem::global_variable_allocator_base.
Definition at line 61 of file memory_allocators.cc.
| ptr< global_variable_allocator > lestes::md::mem::global_variable_allocator::instance | ( | ) | [static] |
Definition at line 37 of file memory_allocators_instances.cc.
References create(), and singleton_instance.
00037 { 00038 if ( !singleton_instance ) { 00039 //A singleton instance has not been created yet. Create it! 00040 singleton_instance = global_variable_allocator::create(); 00041 } 00042 //Return instance 00043 return singleton_instance; 00044 }
| ptr< global_variable_allocator > lestes::md::mem::global_variable_allocator::create | ( | 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, | |
| ptr< ::lestes::std::map< srp< ::lestes::backend_v2::intercode::pi_mem_factory >, srp< ::lestes::md::literals::literal_info_base > > > | a__global_variable_allocator__values | |||
| ) | [static] |
First generated factory method for class global_variable_allocator.
This factory method for class global_variable_allocator takes values of all fields as arguments.
Definition at line 327 of file memory_allocators.g.cc.
References global_variable_allocator().
00329 { 00330 return ptr< global_variable_allocator > ( new global_variable_allocator(a__global_variable_allocator__variables, 00331 a__global_variable_allocator__values) ); 00332 }
| ptr< global_variable_allocator > lestes::md::mem::global_variable_allocator::create | ( | void | ) | [static] |
Second generated factory method for class global_variable_allocator.
This factory method for class global_variable_allocator uses initializers.
Definition at line 338 of file memory_allocators.g.cc.
References global_variable_allocator().
Referenced by instance().
00339 { 00340 return ptr< global_variable_allocator > ( new global_variable_allocator(::lestes::std::map< srp< ::lestes::lang::cplus::sem::ss_object_declaration >, srp< ::lestes::backend_v2::intercode::pi_mf_decl > > ::create(), ::lestes::std::map< srp< ::lestes::backend_v2::intercode::pi_mem_factory >, srp< ::lestes::md::literals::literal_info_base > > ::create()) ); 00341 }
| ptr< object::reflection_list > lestes::md::mem::global_variable_allocator::reflection_get | ( | ) | const [virtual] |
for purposes of dumping
Reimplemented from lestes::md::mem::global_variable_allocator_base.
Definition at line 352 of file memory_allocators.g.cc.
References lestes::std::list< T >::create(), reflection, and lestes::md::mem::global_variable_allocator_base::reflection_get().
00353 { 00354 if (!reflection) { 00355 typedef class_reflection::field_metadata md; 00356 typedef class_reflection::field_metadata_list mdlist; 00357 ptr<mdlist> mdl = mdlist::create(); 00358 mdl->push_back( md::create( "singleton_instance", "global_variable_allocator" ) ); 00359 mdl->push_back( md::create( "variables", "map< srp< ::lestes::lang::cplus::sem::ss_object_declaration >, srp< ::lestes::backend_v2::intercode::pi_mf_decl > >" ) ); 00360 mdl->push_back( md::create( "values", "map< srp< ::lestes::backend_v2::intercode::pi_mem_factory >, srp< ::lestes::md::literals::literal_info_base > >" ) ); 00361 reflection = reflection_list::create( global_variable_allocator_base::reflection_get() ); 00362 reflection->push_back( class_reflection::create( "global_variable_allocator", mdl ) ); 00363 } 00364 return reflection; 00365 }
| ptr< object::field_list_list > lestes::md::mem::global_variable_allocator::field_values_get | ( | ) | const [virtual] |
for purposes of dumping
Reimplemented from lestes::md::mem::global_variable_allocator_base.
Definition at line 367 of file memory_allocators.g.cc.
References lestes::std::list< T >::create(), and lestes::md::mem::global_variable_allocator_base::field_values_get().
00368 { 00369 ptr < field_list_list > result = global_variable_allocator_base::field_values_get(); 00370 result->push_back( value_list::create() ); 00371 result->back()->push_back( this->singleton_instance ); 00372 result->push_back( value_list::create() ); 00373 result->back()->push_back( this->variables ); 00374 result->push_back( value_list::create() ); 00375 result->back()->push_back( this->values ); 00376 return result; 00377 }
| void lestes::md::mem::global_variable_allocator::gc_mark | ( | void | ) | [protected, virtual] |
Marking routine for class global_variable_allocator.
Marking routine is used for garbage collection.
Reimplemented from lestes::md::mem::global_variable_allocator_base.
Definition at line 384 of file memory_allocators.g.cc.
References lestes::md::mem::global_variable_allocator_base::gc_mark().
00385 { 00386 global_variable_allocator_base::gc_mark(); 00387 }
ptr< global_variable_allocator > lestes::md::mem::global_variable_allocator::singleton_instance = singleton_instance [static, private] |
Definition at line 303 of file memory_allocators.g.hh.
Referenced by instance(), singleton_instance_get(), and singleton_instance_set().
srp< ::lestes::std::map< srp< ::lestes::lang::cplus::sem::ss_object_declaration >, srp< ::lestes::backend_v2::intercode::pi_mf_decl > > > lestes::md::mem::global_variable_allocator::variables [private] |
Global variables that has benn alocated by the allocator.
Definition at line 305 of file memory_allocators.g.hh.
Referenced by variables_get(), and variables_set().
srp< ::lestes::std::map< srp< ::lestes::backend_v2::intercode::pi_mem_factory >, srp< ::lestes::md::literals::literal_info_base > > > lestes::md::mem::global_variable_allocator::values [private] |
Initial values for initialized global variables.
Definition at line 307 of file memory_allocators.g.hh.
Referenced by values_get(), and values_set().
ptr< object::reflection_list > lestes::md::mem::global_variable_allocator::reflection = reflection [static, private] |
Reimplemented from lestes::md::mem::global_variable_allocator_base.
Definition at line 308 of file memory_allocators.g.hh.
Referenced by reflection_get().
1.5.1-20070107