summaryrefslogtreecommitdiff
path: root/src/arch/arm/v7/operands
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/arch/arm/v7/operands
parent9b018cede5af54594c0a20847239233153b04ce1 (diff)
Removed the too complex memory share system.
Diffstat (limited to 'src/arch/arm/v7/operands')
-rw-r--r--src/arch/arm/v7/operands/coproc.c142
-rw-r--r--src/arch/arm/v7/operands/coproc.h19
-rw-r--r--src/arch/arm/v7/operands/estate.c142
-rw-r--r--src/arch/arm/v7/operands/estate.h19
-rw-r--r--src/arch/arm/v7/operands/limitation.c146
-rw-r--r--src/arch/arm/v7/operands/limitation.h19
-rw-r--r--src/arch/arm/v7/operands/maccess.c188
-rw-r--r--src/arch/arm/v7/operands/maccess.h19
-rw-r--r--src/arch/arm/v7/operands/offset.c173
-rw-r--r--src/arch/arm/v7/operands/offset.h19
-rw-r--r--src/arch/arm/v7/operands/reglist.c210
-rw-r--r--src/arch/arm/v7/operands/reglist.h19
-rw-r--r--src/arch/arm/v7/operands/rotation.c169
-rw-r--r--src/arch/arm/v7/operands/rotation.h16
-rw-r--r--src/arch/arm/v7/operands/shift.c173
-rw-r--r--src/arch/arm/v7/operands/shift.h19
16 files changed, 31 insertions, 1461 deletions
diff --git a/src/arch/arm/v7/operands/coproc.c b/src/arch/arm/v7/operands/coproc.c
index ff34943..a0c0254 100644
--- a/src/arch/arm/v7/operands/coproc.c
+++ b/src/arch/arm/v7/operands/coproc.c
@@ -25,14 +25,10 @@
#include "../../../operand-int.h"
-#include "../../../sharing/manager.h"
#include "../../../../common/sort.h"
-/* --------------------- MANIPULATION D'OPERANDES INDIVIDUELLES --------------------- */
-
-
/* Définition d'un opérande représentant un co-processeur (instance) */
struct _GArmV7CoprocOperand
{
@@ -63,9 +59,6 @@ static void g_armv7_coproc_operand_dispose(GArmV7CoprocOperand *);
/* Procède à la libération totale de la mémoire. */
static void g_armv7_coproc_operand_finalize(GArmV7CoprocOperand *);
-/* Réalise une copie minimale d'un contenu partagé. */
-static void g_armv7_coproc_operand_define_template(const GArmV7CoprocOperand *, GArmV7CoprocOperand *);
-
/* Compare un opérande avec un autre. */
static int g_armv7_coproc_operand_compare(const GArmV7CoprocOperand *, const GArmV7CoprocOperand *);
@@ -74,23 +67,6 @@ static void g_armv7_coproc_operand_print(const GArmV7CoprocOperand *, GBufferLin
-/* -------------------------- PARTAGES DE CONTENUS UNIQUES -------------------------- */
-
-
-/* Gestionnaire des partages d'instances */
-static GShareManager *_armv7_coproc_operand_manager = NULL;
-
-
-/* Fournit le gestionnaire de partages attribué à un type. */
-static GShareManager *get_armv7_coproc_operand_share_manager(void);
-
-
-
-/* ---------------------------------------------------------------------------------- */
-/* MANIPULATION D'OPERANDES INDIVIDUELLES */
-/* ---------------------------------------------------------------------------------- */
-
-
/* Indique le type défini par la GLib pour un co-processeur ARM. */
G_DEFINE_TYPE(GArmV7CoprocOperand, g_armv7_coproc_operand, G_TYPE_ARCH_OPERAND);
@@ -118,12 +94,6 @@ static void g_armv7_coproc_operand_class_init(GArmV7CoprocOperandClass *klass)
object->dispose = (GObjectFinalizeFunc/* ! */)g_armv7_coproc_operand_dispose;
object->finalize = (GObjectFinalizeFunc)g_armv7_coproc_operand_finalize;
- operand->get_manager = (get_operand_manager_fc)get_armv7_coproc_operand_share_manager;
-
- operand->apply_template = (apply_operand_template_fc)NULL;
- operand->define_template = (define_operand_template_fc)g_armv7_coproc_operand_define_template;
- operand->free_template = (free_operand_template_fc)NULL;
-
operand->compare = (operand_compare_fc)g_armv7_coproc_operand_compare;
operand->print = (operand_print_fc)g_armv7_coproc_operand_print;
@@ -188,26 +158,6 @@ static void g_armv7_coproc_operand_finalize(GArmV7CoprocOperand *operand)
/******************************************************************************
* *
-* Paramètres : operand = objet partagé à consulter. *
-* template = informations à retrouver intégralement. *
-* *
-* Description : Réalise une copie minimale d'un contenu partagé. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_armv7_coproc_operand_define_template(const GArmV7CoprocOperand *operand, GArmV7CoprocOperand *template)
-{
- template->index = operand->index;
-
-}
-
-
-/******************************************************************************
-* *
* Paramètres : a = premier opérande à consulter. *
* b = second opérande à consulter. *
* *
@@ -270,12 +220,11 @@ static void g_armv7_coproc_operand_print(const GArmV7CoprocOperand *operand, GBu
GArchOperand *g_armv7_coproc_operand_new(uint8_t raw)
{
- GSharedInstance *result; /* Structure à retourner */
- GArmV7CoprocOperand template; /* Transport d'informations */
+ GArmV7CoprocOperand *result; /* Structure à retourner */
- template.index = raw;
+ result = g_object_new(G_TYPE_ARMV7_COPROC_OPERAND, NULL);
- result = g_share_manager_build(_armv7_coproc_operand_manager, (GSharedInstance *)&template);
+ result->index = raw;
return G_ARCH_OPERAND(result);
@@ -299,88 +248,3 @@ uint8_t g_armv7_coproc_operand_get_index(const GArmV7CoprocOperand *operand)
return operand->index;
}
-
-
-
-/* ---------------------------------------------------------------------------------- */
-/* PARTAGES DE CONTENUS UNIQUES */
-/* ---------------------------------------------------------------------------------- */
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Fournit le gestionnaire de partages attribué à un type. *
-* *
-* Retour : Gestionnaire de partages en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GShareManager *get_armv7_coproc_operand_share_manager(void)
-{
- return _armv7_coproc_operand_manager;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Met en place les mécanismes de partage des co-processeurs. *
-* *
-* Retour : Bilan de l'opération. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool init_armv7_coproc_operand_sharing(void)
-{
- _armv7_coproc_operand_manager = g_share_manager_new(G_TYPE_ARMV7_COPROC_OPERAND);
-
- return true;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Imprime des statistiques quant aux partages dans l'archi. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-#ifdef DEBUG_DUMP_STATS
-void dump_armv7_coproc_operand_share_stats(void)
-{
- g_share_manager_dump_stats(_armv7_coproc_operand_manager);
-
-}
-#endif
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Supprime les mécanismes de partage des co-processeurs. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void exit_armv7_coproc_operand_sharing(void)
-{
- g_object_unref(G_OBJECT(_armv7_coproc_operand_manager));
-
-}
diff --git a/src/arch/arm/v7/operands/coproc.h b/src/arch/arm/v7/operands/coproc.h
index 241db19..07224d3 100644
--- a/src/arch/arm/v7/operands/coproc.h
+++ b/src/arch/arm/v7/operands/coproc.h
@@ -32,9 +32,6 @@
-/* --------------------- MANIPULATION D'OPERANDES INDIVIDUELLES --------------------- */
-
-
#define G_TYPE_ARMV7_COPROC_OPERAND g_armv7_coproc_operand_get_type()
#define G_ARMV7_COPROC_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_armv7_coproc_operand_get_type(), GArmV7CoprocOperand))
#define G_IS_ARMV7_COPROC_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_armv7_coproc_operand_get_type()))
@@ -61,20 +58,4 @@ uint8_t g_armv7_coproc_operand_get_index(const GArmV7CoprocOperand *);
-/* -------------------------- PARTAGES DE CONTENUS UNIQUES -------------------------- */
-
-
-/* Met en place les mécanismes de partage des co-processeurs. */
-bool init_armv7_coproc_operand_sharing(void);
-
-/* Imprime des statistiques quant aux partages dans l'archi. */
-#ifdef DEBUG_DUMP_STATS
-void dump_armv7_coproc_operand_share_stats(void);
-#endif
-
-/* Supprime les mécanismes de partage des co-processeurs. */
-void exit_armv7_coproc_operand_sharing(void);
-
-
-
#endif /* _ARCH_ARM_V7_OPERANDS_COPROC_H */
diff --git a/src/arch/arm/v7/operands/estate.c b/src/arch/arm/v7/operands/estate.c
index 25c60ab..0756110 100644
--- a/src/arch/arm/v7/operands/estate.c
+++ b/src/arch/arm/v7/operands/estate.c
@@ -25,14 +25,10 @@
#include "../../../operand-int.h"
-#include "../../../sharing/manager.h"
#include "../../../../common/sort.h"
-/* --------------------- MANIPULATION D'OPERANDES INDIVIDUELLES --------------------- */
-
-
/* Définition d'un opérande affichant le choix d'un boutisme (instance) */
struct _GArmV7EndianOperand
{
@@ -63,9 +59,6 @@ static void g_armv7_endian_operand_dispose(GArmV7EndianOperand *);
/* Procède à la libération totale de la mémoire. */
static void g_armv7_endian_operand_finalize(GArmV7EndianOperand *);
-/* Réalise une copie minimale d'un contenu partagé. */
-static void g_armv7_endian_operand_define_template(const GArmV7EndianOperand *, GArmV7EndianOperand *);
-
/* Compare un opérande avec un autre. */
static int g_armv7_endian_operand_compare(const GArmV7EndianOperand *, const GArmV7EndianOperand *);
@@ -74,23 +67,6 @@ static void g_armv7_endian_operand_print(const GArmV7EndianOperand *, GBufferLin
-/* -------------------------- PARTAGES DE CONTENUS UNIQUES -------------------------- */
-
-
-/* Gestionnaire des partages d'instances */
-static GShareManager *_armv7_endian_operand_manager = NULL;
-
-
-/* Fournit le gestionnaire de partages attribué à un type. */
-static GShareManager *get_armv7_endian_operand_share_manager(void);
-
-
-
-/* ---------------------------------------------------------------------------------- */
-/* MANIPULATION D'OPERANDES INDIVIDUELLES */
-/* ---------------------------------------------------------------------------------- */
-
-
/* Indique le type défini par la GLib pour une endian de domaine et d'accès. */
G_DEFINE_TYPE(GArmV7EndianOperand, g_armv7_endian_operand, G_TYPE_ARCH_OPERAND);
@@ -118,12 +94,6 @@ static void g_armv7_endian_operand_class_init(GArmV7EndianOperandClass *klass)
object->dispose = (GObjectFinalizeFunc/* ! */)g_armv7_endian_operand_dispose;
object->finalize = (GObjectFinalizeFunc)g_armv7_endian_operand_finalize;
- operand->get_manager = (get_operand_manager_fc)get_armv7_endian_operand_share_manager;
-
- operand->apply_template = (apply_operand_template_fc)NULL;
- operand->define_template = (define_operand_template_fc)g_armv7_endian_operand_define_template;
- operand->free_template = (free_operand_template_fc)NULL;
-
operand->compare = (operand_compare_fc)g_armv7_endian_operand_compare;
operand->print = (operand_print_fc)g_armv7_endian_operand_print;
@@ -188,26 +158,6 @@ static void g_armv7_endian_operand_finalize(GArmV7EndianOperand *operand)
/******************************************************************************
* *
-* Paramètres : operand = objet partagé à consulter. *
-* template = informations à retrouver intégralement. *
-* *
-* Description : Réalise une copie minimale d'un contenu partagé. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_armv7_endian_operand_define_template(const GArmV7EndianOperand *operand, GArmV7EndianOperand *template)
-{
- template->big = operand->big;
-
-}
-
-
-/******************************************************************************
-* *
* Paramètres : a = premier opérande à consulter. *
* b = second opérande à consulter. *
* *
@@ -268,12 +218,11 @@ static void g_armv7_endian_operand_print(const GArmV7EndianOperand *operand, GBu
GArchOperand *g_armv7_endian_operand_new(bool big)
{
- GSharedInstance *result; /* Structure à retourner */
- GArmV7EndianOperand template; /* Transport d'informations */
+ GArmV7EndianOperand *result; /* Structure à retourner */
- template.big = big;
+ result = g_object_new(G_TYPE_ARMV7_ENDIAN_OPERAND, NULL);
- result = g_share_manager_build(_armv7_endian_operand_manager, (GSharedInstance *)&template);
+ result->big = big;
return G_ARCH_OPERAND(result);
@@ -297,88 +246,3 @@ bool g_armv7_endian_operand_is_big_endian(const GArmV7EndianOperand *operand)
return operand->big;
}
-
-
-
-/* ---------------------------------------------------------------------------------- */
-/* PARTAGES DE CONTENUS UNIQUES */
-/* ---------------------------------------------------------------------------------- */
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Fournit le gestionnaire de partages attribué à un type. *
-* *
-* Retour : Gestionnaire de partages en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GShareManager *get_armv7_endian_operand_share_manager(void)
-{
- return _armv7_endian_operand_manager;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Met en place les mécanismes de partage des états de boutisme.*
-* *
-* Retour : Bilan de l'opération. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool init_armv7_endian_operand_sharing(void)
-{
- _armv7_endian_operand_manager = g_share_manager_new(G_TYPE_ARMV7_ENDIAN_OPERAND);
-
- return true;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Imprime des statistiques quant aux partages dans l'archi. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-#ifdef DEBUG_DUMP_STATS
-void dump_armv7_endian_operand_share_stats(void)
-{
- g_share_manager_dump_stats(_armv7_endian_operand_manager);
-
-}
-#endif
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Supprime les mécanismes de partage des états de boutisme. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void exit_armv7_endian_operand_sharing(void)
-{
- g_object_unref(G_OBJECT(_armv7_endian_operand_manager));
-
-}
diff --git a/src/arch/arm/v7/operands/estate.h b/src/arch/arm/v7/operands/estate.h
index 506bcb4..a1726cf 100644
--- a/src/arch/arm/v7/operands/estate.h
+++ b/src/arch/arm/v7/operands/estate.h
@@ -32,9 +32,6 @@
-/* --------------------- MANIPULATION D'OPERANDES INDIVIDUELLES --------------------- */
-
-
#define G_TYPE_ARMV7_ENDIAN_OPERAND g_armv7_endian_operand_get_type()
#define G_ARMV7_ENDIAN_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_armv7_endian_operand_get_type(), GArmV7EndianOperand))
#define G_IS_ARMV7_ENDIAN_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_armv7_endian_operand_get_type()))
@@ -61,20 +58,4 @@ bool g_armv7_endian_operand_is_big_endian(const GArmV7EndianOperand *);
-/* -------------------------- PARTAGES DE CONTENUS UNIQUES -------------------------- */
-
-
-/* Met en place les mécanismes de partage des états de boutisme. */
-bool init_armv7_endian_operand_sharing(void);
-
-/* Imprime des statistiques quant aux partages dans l'archi. */
-#ifdef DEBUG_DUMP_STATS
-void dump_armv7_endian_operand_share_stats(void);
-#endif
-
-/* Supprime les mécanismes de partage des états de boutisme. */
-void exit_armv7_endian_operand_sharing(void);
-
-
-
#endif /* _ARCH_ARM_V7_OPERANDS_ESTATE_H */
diff --git a/src/arch/arm/v7/operands/limitation.c b/src/arch/arm/v7/operands/limitation.c
index a86502c..75e958f 100644
--- a/src/arch/arm/v7/operands/limitation.c
+++ b/src/arch/arm/v7/operands/limitation.c
@@ -25,14 +25,10 @@
#include "../../../operand-int.h"
-#include "../../../sharing/manager.h"
#include "../../../../common/sort.h"
-/* --------------------- MANIPULATION D'OPERANDES INDIVIDUELLES --------------------- */
-
-
/* Définition d'un opérande déterminant une limitation de domaine et d'accès (instance) */
struct _GArmV7LimitationOperand
{
@@ -63,9 +59,6 @@ static void g_armv7_limitation_operand_dispose(GArmV7LimitationOperand *);
/* Procède à la libération totale de la mémoire. */
static void g_armv7_limitation_operand_finalize(GArmV7LimitationOperand *);
-/* Réalise une copie minimale d'un contenu partagé. */
-static void g_armv7_limitation_operand_define_template(const GArmV7LimitationOperand *, GArmV7LimitationOperand *);
-
/* Compare un opérande avec un autre. */
static int g_armv7_limitation_operand_compare(const GArmV7LimitationOperand *, const GArmV7LimitationOperand *);
@@ -74,23 +67,6 @@ static void g_armv7_limitation_operand_print(const GArmV7LimitationOperand *, GB
-/* -------------------------- PARTAGES DE CONTENUS UNIQUES -------------------------- */
-
-
-/* Gestionnaire des partages d'instances */
-static GShareManager *_armv7_limitation_operand_manager = NULL;
-
-
-/* Fournit le gestionnaire de partages attribué à un type. */
-static GShareManager *get_armv7_limitation_operand_share_manager(void);
-
-
-
-/* ---------------------------------------------------------------------------------- */
-/* MANIPULATION D'OPERANDES INDIVIDUELLES */
-/* ---------------------------------------------------------------------------------- */
-
-
/* Indique le type défini par la GLib pour une limitation de domaine et d'accès. */
G_DEFINE_TYPE(GArmV7LimitationOperand, g_armv7_limitation_operand, G_TYPE_ARCH_OPERAND);
@@ -118,12 +94,6 @@ static void g_armv7_limitation_operand_class_init(GArmV7LimitationOperandClass *
object->dispose = (GObjectFinalizeFunc/* ! */)g_armv7_limitation_operand_dispose;
object->finalize = (GObjectFinalizeFunc)g_armv7_limitation_operand_finalize;
- operand->get_manager = (get_operand_manager_fc)get_armv7_limitation_operand_share_manager;
-
- operand->apply_template = (apply_operand_template_fc)NULL;
- operand->define_template = (define_operand_template_fc)g_armv7_limitation_operand_define_template;
- operand->free_template = (free_operand_template_fc)NULL;
-
operand->compare = (operand_compare_fc)g_armv7_limitation_operand_compare;
operand->print = (operand_print_fc)g_armv7_limitation_operand_print;
@@ -188,26 +158,6 @@ static void g_armv7_limitation_operand_finalize(GArmV7LimitationOperand *operand
/******************************************************************************
* *
-* Paramètres : operand = objet partagé à consulter. *
-* template = informations à retrouver intégralement. *
-* *
-* Description : Réalise une copie minimale d'un contenu partagé. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_armv7_limitation_operand_define_template(const GArmV7LimitationOperand *operand, GArmV7LimitationOperand *template)
-{
- template->type = operand->type;
-
-}
-
-
-/******************************************************************************
-* *
* Paramètres : a = premier opérande à consulter. *
* b = second opérande à consulter. *
* *
@@ -303,16 +253,15 @@ static void g_armv7_limitation_operand_print(const GArmV7LimitationOperand *oper
GArchOperand *g_armv7_limitation_operand_new(uint8_t raw)
{
- GSharedInstance *result; /* Structure à retourner */
- GArmV7LimitationOperand template; /* Transport d'informations */
+ GArmV7LimitationOperand *result; /* Structure à retourner */
+
+ result = g_object_new(G_TYPE_ARMV7_LIMITATION_OPERAND, NULL);
if (raw < 0b0010 || raw > 0b1111)
- template.type = BLT_RESERVED;
+ result->type = BLT_RESERVED;
else
- template.type = raw;
-
- result = g_share_manager_build(_armv7_limitation_operand_manager, (GSharedInstance *)&template);
+ result->type = raw;
return G_ARCH_OPERAND(result);
@@ -336,88 +285,3 @@ BarrierLimitationType g_armv7_limitation_operand_get_value(const GArmV7Limitatio
return operand->type;
}
-
-
-
-/* ---------------------------------------------------------------------------------- */
-/* PARTAGES DE CONTENUS UNIQUES */
-/* ---------------------------------------------------------------------------------- */
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Fournit le gestionnaire de partages attribué à un type. *
-* *
-* Retour : Gestionnaire de partages en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GShareManager *get_armv7_limitation_operand_share_manager(void)
-{
- return _armv7_limitation_operand_manager;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Met en place les mécanismes de partage de limites de domaine.*
-* *
-* Retour : Bilan de l'opération. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool init_armv7_limitation_operand_sharing(void)
-{
- _armv7_limitation_operand_manager = g_share_manager_new(G_TYPE_ARMV7_LIMITATION_OPERAND);
-
- return true;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Imprime des statistiques quant aux partages dans l'archi. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-#ifdef DEBUG_DUMP_STATS
-void dump_armv7_limitation_operand_share_stats(void)
-{
- g_share_manager_dump_stats(_armv7_limitation_operand_manager);
-
-}
-#endif
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Supprime les mécanismes de partage des limites de domaine. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void exit_armv7_limitation_operand_sharing(void)
-{
- g_object_unref(G_OBJECT(_armv7_limitation_operand_manager));
-
-}
diff --git a/src/arch/arm/v7/operands/limitation.h b/src/arch/arm/v7/operands/limitation.h
index 6fc61d2..4f7db88 100644
--- a/src/arch/arm/v7/operands/limitation.h
+++ b/src/arch/arm/v7/operands/limitation.h
@@ -32,9 +32,6 @@
-/* --------------------- MANIPULATION D'OPERANDES INDIVIDUELLES --------------------- */
-
-
#define G_TYPE_ARMV7_LIMITATION_OPERAND g_armv7_limitation_operand_get_type()
#define G_ARMV7_LIMITATION_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_armv7_limitation_operand_get_type(), GArmV7LimitationOperand))
#define G_IS_ARMV7_LIMITATION_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_armv7_limitation_operand_get_type()))
@@ -77,20 +74,4 @@ BarrierLimitationType g_armv7_limitation_operand_get_value(const GArmV7Limitatio
-/* -------------------------- PARTAGES DE CONTENUS UNIQUES -------------------------- */
-
-
-/* Met en place les mécanismes de partage de limites de domaine. */
-bool init_armv7_limitation_operand_sharing(void);
-
-/* Imprime des statistiques quant aux partages dans l'archi. */
-#ifdef DEBUG_DUMP_STATS
-void dump_armv7_limitation_operand_share_stats(void);
-#endif
-
-/* Supprime les mécanismes de partage des limites de domaine. */
-void exit_armv7_limitation_operand_sharing(void);
-
-
-
#endif /* _ARCH_ARM_V7_OPERANDS_LIMITATION_H */
diff --git a/src/arch/arm/v7/operands/maccess.c b/src/arch/arm/v7/operands/maccess.c
index 71d55e0..6daf821 100644
--- a/src/arch/arm/v7/operands/maccess.c
+++ b/src/arch/arm/v7/operands/maccess.c
@@ -25,14 +25,10 @@
#include "../../../operand-int.h"
-#include "../../../sharing/manager.h"
#include "../../../../common/sort.h"
-/* --------------------- MANIPULATION D'OPERANDES INDIVIDUELLES --------------------- */
-
-
/* Définition d'un opérande offrant un accès à la mémoire depuis une base (instance) */
struct _GArmV7MAccessOperand
{
@@ -67,12 +63,6 @@ static void g_armv7_maccess_operand_dispose(GArmV7MAccessOperand *);
/* Procède à la libération totale de la mémoire. */
static void g_armv7_maccess_operand_finalize(GArmV7MAccessOperand *);
-/* Initialise un nouvel objet partagé avec des informations. */
-static bool g_armv7_maccess_operand_apply_template(GArmV7MAccessOperand *, const GArmV7MAccessOperand *);
-
-/* Réalise une copie minimale d'un contenu partagé. */
-static void g_armv7_maccess_operand_define_template(const GArmV7MAccessOperand *, GArmV7MAccessOperand *);
-
/* Compare un opérande avec un autre. */
static int g_armv7_maccess_operand_compare(const GArmV7MAccessOperand *, const GArmV7MAccessOperand *);
@@ -81,23 +71,6 @@ static void g_armv7_maccess_operand_print(const GArmV7MAccessOperand *, GBufferL
-/* -------------------------- PARTAGES DE CONTENUS UNIQUES -------------------------- */
-
-
-/* Gestionnaire des partages d'instances */
-static GShareManager *_armv7_maccess_operand_manager = NULL;
-
-
-/* Fournit le gestionnaire de partages attribué à un type. */
-static GShareManager *get_armv7_maccess_operand_share_manager(void);
-
-
-
-/* ---------------------------------------------------------------------------------- */
-/* MANIPULATION D'OPERANDES INDIVIDUELLES */
-/* ---------------------------------------------------------------------------------- */
-
-
/* Indique le type défini par la GLib pour un accès à la mémoire depuis une base. */
G_DEFINE_TYPE(GArmV7MAccessOperand, g_armv7_maccess_operand, G_TYPE_ARCH_OPERAND);
@@ -125,12 +98,6 @@ static void g_armv7_maccess_operand_class_init(GArmV7MAccessOperandClass *klass)
object->dispose = (GObjectFinalizeFunc/* ! */)g_armv7_maccess_operand_dispose;
object->finalize = (GObjectFinalizeFunc)g_armv7_maccess_operand_finalize;
- operand->get_manager = (get_operand_manager_fc)get_armv7_maccess_operand_share_manager;
-
- operand->apply_template = (apply_operand_template_fc)g_armv7_maccess_operand_apply_template;
- operand->define_template = (define_operand_template_fc)g_armv7_maccess_operand_define_template;
- operand->free_template = (free_operand_template_fc)NULL;
-
operand->compare = (operand_compare_fc)g_armv7_maccess_operand_compare;
operand->print = (operand_print_fc)g_armv7_maccess_operand_print;
@@ -203,61 +170,6 @@ static void g_armv7_maccess_operand_finalize(GArmV7MAccessOperand *operand)
/******************************************************************************
* *
-* Paramètres : operand = objet partagé à initialiser. *
-* template = information à utiliser pour la mise en place. *
-* *
-* Description : Initialise un nouvel objet partagé avec des informations. *
-* *
-* Retour : Bilan de l'opération. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_armv7_maccess_operand_apply_template(GArmV7MAccessOperand *operand, const GArmV7MAccessOperand *template)
-{
- g_armv7_maccess_operand_define_template(template, operand);
-
- g_object_ref(G_OBJECT(operand->base));
-
- if (operand->offset != NULL)
- g_object_ref(G_OBJECT(operand->offset));
-
- if (operand->shift != NULL)
- g_object_ref(G_OBJECT(operand->shift));
-
- return true;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = objet partagé à consulter. *
-* template = informations à retrouver intégralement. *
-* *
-* Description : Réalise une copie minimale d'un contenu partagé. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_armv7_maccess_operand_define_template(const GArmV7MAccessOperand *operand, GArmV7MAccessOperand *template)
-{
- template->base = operand->base;
- template->offset = operand->offset;
- template->shift = operand->shift;
-
- template->not_post_indexed = operand->not_post_indexed;
- template->write_back = operand->write_back;
-
-}
-
-
-/******************************************************************************
-* *
* Paramètres : a = premier opérande à consulter. *
* b = second opérande à consulter. *
* *
@@ -362,17 +274,16 @@ static void g_armv7_maccess_operand_print(const GArmV7MAccessOperand *operand, G
GArchOperand *g_armv7_maccess_operand_new(GArchOperand *base, GArchOperand *offset, GArchOperand *shift, bool indexed, bool wback)
{
- GSharedInstance *result; /* Structure à retourner */
- GArmV7MAccessOperand template; /* Transport d'informations */
+ GArmV7MAccessOperand *result; /* Structure à retourner */
- template.base = base;
- template.offset = offset;
- template.shift = shift;
+ result = g_object_new(G_TYPE_ARMV7_MACCESS_OPERAND, NULL);
- template.not_post_indexed = indexed;
- template.write_back = wback;
+ result->base = base;
+ result->offset = offset;
+ result->shift = shift;
- result = g_share_manager_build(_armv7_maccess_operand_manager, (GSharedInstance *)&template);
+ result->not_post_indexed = indexed;
+ result->write_back = wback;
return G_ARCH_OPERAND(result);
@@ -472,88 +383,3 @@ bool g_armv7_maccess_operand_has_to_write_back(const GArmV7MAccessOperand *opera
return operand->write_back;
}
-
-
-
-/* ---------------------------------------------------------------------------------- */
-/* PARTAGES DE CONTENUS UNIQUES */
-/* ---------------------------------------------------------------------------------- */
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Fournit le gestionnaire de partages attribué à un type. *
-* *
-* Retour : Gestionnaire de partages en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GShareManager *get_armv7_maccess_operand_share_manager(void)
-{
- return _armv7_maccess_operand_manager;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Met en place les mécanismes de partage des accès mémmoire. *
-* *
-* Retour : Bilan de l'opération. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool init_armv7_maccess_operand_sharing(void)
-{
- _armv7_maccess_operand_manager = g_share_manager_new(G_TYPE_ARMV7_MACCESS_OPERAND);
-
- return true;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Imprime des statistiques quant aux partages dans l'archi. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-#ifdef DEBUG_DUMP_STATS
-void dump_armv7_maccess_operand_share_stats(void)
-{
- g_share_manager_dump_stats(_armv7_maccess_operand_manager);
-
-}
-#endif
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Supprime les mécanismes de partage des accès mémoire. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void exit_armv7_maccess_operand_sharing(void)
-{
- g_object_unref(G_OBJECT(_armv7_maccess_operand_manager));
-
-}
diff --git a/src/arch/arm/v7/operands/maccess.h b/src/arch/arm/v7/operands/maccess.h
index 52f297d..6e99e0b 100644
--- a/src/arch/arm/v7/operands/maccess.h
+++ b/src/arch/arm/v7/operands/maccess.h
@@ -34,9 +34,6 @@
-/* --------------------- MANIPULATION D'OPERANDES INDIVIDUELLES --------------------- */
-
-
#define G_TYPE_ARMV7_MACCESS_OPERAND g_armv7_maccess_operand_get_type()
#define G_ARMV7_MACCESS_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_armv7_maccess_operand_get_type(), GArmV7MAccessOperand))
#define G_IS_ARMV7_MACCESS_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_armv7_maccess_operand_get_type()))
@@ -75,20 +72,4 @@ bool g_armv7_maccess_operand_has_to_write_back(const GArmV7MAccessOperand *);
-/* -------------------------- PARTAGES DE CONTENUS UNIQUES -------------------------- */
-
-
-/* Met en place les mécanismes de partage des accès mémmoire. */
-bool init_armv7_maccess_operand_sharing(void);
-
-/* Imprime des statistiques quant aux partages dans l'archi. */
-#ifdef DEBUG_DUMP_STATS
-void dump_armv7_maccess_operand_share_stats(void);
-#endif
-
-/* Supprime les mécanismes de partage des accès mémoire. */
-void exit_armv7_maccess_operand_sharing(void);
-
-
-
#endif /* _ARCH_ARM_V7_OPERANDS_MACCESS_H */
diff --git a/src/arch/arm/v7/operands/offset.c b/src/arch/arm/v7/operands/offset.c
index ebd73c8..b8df640 100644
--- a/src/arch/arm/v7/operands/offset.c
+++ b/src/arch/arm/v7/operands/offset.c
@@ -25,14 +25,10 @@
#include "../../../operand-int.h"
-#include "../../../sharing/manager.h"
#include "../../../../common/sort.h"
-/* --------------------- MANIPULATION D'OPERANDES INDIVIDUELLES --------------------- */
-
-
/* Définition d'un opérande visant à constituer un décallage relatif ARMv7 (instance) */
struct _GArmV7OffsetOperand
{
@@ -64,12 +60,6 @@ static void g_armv7_offset_operand_dispose(GArmV7OffsetOperand *);
/* Procède à la libération totale de la mémoire. */
static void g_armv7_offset_operand_finalize(GArmV7OffsetOperand *);
-/* Initialise un nouvel objet partagé avec des informations. */
-static bool g_armv7_offset_operand_apply_template(GArmV7OffsetOperand *, const GArmV7OffsetOperand *);
-
-/* Réalise une copie minimale d'un contenu partagé. */
-static void g_armv7_offset_operand_define_template(const GArmV7OffsetOperand *, GArmV7OffsetOperand *);
-
/* Compare un opérande avec un autre. */
static int g_armv7_offset_operand_compare(const GArmV7OffsetOperand *, const GArmV7OffsetOperand *);
@@ -78,23 +68,6 @@ static void g_armv7_offset_operand_print(const GArmV7OffsetOperand *, GBufferLin
-/* -------------------------- PARTAGES DE CONTENUS UNIQUES -------------------------- */
-
-
-/* Gestionnaire des partages d'instances */
-static GShareManager *_armv7_offset_operand_manager = NULL;
-
-
-/* Fournit le gestionnaire de partages attribué à un type. */
-static GShareManager *get_armv7_offset_operand_share_manager(void);
-
-
-
-/* ---------------------------------------------------------------------------------- */
-/* MANIPULATION D'OPERANDES INDIVIDUELLES */
-/* ---------------------------------------------------------------------------------- */
-
-
/* Indique le type défini par la GLib pour un décallage relatif ARMv7. */
G_DEFINE_TYPE(GArmV7OffsetOperand, g_armv7_offset_operand, G_TYPE_ARCH_OPERAND);
@@ -122,12 +95,6 @@ static void g_armv7_offset_operand_class_init(GArmV7OffsetOperandClass *klass)
object->dispose = (GObjectFinalizeFunc/* ! */)g_armv7_offset_operand_dispose;
object->finalize = (GObjectFinalizeFunc)g_armv7_offset_operand_finalize;
- operand->get_manager = (get_operand_manager_fc)get_armv7_offset_operand_share_manager;
-
- operand->apply_template = (apply_operand_template_fc)g_armv7_offset_operand_apply_template;
- operand->define_template = (define_operand_template_fc)g_armv7_offset_operand_define_template;
- operand->free_template = (free_operand_template_fc)NULL;
-
operand->compare = (operand_compare_fc)g_armv7_offset_operand_compare;
operand->print = (operand_print_fc)g_armv7_offset_operand_print;
@@ -194,52 +161,6 @@ static void g_armv7_offset_operand_finalize(GArmV7OffsetOperand *operand)
/******************************************************************************
* *
-* Paramètres : operand = objet partagé à initialiser. *
-* template = information à utiliser pour la mise en place. *
-* *
-* Description : Initialise un nouvel objet partagé avec des informations. *
-* *
-* Retour : Bilan de l'opération. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_armv7_offset_operand_apply_template(GArmV7OffsetOperand *operand, const GArmV7OffsetOperand *template)
-{
- g_armv7_offset_operand_define_template(template, operand);
-
- g_object_ref(G_OBJECT(operand->value));
-
- return true;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = objet partagé à consulter. *
-* template = informations à retrouver intégralement. *
-* *
-* Description : Réalise une copie minimale d'un contenu partagé. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_armv7_offset_operand_define_template(const GArmV7OffsetOperand *operand, GArmV7OffsetOperand *template)
-{
- template->positive = operand->positive;
-
- template->value = operand->value;
-
-}
-
-
-/******************************************************************************
-* *
* Paramètres : a = premier opérande à consulter. *
* b = second opérande à consulter. *
* *
@@ -306,13 +227,12 @@ static void g_armv7_offset_operand_print(const GArmV7OffsetOperand *operand, GBu
GArchOperand *g_armv7_offset_operand_new(bool positive, GArchOperand *value)
{
- GSharedInstance *result; /* Structure à retourner */
- GArmV7OffsetOperand template; /* Transport d'informations */
+ GArmV7OffsetOperand *result; /* Structure à retourner */
- template.positive = positive;
- template.value = value;
+ result = g_object_new(G_TYPE_ARMV7_OFFSET_OPERAND, NULL);
- result = g_share_manager_build(_armv7_offset_operand_manager, (GSharedInstance *)&template);
+ result->positive = positive;
+ result->value = value;
return G_ARCH_OPERAND(result);
@@ -361,88 +281,3 @@ GArchOperand *g_armv7_offset_operand_get_value(const GArmV7OffsetOperand *operan
return result;
}
-
-
-
-/* ---------------------------------------------------------------------------------- */
-/* PARTAGES DE CONTENUS UNIQUES */
-/* ---------------------------------------------------------------------------------- */
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Fournit le gestionnaire de partages attribué à un type. *
-* *
-* Retour : Gestionnaire de partages en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GShareManager *get_armv7_offset_operand_share_manager(void)
-{
- return _armv7_offset_operand_manager;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Met en place les mécanismes de partage des décallages ARMv7. *
-* *
-* Retour : Bilan de l'opération. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool init_armv7_offset_operand_sharing(void)
-{
- _armv7_offset_operand_manager = g_share_manager_new(G_TYPE_ARMV7_OFFSET_OPERAND);
-
- return true;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Imprime des statistiques quant aux partages dans l'archi. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-#ifdef DEBUG_DUMP_STATS
-void dump_armv7_offset_operand_share_stats(void)
-{
- g_share_manager_dump_stats(_armv7_offset_operand_manager);
-
-}
-#endif
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Supprime les mécanismes de partage des décallages ARMv7. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void exit_armv7_offset_operand_sharing(void)
-{
- g_object_unref(G_OBJECT(_armv7_offset_operand_manager));
-
-}
diff --git a/src/arch/arm/v7/operands/offset.h b/src/arch/arm/v7/operands/offset.h
index b1e1ddc..64744df 100644
--- a/src/arch/arm/v7/operands/offset.h
+++ b/src/arch/arm/v7/operands/offset.h
@@ -34,9 +34,6 @@
-/* --------------------- MANIPULATION D'OPERANDES INDIVIDUELLES --------------------- */
-
-
#define G_TYPE_ARMV7_OFFSET_OPERAND g_armv7_offset_operand_get_type()
#define G_ARMV7_OFFSET_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_armv7_offset_operand_get_type(), GArmV7OffsetOperand))
#define G_IS_ARMV7_OFFSET_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_armv7_offset_operand_get_type()))
@@ -66,20 +63,4 @@ GArchOperand *g_armv7_offset_operand_get_value(const GArmV7OffsetOperand *);
-/* -------------------------- PARTAGES DE CONTENUS UNIQUES -------------------------- */
-
-
-/* Met en place les mécanismes de partage des décallages ARMv7. */
-bool init_armv7_offset_operand_sharing(void);
-
-/* Imprime des statistiques quant aux partages dans l'archi. */
-#ifdef DEBUG_DUMP_STATS
-void dump_armv7_offset_operand_share_stats(void);
-#endif
-
-/* Supprime les mécanismes de partage des décallages ARMv7. */
-void exit_armv7_offset_operand_sharing(void);
-
-
-
#endif /* _ARCH_ARM_V7_OPERANDS_OFFSET_H */
diff --git a/src/arch/arm/v7/operands/reglist.c b/src/arch/arm/v7/operands/reglist.c
index 968a423..9f641b8 100644
--- a/src/arch/arm/v7/operands/reglist.c
+++ b/src/arch/arm/v7/operands/reglist.c
@@ -30,14 +30,10 @@
#include "../../../operand-int.h"
#include "../../../register.h"
-#include "../../../sharing/manager.h"
#include "../../../../common/sort.h"
-/* --------------------- MANIPULATION D'OPERANDES INDIVIDUELLES --------------------- */
-
-
/* Définition d'un opérande listant une série de registres ARM (instance) */
struct _GArmV7RegListOperand
{
@@ -69,15 +65,6 @@ static void g_armv7_reglist_operand_dispose(GArmV7RegListOperand *);
/* Procède à la libération totale de la mémoire. */
static void g_armv7_reglist_operand_finalize(GArmV7RegListOperand *);
-/* Initialise un nouvel objet partagé avec des informations. */
-static bool g_armv7_reglist_operand_apply_template(GArmV7RegListOperand *, const GArmV7RegListOperand *);
-
-/* Réalise une copie minimale d'un contenu partagé. */
-static void g_armv7_reglist_operand_define_template(const GArmV7RegListOperand *, GArmV7RegListOperand *);
-
-/* Libère la mémoire utilisée par un patron d'instance. */
-static void g_armv7_reglist_operand_free_template(const GArmV7RegListOperand *, GArmV7RegListOperand *);
-
/* Compare un opérande avec un autre. */
static int g_armv7_reglist_operand_compare(const GArmV7RegListOperand *, const GArmV7RegListOperand *);
@@ -86,23 +73,6 @@ static void g_armv7_reglist_operand_print(const GArmV7RegListOperand *, GBufferL
-/* -------------------------- PARTAGES DE CONTENUS UNIQUES -------------------------- */
-
-
-/* Gestionnaire des partages d'instances */
-static GShareManager *_armv7_reglist_operand_manager = NULL;
-
-
-/* Fournit le gestionnaire de partages attribué à un type. */
-static GShareManager *get_armv7_reglist_operand_share_manager(void);
-
-
-
-/* ---------------------------------------------------------------------------------- */
-/* MANIPULATION D'OPERANDES INDIVIDUELLES */
-/* ---------------------------------------------------------------------------------- */
-
-
/* Indique le type défini par la GLib pour une liste de registres ARM. */
G_DEFINE_TYPE(GArmV7RegListOperand, g_armv7_reglist_operand, G_TYPE_ARCH_OPERAND);
@@ -130,12 +100,6 @@ static void g_armv7_reglist_operand_class_init(GArmV7RegListOperandClass *klass)
object->dispose = (GObjectFinalizeFunc/* ! */)g_armv7_reglist_operand_dispose;
object->finalize = (GObjectFinalizeFunc)g_armv7_reglist_operand_finalize;
- operand->get_manager = (get_operand_manager_fc)get_armv7_reglist_operand_share_manager;
-
- operand->apply_template = (apply_operand_template_fc)g_armv7_reglist_operand_apply_template;
- operand->define_template = (define_operand_template_fc)g_armv7_reglist_operand_define_template;
- operand->free_template = (free_operand_template_fc)g_armv7_reglist_operand_free_template;;
-
operand->compare = (operand_compare_fc)g_armv7_reglist_operand_compare;
operand->print = (operand_print_fc)g_armv7_reglist_operand_print;
@@ -208,91 +172,6 @@ static void g_armv7_reglist_operand_finalize(GArmV7RegListOperand *operand)
/******************************************************************************
* *
-* Paramètres : operand = objet partagé à initialiser. *
-* template = information à utiliser pour la mise en place. *
-* *
-* Description : Initialise un nouvel objet partagé avec des informations. *
-* *
-* Retour : Bilan de l'opération. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_armv7_reglist_operand_apply_template(GArmV7RegListOperand *operand, const GArmV7RegListOperand *template)
-{
- size_t i; /* Boucle de parcours */
-
- g_armv7_reglist_operand_define_template(template, operand);
-
- for (i = 0; i < operand->count; i++)
- g_object_ref(G_OBJECT(operand->registers[i]));
-
- return true;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = objet partagé à consulter. *
-* template = informations à retrouver intégralement. *
-* *
-* Description : Réalise une copie minimale d'un contenu partagé. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_armv7_reglist_operand_define_template(const GArmV7RegListOperand *operand, GArmV7RegListOperand *template)
-{
- size_t i; /* Boucle de parcours */
-
- if (operand != NULL)
- template->count = operand->count;
- else
- template->count = 0;
-
- if (template->count == 0)
- template->registers = NULL;
-
- else
- {
- template->registers = (GArmV7Register **)malloc(template->count * sizeof(GArmV7Register *));
-
- for (i = 0; i < template->count; i++)
- template->registers[i] = operand->registers[i];
-
- }
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = objet partagé à consulter. *
-* template = informations dont le contenu est à libérer. *
-* *
-* Description : Libère la mémoire utilisée par un patron d'instance. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_armv7_reglist_operand_free_template(const GArmV7RegListOperand *operand, GArmV7RegListOperand *template)
-{
- if (template->registers != NULL)
- free(template->registers);
-
-}
-
-
-/******************************************************************************
-* *
* Paramètres : a = premier opérande à consulter. *
* b = second opérande à consulter. *
* *
@@ -388,9 +267,9 @@ static void g_armv7_reglist_operand_print(const GArmV7RegListOperand *operand, G
GArchOperand *g_armv7_reglist_operand_new(void)
{
- GSharedInstance *result; /* Structure à retourner */
+ GArchOperand *result; /* Structure à retourner */
- result = g_share_manager_build(_armv7_reglist_operand_manager, NULL);
+ result = g_object_new(G_TYPE_ARMV7_REGLIST_OPERAND, NULL);
return G_ARCH_OPERAND(result);
@@ -495,88 +374,3 @@ GArmV7Register *g_armv7_reglist_operand_get_register(const GArmV7RegListOperand
return operand->registers[index];
}
-
-
-
-/* ---------------------------------------------------------------------------------- */
-/* PARTAGES DE CONTENUS UNIQUES */
-/* ---------------------------------------------------------------------------------- */
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Fournit le gestionnaire de partages attribué à un type. *
-* *
-* Retour : Gestionnaire de partages en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GShareManager *get_armv7_reglist_operand_share_manager(void)
-{
- return _armv7_reglist_operand_manager;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Met en place les mécanismes de partage de listes de reg. *
-* *
-* Retour : Bilan de l'opération. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool init_armv7_reglist_operand_sharing(void)
-{
- _armv7_reglist_operand_manager = g_share_manager_new(G_TYPE_ARMV7_REGLIST_OPERAND);
-
- return true;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Imprime des statistiques quant aux partages dans l'archi. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-#ifdef DEBUG_DUMP_STATS
-void dump_armv7_reglist_operand_share_stats(void)
-{
- g_share_manager_dump_stats(_armv7_reglist_operand_manager);
-
-}
-#endif
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Supprime les mécanismes de partage des listes de registres. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void exit_armv7_reglist_operand_sharing(void)
-{
- g_object_unref(G_OBJECT(_armv7_reglist_operand_manager));
-
-}
diff --git a/src/arch/arm/v7/operands/reglist.h b/src/arch/arm/v7/operands/reglist.h
index 497c852..7c60805 100644
--- a/src/arch/arm/v7/operands/reglist.h
+++ b/src/arch/arm/v7/operands/reglist.h
@@ -34,9 +34,6 @@
-/* --------------------- MANIPULATION D'OPERANDES INDIVIDUELLES --------------------- */
-
-
#define G_TYPE_ARMV7_REGLIST_OPERAND g_armv7_reglist_operand_get_type()
#define G_ARMV7_REGLIST_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_armv7_reglist_operand_get_type(), GArmV7RegListOperand))
#define G_IS_ARMV7_REGLIST_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_armv7_reglist_operand_get_type()))
@@ -72,20 +69,4 @@ GArmV7Register *g_armv7_reglist_operand_get_register(const GArmV7RegListOperand
-/* -------------------------- PARTAGES DE CONTENUS UNIQUES -------------------------- */
-
-
-/* Met en place les mécanismes de partage de listes de registres. */
-bool init_armv7_reglist_operand_sharing(void);
-
-/* Imprime des statistiques quant aux partages dans l'archi. */
-#ifdef DEBUG_DUMP_STATS
-void dump_armv7_reglist_operand_share_stats(void);
-#endif
-
-/* Supprime les mécanismes de partage des listes de registres. */
-void exit_armv7_reglist_operand_sharing(void);
-
-
-
#endif /* _ARCH_ARM_V7_OPERANDS_REGLIST_H */
diff --git a/src/arch/arm/v7/operands/rotation.c b/src/arch/arm/v7/operands/rotation.c
index be89cd5..ba31441 100644
--- a/src/arch/arm/v7/operands/rotation.c
+++ b/src/arch/arm/v7/operands/rotation.c
@@ -25,13 +25,9 @@
#include "../../../operand-int.h"
-#include "../../../sharing/manager.h"
-/* --------------------- MANIPULATION D'OPERANDES INDIVIDUELLES --------------------- */
-
-
/* Définition d'un opérande visant une opérande de rotation ARMv7 (instance) */
struct _GArmV7RotationOperand
{
@@ -62,12 +58,6 @@ static void g_armv7_rotation_operand_dispose(GArmV7RotationOperand *);
/* Procède à la libération totale de la mémoire. */
static void g_armv7_rotation_operand_finalize(GArmV7RotationOperand *);
-/* Initialise un nouvel objet partagé avec des informations. */
-static bool g_armv7_rotation_operand_apply_template(GArmV7RotationOperand *, const GArmV7RotationOperand *);
-
-/* Réalise une copie minimale d'un contenu partagé. */
-static void g_armv7_rotation_operand_define_template(const GArmV7RotationOperand *, GArmV7RotationOperand *);
-
/* Compare un opérande avec un autre. */
static int g_armv7_rotation_operand_compare(const GArmV7RotationOperand *, const GArmV7RotationOperand *);
@@ -76,23 +66,6 @@ static void g_armv7_rotation_operand_print(const GArmV7RotationOperand *, GBuffe
-/* -------------------------- PARTAGES DE CONTENUS UNIQUES -------------------------- */
-
-
-/* Gestionnaire des partages d'instances */
-static GShareManager *_armv7_rotation_operand_manager = NULL;
-
-
-/* Fournit le gestionnaire de partages attribué à un type. */
-static GShareManager *get_armv7_rotation_operand_share_manager(void);
-
-
-
-/* ---------------------------------------------------------------------------------- */
-/* MANIPULATION D'OPERANDES INDIVIDUELLES */
-/* ---------------------------------------------------------------------------------- */
-
-
/* Indique le type défini par la GLib pour une opérande de rotation ARMv7. */
G_DEFINE_TYPE(GArmV7RotationOperand, g_armv7_rotation_operand, G_TYPE_ARCH_OPERAND);
@@ -120,12 +93,6 @@ static void g_armv7_rotation_operand_class_init(GArmV7RotationOperandClass *klas
object->dispose = (GObjectFinalizeFunc/* ! */)g_armv7_rotation_operand_dispose;
object->finalize = (GObjectFinalizeFunc)g_armv7_rotation_operand_finalize;
- operand->get_manager = (get_operand_manager_fc)get_armv7_rotation_operand_share_manager;
-
- operand->apply_template = (apply_operand_template_fc)g_armv7_rotation_operand_apply_template;
- operand->define_template = (define_operand_template_fc)g_armv7_rotation_operand_define_template;
- operand->free_template = (free_operand_template_fc)NULL;
-
operand->compare = (operand_compare_fc)g_armv7_rotation_operand_compare;
operand->print = (operand_print_fc)g_armv7_rotation_operand_print;
@@ -192,50 +159,6 @@ static void g_armv7_rotation_operand_finalize(GArmV7RotationOperand *operand)
/******************************************************************************
* *
-* Paramètres : operand = objet partagé à initialiser. *
-* template = information à utiliser pour la mise en place. *
-* *
-* Description : Initialise un nouvel objet partagé avec des informations. *
-* *
-* Retour : Bilan de l'opération. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_armv7_rotation_operand_apply_template(GArmV7RotationOperand *operand, const GArmV7RotationOperand *template)
-{
- g_armv7_rotation_operand_define_template(template, operand);
-
- g_object_ref(G_OBJECT(operand->value));
-
- return true;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = objet partagé à consulter. *
-* template = informations à retrouver intégralement. *
-* *
-* Description : Réalise une copie minimale d'un contenu partagé. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_armv7_rotation_operand_define_template(const GArmV7RotationOperand *operand, GArmV7RotationOperand *template)
-{
- template->value = operand->value;
-
-}
-
-
-/******************************************************************************
-* *
* Paramètres : a = premier opérande à consulter. *
* b = second opérande à consulter. *
* *
@@ -297,12 +220,11 @@ static void g_armv7_rotation_operand_print(const GArmV7RotationOperand *operand,
GArchOperand *g_armv7_rotation_operand_new(GArchOperand *value)
{
- GSharedInstance *result; /* Structure à retourner */
- GArmV7RotationOperand template; /* Transport d'informations */
+ GArmV7RotationOperand *result; /* Structure à retourner */
- template.value = value;
+ result = g_object_new(G_TYPE_ARMV7_ROTATION_OPERAND, NULL);
- result = g_share_manager_build(_armv7_rotation_operand_manager, (GSharedInstance *)&template);
+ result->value = value;
return G_ARCH_OPERAND(result);
@@ -332,88 +254,3 @@ GArchOperand *g_armv7_rotation_operand_get_value(const GArmV7RotationOperand *op
return result;
}
-
-
-
-/* ---------------------------------------------------------------------------------- */
-/* PARTAGES DE CONTENUS UNIQUES */
-/* ---------------------------------------------------------------------------------- */
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Fournit le gestionnaire de partages attribué à un type. *
-* *
-* Retour : Gestionnaire de partages en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GShareManager *get_armv7_rotation_operand_share_manager(void)
-{
- return _armv7_rotation_operand_manager;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Met en place les mécanismes de partage des rotation ARMv7. *
-* *
-* Retour : Bilan de l'opération. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool init_armv7_rotation_operand_sharing(void)
-{
- _armv7_rotation_operand_manager = g_share_manager_new(G_TYPE_ARMV7_ROTATION_OPERAND);
-
- return true;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Imprime des statistiques quant aux partages dans l'archi. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-#ifdef DEBUG_DUMP_STATS
-void dump_armv7_rotation_operand_share_stats(void)
-{
- g_share_manager_dump_stats(_armv7_rotation_operand_manager);
-
-}
-#endif
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Supprime les mécanismes de partage des opérandes de rotation.*
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void exit_armv7_rotation_operand_sharing(void)
-{
- g_object_unref(G_OBJECT(_armv7_rotation_operand_manager));
-
-}
diff --git a/src/arch/arm/v7/operands/rotation.h b/src/arch/arm/v7/operands/rotation.h
index 399baf4..7fb6c09 100644
--- a/src/arch/arm/v7/operands/rotation.h
+++ b/src/arch/arm/v7/operands/rotation.h
@@ -58,20 +58,4 @@ GArchOperand *g_armv7_rotation_operand_get_value(const GArmV7RotationOperand *);
-/* -------------------------- PARTAGES DE CONTENUS UNIQUES -------------------------- */
-
-
-/* Met en place les mécanismes de partage des rotation ARMv7. */
-bool init_armv7_rotation_operand_sharing(void);
-
-/* Imprime des statistiques quant aux partages dans l'archi. */
-#ifdef DEBUG_DUMP_STATS
-void dump_armv7_rotation_operand_share_stats(void);
-#endif
-
-/* Supprime les mécanismes de partage des opérandes de rotation. */
-void exit_armv7_rotation_operand_sharing(void);
-
-
-
#endif /* _ARCH_ARM_V7_OPERANDS_ROTATION_H */
diff --git a/src/arch/arm/v7/operands/shift.c b/src/arch/arm/v7/operands/shift.c
index 3a37e81..6fbdbcb 100644
--- a/src/arch/arm/v7/operands/shift.c
+++ b/src/arch/arm/v7/operands/shift.c
@@ -25,14 +25,10 @@
#include "../../../operand-int.h"
-#include "../../../sharing/manager.h"
#include "../../../../common/sort.h"
-/* --------------------- MANIPULATION D'OPERANDES INDIVIDUELLES --------------------- */
-
-
/* Définition d'un opérande visant une opérande de décallage ARMv7 (instance) */
struct _GArmV7ShiftOperand
{
@@ -64,12 +60,6 @@ static void g_armv7_shift_operand_dispose(GArmV7ShiftOperand *);
/* Procède à la libération totale de la mémoire. */
static void g_armv7_shift_operand_finalize(GArmV7ShiftOperand *);
-/* Initialise un nouvel objet partagé avec des informations. */
-static bool g_armv7_shift_operand_apply_template(GArmV7ShiftOperand *, const GArmV7ShiftOperand *);
-
-/* Réalise une copie minimale d'un contenu partagé. */
-static void g_armv7_shift_operand_define_template(const GArmV7ShiftOperand *, GArmV7ShiftOperand *);
-
/* Compare un opérande avec un autre. */
static int g_armv7_shift_operand_compare(const GArmV7ShiftOperand *, const GArmV7ShiftOperand *);
@@ -78,23 +68,6 @@ static void g_armv7_shift_operand_print(const GArmV7ShiftOperand *, GBufferLine
-/* -------------------------- PARTAGES DE CONTENUS UNIQUES -------------------------- */
-
-
-/* Gestionnaire des partages d'instances */
-static GShareManager *_armv7_shift_operand_manager = NULL;
-
-
-/* Fournit le gestionnaire de partages attribué à un type. */
-static GShareManager *get_armv7_shift_operand_share_manager(void);
-
-
-
-/* ---------------------------------------------------------------------------------- */
-/* MANIPULATION D'OPERANDES INDIVIDUELLES */
-/* ---------------------------------------------------------------------------------- */
-
-
/* Indique le type défini par la GLib pour une opérande de décallage ARMv7. */
G_DEFINE_TYPE(GArmV7ShiftOperand, g_armv7_shift_operand, G_TYPE_ARCH_OPERAND);
@@ -122,12 +95,6 @@ static void g_armv7_shift_operand_class_init(GArmV7ShiftOperandClass *klass)
object->dispose = (GObjectFinalizeFunc/* ! */)g_armv7_shift_operand_dispose;
object->finalize = (GObjectFinalizeFunc)g_armv7_shift_operand_finalize;
- operand->get_manager = (get_operand_manager_fc)get_armv7_shift_operand_share_manager;
-
- operand->apply_template = (apply_operand_template_fc)g_armv7_shift_operand_apply_template;
- operand->define_template = (define_operand_template_fc)g_armv7_shift_operand_define_template;
- operand->free_template = (free_operand_template_fc)NULL;
-
operand->compare = (operand_compare_fc)g_armv7_shift_operand_compare;
operand->print = (operand_print_fc)g_armv7_shift_operand_print;
@@ -194,52 +161,6 @@ static void g_armv7_shift_operand_finalize(GArmV7ShiftOperand *operand)
/******************************************************************************
* *
-* Paramètres : operand = objet partagé à initialiser. *
-* template = information à utiliser pour la mise en place. *
-* *
-* Description : Initialise un nouvel objet partagé avec des informations. *
-* *
-* Retour : Bilan de l'opération. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static bool g_armv7_shift_operand_apply_template(GArmV7ShiftOperand *operand, const GArmV7ShiftOperand *template)
-{
- g_armv7_shift_operand_define_template(template, operand);
-
- g_object_ref(G_OBJECT(operand->shift_value));
-
- return true;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : operand = objet partagé à consulter. *
-* template = informations à retrouver intégralement. *
-* *
-* Description : Réalise une copie minimale d'un contenu partagé. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static void g_armv7_shift_operand_define_template(const GArmV7ShiftOperand *operand, GArmV7ShiftOperand *template)
-{
- template->shift_type = operand->shift_type;
-
- template->shift_value = operand->shift_value;
-
-}
-
-
-/******************************************************************************
-* *
* Paramètres : a = premier opérande à consulter. *
* b = second opérande à consulter. *
* *
@@ -323,13 +244,12 @@ static void g_armv7_shift_operand_print(const GArmV7ShiftOperand *operand, GBuff
GArchOperand *g_armv7_shift_operand_new(SRType type, GArchOperand *value)
{
- GSharedInstance *result; /* Structure à retourner */
- GArmV7ShiftOperand template; /* Transport d'informations */
+ GArmV7ShiftOperand *result; /* Structure à retourner */
- template.shift_type = type;
- template.shift_value = value;
+ result = g_object_new(G_TYPE_ARMV7_SHIFT_OPERAND, NULL);
- result = g_share_manager_build(_armv7_shift_operand_manager, (GSharedInstance *)&template);
+ result->shift_type = type;
+ result->shift_value = value;
return G_ARCH_OPERAND(result);
@@ -378,88 +298,3 @@ GArchOperand *g_armv7_shift_operand_get_shift_value(const GArmV7ShiftOperand *op
return result;
}
-
-
-
-/* ---------------------------------------------------------------------------------- */
-/* PARTAGES DE CONTENUS UNIQUES */
-/* ---------------------------------------------------------------------------------- */
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Fournit le gestionnaire de partages attribué à un type. *
-* *
-* Retour : Gestionnaire de partages en place. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-static GShareManager *get_armv7_shift_operand_share_manager(void)
-{
- return _armv7_shift_operand_manager;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Met en place les mécanismes de partage des décallages ARMv7. *
-* *
-* Retour : Bilan de l'opération. *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-bool init_armv7_shift_operand_sharing(void)
-{
- _armv7_shift_operand_manager = g_share_manager_new(G_TYPE_ARMV7_SHIFT_OPERAND);
-
- return true;
-
-}
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Imprime des statistiques quant aux partages dans l'archi. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-#ifdef DEBUG_DUMP_STATS
-void dump_armv7_shift_operand_share_stats(void)
-{
- g_share_manager_dump_stats(_armv7_shift_operand_manager);
-
-}
-#endif
-
-
-/******************************************************************************
-* *
-* Paramètres : - *
-* *
-* Description : Supprime les mécanismes de partage des décallages ARMv7. *
-* *
-* Retour : - *
-* *
-* Remarques : - *
-* *
-******************************************************************************/
-
-void exit_armv7_shift_operand_sharing(void)
-{
- g_object_unref(G_OBJECT(_armv7_shift_operand_manager));
-
-}
diff --git a/src/arch/arm/v7/operands/shift.h b/src/arch/arm/v7/operands/shift.h
index 1169946..2eac092 100644
--- a/src/arch/arm/v7/operands/shift.h
+++ b/src/arch/arm/v7/operands/shift.h
@@ -33,9 +33,6 @@
-/* --------------------- MANIPULATION D'OPERANDES INDIVIDUELLES --------------------- */
-
-
#define G_TYPE_ARMV7_SHIFT_OPERAND g_armv7_shift_operand_get_type()
#define G_ARMV7_SHIFT_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), g_armv7_shift_operand_get_type(), GArmV7ShiftOperand))
#define G_IS_ARMV7_SHIFT_OPERAND(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), g_armv7_shift_operand_get_type()))
@@ -65,20 +62,4 @@ GArchOperand *g_armv7_shift_operand_get_shift_value(const GArmV7ShiftOperand *);
-/* -------------------------- PARTAGES DE CONTENUS UNIQUES -------------------------- */
-
-
-/* Met en place les mécanismes de partage des décallages ARMv7. */
-bool init_armv7_shift_operand_sharing(void);
-
-/* Imprime des statistiques quant aux partages dans l'archi. */
-#ifdef DEBUG_DUMP_STATS
-void dump_armv7_shift_operand_share_stats(void);
-#endif
-
-/* Supprime les mécanismes de partage des décallages ARMv7. */
-void exit_armv7_shift_operand_sharing(void);
-
-
-
#endif /* _ARCH_ARM_V7_OPERANDS_SHIFT_H */