Skip to content

New External Magic String API to save heap memory #136

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jerry-core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ project (JerryCore CXX C ASM)
set(DEFINES_JERRY_RELEASE JERRY_NDEBUG)

# Unit tests
set(DEFINES_JERRY_UNITTESTS )
set(DEFINES_JERRY_UNITTESTS JERRY_ENABLE_PRETTY_PRINTER)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you, please, move the change, to separate commit in this pull request?


# Modifiers
# Full profile
Expand Down
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