summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-07-12 13:07:55 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-07-12 13:08:42 (GMT)
commita331ff258895865049bf79bc1629dbc744b7faf5 (patch)
treec4f649ba21afcacf974cc6536f03aa97663a9acd /src/core
parent9b018cede5af54594c0a20847239233153b04ce1 (diff)
Removed the too complex memory share system.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/processors.c78
-rw-r--r--src/core/processors.h13
2 files changed, 8 insertions, 83 deletions
diff --git a/src/core/processors.c b/src/core/processors.c
index d968d4f..dfe74fb 100644
--- a/src/core/processors.c
+++ b/src/core/processors.c
@@ -29,9 +29,6 @@
#include <string.h>
-#include "../arch/immediate.h"
-#include "../arch/target.h"
-#include "../arch/register.h"
#include "../arch/arm/v7/core.h"
#include "../arch/arm/v7/processor.h"
#include "../arch/dalvik/core.h"
@@ -48,9 +45,6 @@ typedef struct _proc_t
GType instance; /* Type à manipuler en interne */
init_arch_fc init; /* Phase d'intialisation */
-#ifdef DEBUG_DUMP_STATS
- dump_arch_stats_fc dump; /* Affichage de statistiques */
-#endif
exit_arch_fc exit; /* Phase de relâchement */
} proc_t;
@@ -75,7 +69,6 @@ static proc_t *find_processor_by_key(const char *);
* name = désignation humaine de l'architecture. *
* instance = type GLib représentant le type à instancier. *
* init = procédure d'initialisation de mécanismes internes.*
-* dump = procédure d'affichage de statistiques. *
* exit = procédure de suppression de mécanismes internes. *
* *
* Description : Enregistre un processeur pour une architecture donnée. *
@@ -85,11 +78,8 @@ static proc_t *find_processor_by_key(const char *);
* Remarques : - *
* *
******************************************************************************/
-#ifdef DEBUG_DUMP_STATS
-bool register_processor_type(const char *key, const char *name, GType instance, init_arch_fc init, dump_arch_stats_fc dump, exit_arch_fc exit)
-#else
+
bool register_processor_type(const char *key, const char *name, GType instance, init_arch_fc init, exit_arch_fc exit)
-#endif
{
bool result; /* Bilan à retourner */
proc_t *new; /* Nouvel élément à définir */
@@ -114,9 +104,6 @@ bool register_processor_type(const char *key, const char *name, GType instance,
new->instance = instance;
new->init = init;
-#ifdef DEBUG_DUMP_STATS
- new->dump = dump;
-#endif
new->exit = exit;
}
@@ -144,23 +131,15 @@ bool load_hard_coded_processors_definitions(void)
{
bool result; /* Bilan à retourner */
- result = init_imm_operand_sharing();
- result &= init_target_operand_sharing();
- result &= init_register_operand_sharing();
+ result = true;
- result &= register_processor_type("armv7", "ARM v7", G_TYPE_ARMV7_PROCESSOR,
-#ifdef DEBUG_DUMP_STATS
- init_armv7_core, dump_armv7_share_stats, exit_armv7_core);
-#else
- init_armv7_core, exit_armv7_core);
-#endif
+ if (result)
+ result = register_processor_type("armv7", "ARM v7", G_TYPE_ARMV7_PROCESSOR,
+ init_armv7_core, exit_armv7_core);
- result &= register_processor_type("dalvik", "Dalvik Virtual Machine", G_TYPE_DALVIK_PROCESSOR,
-#ifdef DEBUG_DUMP_STATS
- init_dalvik_core, dump_dalvik_share_stats, exit_dalvik_core);
-#else
- init_dalvik_core, exit_dalvik_core);
-#endif
+ if (result)
+ result = register_processor_type("dalvik", "Dalvik Virtual Machine", G_TYPE_DALVIK_PROCESSOR,
+ init_dalvik_core, exit_dalvik_core);
//result &= register_processor_type("jvm", "Java Virtual Machine", G_TYPE_JVM_PROCESSOR);
@@ -199,10 +178,6 @@ void unload_processors_definitions(void)
_processors_definitions = NULL;
_processors_definitions_count = 0;
- exit_register_operand_sharing();
- exit_target_operand_sharing();
- exit_imm_operand_sharing();
-
G_UNLOCK(_pdef_access);
}
@@ -305,40 +280,3 @@ GArchProcessor *get_arch_processor_for_type(const char *key)
return result;
}
-
-
-/******************************************************************************
-* *
-* Paramètres : proc = processeur associé à l'architecture à traiter. *
-* *
-* Description : Imprime des statistiques quant aux partages. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-#ifdef DEBUG_DUMP_STATS
-void display_share_stats(GArchProcessor *proc)
-{
- GType type; /* Type de processeur */
- size_t i; /* Boucle de parcours */
-
- type = G_OBJECT_TYPE(proc);
-
- G_LOCK(_pdef_access);
-
- dump_imm_operand_share_stats();
- dump_target_operand_share_stats();
-
- for (i = 0; i < _processors_definitions_count; i++)
- if (_processors_definitions[i].instance == type)
- {
- _processors_definitions[i].dump();
- break;
- }
-
- G_UNLOCK(_pdef_access);
-
-}
-#endif
diff --git a/src/core/processors.h b/src/core/processors.h
index 2f12ae1..83f7466 100644
--- a/src/core/processors.h
+++ b/src/core/processors.h
@@ -36,21 +36,12 @@
/* Mise en place de mécanismes internes */
typedef bool (* init_arch_fc) (void);
-/* Affichage de statistiques */
-#ifdef DEBUG_DUMP_STATS
-typedef void (* dump_arch_stats_fc) (void);
-#endif
-
/* Suppression de mécanismes internes */
typedef void (* exit_arch_fc) (void);
/* Enregistre un processeur pour une architecture donnée. */
-#ifdef DEBUG_DUMP_STATS
-bool register_processor_type(const char *, const char *, GType, init_arch_fc, dump_arch_stats_fc, exit_arch_fc);
-#else
bool register_processor_type(const char *, const char *, GType, init_arch_fc, exit_arch_fc);
-#endif
/* Charge les définitions de processeurs "natifs". */
bool load_hard_coded_processors_definitions(void);
@@ -64,10 +55,6 @@ const char *get_arch_processor_name(const char *);
/* Fournit le processeur d'architecture correspondant à un type. */
GArchProcessor *get_arch_processor_for_type(const char *);
-/* Imprime des statistiques quant aux partages. */
-#ifdef DEBUG_DUMP_STATS
-void display_share_stats(GArchProcessor *);
-#endif
#endif /* _ANALYSIS_DB_COLLECTION_H */