-
Notifications
You must be signed in to change notification settings - Fork 683
Merge lcache into context #2498
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
Merge lcache into context #2498
Conversation
Note: this is the first part of a series of patches about refactoring the context concept. |
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.
LGTM
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.
Is there a perf change after this patch?
jerry-core/jcontext/jcontext.h
Outdated
ecma_lcache_hash_entry_t lcache[ECMA_LCACHE_HASH_ROWS_COUNT][ECMA_LCACHE_HASH_ROW_LENGTH]; /**< Hash table for | ||
* caching the last | ||
* access of properties. | ||
*/ |
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 would intorduce a typedef for this or move the comment the line before. Also add a comment that this must be the last member of the context for performance reasons.
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 move the comment, typedef would be an overkill for this.
@@ -36,7 +35,6 @@ | |||
void | |||
ecma_init (void) | |||
{ | |||
ecma_lcache_init (); |
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.
Is the cache cleared along the context?
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.
Yes, jerry_init
clears all the context with memset
. Now that lcache is part of the context, it's initialization is also handled there.
The PR has no performance implications (perhaps just some noise in the measurements):
Binary sizes (bytes) I'll deal with the comment placement review remark and update the patch. |
It is superfluous to maintain multiple globals when the whole reason of context is to keep them in a single place. It also simplifies initialization and external context creation a bit. Also removed unused lcache header includes. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu
5729317
to
466d219
Compare
PR updated according to the review. |
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.
LGTM
It is superfluous to maintain multiple globals when the whole
reason of context is to keep them in a single place. It also
simplifies initialization and external context creation a bit.
Also removed unused lcache header includes.
JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu