Skip to content

Commit

Permalink
New External Magic String API to save heap memory
Browse files Browse the repository at this point in the history
JerryScript-DCO-1.0-Signed-off-by: SaeHie Park [email protected]
  • Loading branch information
seanshpark committed Jun 8, 2015
1 parent 603fa56 commit 723924f
Show file tree
Hide file tree
Showing 13 changed files with 457 additions and 12 deletions.
17 changes: 16 additions & 1 deletion jerry-core/ecma/base/ecma-globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,12 @@ typedef uint8_t ecma_char_t;
typedef uint16_t ecma_char_t;
#endif /* CONFIG_ECMA_CHAR_ENCODING == CONFIG_ECMA_CHAR_UTF16 */

/**
* Description of an ecma-character pointer
*/
typedef ecma_char_t* ecma_char_ptr_t;


#if CONFIG_ECMA_NUMBER_TYPE == CONFIG_ECMA_NUMBER_FLOAT32
/**
* Description of an ecma-number
Expand Down Expand Up @@ -746,7 +752,8 @@ typedef enum
ECMA_STRING_CONTAINER_UINT32_IN_DESC, /**< actual data is UInt32-represeneted Number
stored locally in the string's descriptor */
ECMA_STRING_CONTAINER_CONCATENATION, /**< the ecma-string is concatenation of two specified ecma-strings */
ECMA_STRING_CONTAINER_MAGIC_STRING /**< the ecma-string is equal to one of ECMA magic strings */
ECMA_STRING_CONTAINER_MAGIC_STRING, /**< the ecma-string is equal to one of ECMA magic strings */
ECMA_STRING_CONTAINER_MAGIC_STRING_EX /**< the ecma-string is equal to one of external magic strings */
} ecma_string_container_t;

FIXME (Move to library that should define the type (literal.h /* ? */))
Expand All @@ -768,6 +775,11 @@ typedef enum
ECMA_MAGIC_STRING__COUNT /**< number of magic strings */
} ecma_magic_string_id_t;

/**
* Identifiers of implementation-defined external magic string constants
*/
typedef uint32_t ecma_magic_string_ex_id_t;

/**
* ECMA string hash
*/
Expand Down Expand Up @@ -823,6 +835,9 @@ typedef struct ecma_string_t
/** Identifier of magic string */
ecma_magic_string_id_t magic_string_id;

/** Identifier of external magic string */
ecma_magic_string_ex_id_t magic_string_ex_id;

/** For zeroing and comparison in some cases */
uint32_t common_field;
} u;
Expand Down
Loading

0 comments on commit 723924f

Please sign in to comment.