Introducing managed pointers classes (ecma_generic_ptr_t, ecma_pointer_t<T>); using ecma_generic_ptr_t to store pointer in ecma_value_t.

This commit is contained in:
Ruben Ayrapetyan
2015-02-03 14:55:14 +03:00
parent 55caaf7a88
commit b0e4d2ece1
4 changed files with 169 additions and 26 deletions
+8 -22
View File
@@ -24,31 +24,10 @@
#define JERRY_ECMA_GLOBALS_H
#include "config.h"
#include "ecma-managed-pointer.h"
#include "globals.h"
#include "mem-allocator.h"
/** \addtogroup compressedpointer Compressed pointer
* @{
*/
/**
* Ecma-pointer field is used to calculate ecma-value's address.
*
* Ecma-pointer contains value's shifted offset from common Ecma-pointers' base.
* The offset is shifted right by MEM_ALIGNMENT_LOG.
* Least significant MEM_ALIGNMENT_LOG bits of non-shifted offset are zeroes.
*/
#define ECMA_POINTER_FIELD_WIDTH MEM_COMPRESSED_POINTER_WIDTH
/**
* The NULL value for compressed pointers
*/
#define ECMA_NULL_POINTER MEM_COMPRESSED_POINTER_NULL
/**
* @}
*/
/**
* Type of ecma-value
*/
@@ -769,6 +748,13 @@ typedef struct
} u;
} ecma_string_t;
/**
* Managed pointers definition
*/
typedef ecma_pointer_t<ecma_number_t> ecma_number_ptr_t;
typedef ecma_pointer_t<ecma_string_t> ecma_string_ptr_t;
typedef ecma_pointer_t<ecma_object_t> ecma_object_ptr_t;
/**
* @}
*/