Moving to replacement of on-stack ecma_object_t* with managed ecma_object_ptr_t.

This commit is contained in:
Ruben Ayrapetyan
2015-02-04 18:02:34 +03:00
parent e3f081ee84
commit fb6e205d0d
92 changed files with 1343 additions and 907 deletions
+28 -1
View File
@@ -73,14 +73,41 @@ JERRY_STATIC_ASSERT (sizeof (ecma_label_descriptor_t) == sizeof (uint64_t));
mem_pools_free ((uint8_t*) p ## ecma_type); \
}
/**
* Template of an allocation routine.
*/
#define ALLOC_MANAGED_PTR(ecma_type) void \
ecma_alloc_ ## ecma_type (ecma_ ## ecma_type ## _ptr_t &ret_ ## ecma_type ## _p) \
{ \
ret_ ## ecma_type ## _p = (ecma_ ## ecma_type ## _t *) mem_pools_alloc (); \
\
JERRY_ASSERT (ret_ ## ecma_type ## _p.is_not_null ()); \
}
/**
* Deallocation routine template
*/
#define DEALLOC_MANAGED_PTR(ecma_type) void \
ecma_dealloc_ ## ecma_type (ecma_ ## ecma_type ## _ptr_t& ecma_type ## _p) \
{ \
ecma_ ## ecma_type ## _t* ecma_type ## _tmp_p = (ecma_ ## ecma_type ## _t*) ecma_type ## _p; \
ecma_type ## _p = (ecma_ ## ecma_type ## _t *) NULL; \
\
mem_pools_free ((uint8_t*) ecma_type ## _tmp_p); \
}
/**
* Declaration of alloc/free routine for specified ecma-type.
*/
#define DECLARE_ROUTINES_FOR(ecma_type) \
ALLOC(ecma_type) \
DEALLOC(ecma_type)
#define DECLARE_MANAGED_PTR_ROUTINES_FOR(ecma_type) \
ALLOC_MANAGED_PTR(ecma_type) \
DEALLOC_MANAGED_PTR(ecma_type)
DECLARE_MANAGED_PTR_ROUTINES_FOR (object)
DECLARE_ROUTINES_FOR (object)
DECLARE_ROUTINES_FOR (property)
DECLARE_ROUTINES_FOR (number)
DECLARE_ROUTINES_FOR (collection_header)