-
Notifications
You must be signed in to change notification settings - Fork 683
Literal storage #148
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
Literal storage #148
Conversation
@@ -234,7 +234,7 @@ project (Jerry CXX C ASM) | |||
set(FLAGS_COMMON_RELEASE "-Os -nostdlib") | |||
|
|||
# Unit tests | |||
set(FLAGS_COMMON_UNITTESTS "-O3 -nodefaultlibs") | |||
set(FLAGS_COMMON_UNITTESTS "-O0 -nodefaultlibs") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How this change relates to the patch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Appeared here as result of debugging. Actually, it doesn't relate to this patch. I'll revert it.
@egavrin, fixed code according to your notes. |
* @return true - if strings are equal; | ||
* false - otherwise. | ||
*/ | ||
bool ecma_compare_non_zt_to_zt_string (const ecma_char_t *string1_p, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing comments on arguments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll add all the missing comments throughout the patch and also description of the literal storage internals in wiki.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to fix comments with follow up patches - we can fix it now.
@@ -38,12 +34,6 @@ static size_t strings_cache_used_size; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how to place comment on unmodified code part, but there are some variable definitions above, which, probably, could be removed:
static ecma_char_t *strings_cache;
static size_t strings_cache_size;
static size_t strings_cache_used_size;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
I've updated PR. @sand1k @ruben-ayrapetyan @galpeter please check. |
@@ -174,6 +175,8 @@ template<typename... values> extern void jerry_ref_unused_variables (const value | |||
} while (0) | |||
#endif /* JERRY_NDEBUG */ | |||
|
|||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems that new whitespace here and a bit above is not necessary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
Seems good to me (btw: we would also need to rebase this) |
@galpeter thank you! We'll rebase and land it. |
377170f
to
6fcb695
Compare
JerryScript-DCO-1.0-Signed-off-by: Evgeny Gavrin e.gavrin@samsung.com JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
JerryScript-DCO-1.0-Signed-off-by: Evgeny Gavrin e.gavrin@samsung.com JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
JerryScript-DCO-1.0-Signed-off-by: Evgeny Gavrin e.gavrin@samsung.com JerryScript-DCO-1.0-Signed-off-by: Andrey Shitov a.shitov@samsung.com
6fcb695
to
53801e3
Compare
Replaced contiguous array of literals with flexible literal storage.
The storage allows to effectively manage memory occupied by literals. Addition and removal of a literal ('eval' or 'new function' processing, garbage collection) could be done without reallocation of the whole literal array, hence it solves fragmentation problem.