-
Notifications
You must be signed in to change notification settings - Fork 688
Few improvements for RegExp #947
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
Few improvements for RegExp #947
Conversation
| if (cache_idx < RE_CACHE_SIZE) | ||
| if (cache_idx >= RE_CACHE_SIZE) | ||
| { | ||
| if (re_cache_idx < 1u) |
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.
Actually, in these two ifs, we are checking whether cache_idx == RE_CACHE_SIZE and re_cache_idx == 0, aren't we? (I mean, there is no way for cache_idx to be striclty larger that RE_CACHE_SIZE, and re_cache_idx being unsigned, it cannot have negative value.) I'd vote for the exact equality tests.
7891675 to
90db124
Compare
90db124 to
f58c816
Compare
| * RE_CACHE_SIZE - otherwise | ||
| */ | ||
| const re_compiled_code_t * | ||
| static uint16_t |
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.
uint32_t
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 see now that re_cache_idx is uint16_t. If we want to force a small number we could use uint8_t. Anyway I am even happy with uint32_t as well.
Otherwise LGTM.
f58c816 to
74cdc68
Compare
|
@zherczeg, updated. May I land this? |
74cdc68 to
ba4e52d
Compare
|
LGTM |
Added eviction mechanism to RegExp cache and small refactoring. Fixed a bug when logging is enabled. Related issue: jerryscript-project#927 JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com
ba4e52d to
6f536c7
Compare
Added eviction mechanism to RegExp cache and small
refactoring. Fixed a bug when logging is enabled.
Related issue: #927
JerryScript-DCO-1.0-Signed-off-by: László Langó llango.u-szeged@partner.samsung.com