Skip to content

Commit 62d400d

Browse files
committed
Use heap allocated buffer instead of char collection in ecma_strings
JerryScript-DCO-1.0-Signed-off-by: Dániel Bátyai dbatyai.u-szeged@partner.samsung.com
1 parent 579b1ed commit 62d400d

File tree

2 files changed

+75
-300
lines changed

2 files changed

+75
-300
lines changed

jerry-core/ecma/base/ecma-globals.h

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -778,8 +778,7 @@ typedef struct
778778
typedef enum
779779
{
780780
ECMA_STRING_CONTAINER_LIT_TABLE, /**< actual data is in literal table */
781-
ECMA_STRING_CONTAINER_HEAP_CHUNKS, /**< actual data is on the heap
782-
in a ecma_collection_chunk_t chain */
781+
ECMA_STRING_CONTAINER_STRING_DATA, /**< actual data is on the heap */
783782
ECMA_STRING_CONTAINER_HEAP_NUMBER, /**< actual data is on the heap as a ecma_number_t */
784783
ECMA_STRING_CONTAINER_UINT32_IN_DESC, /**< actual data is UInt32-represeneted Number
785784
stored locally in the string's descriptor */
@@ -795,6 +794,18 @@ FIXME (Move to library that should define the type (literal.h /* ? */))
795794
typedef rcs_record_t *literal_t;
796795
typedef rcs_cpointer_t lit_cpointer_t;
797796

797+
#define ECMA_STRING_DATA_EXTRA_SIZE (2 * sizeof (uint16_t))
798+
799+
/**
800+
* ECMA string data descriptor
801+
*/
802+
typedef struct ecma_string_data_t
803+
{
804+
uint16_t size;
805+
uint16_t length;
806+
lit_utf8_byte_t data;
807+
} ecma_string_data_t;
808+
798809
/**
799810
* ECMA string-value descriptor
800811
*/
@@ -822,7 +833,7 @@ typedef struct ecma_string_t
822833
lit_cpointer_t lit_cp;
823834

824835
/** Compressed pointer to an ecma_collection_header_t */
825-
mem_cpointer_t collection_cp : ECMA_POINTER_FIELD_WIDTH;
836+
mem_cpointer_t data_cp : ECMA_POINTER_FIELD_WIDTH;
826837

827838
/** Compressed pointer to an ecma_number_t */
828839
mem_cpointer_t number_cp : ECMA_POINTER_FIELD_WIDTH;

0 commit comments

Comments
 (0)