-
Notifications
You must be signed in to change notification settings - Fork 683
Optimize conditional jumps. #1104
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
Optimize conditional jumps. #1104
Conversation
inline ecma_value_t __attr_pure___ __attr_always_inline___ | ||
ecma_invert_boolean_value (ecma_value_t value) /**< ecma value */ | ||
{ | ||
JERRY_STATIC_ASSERT ((ECMA_SIMPLE_VALUE_FALSE | 0x1) == ECMA_SIMPLE_VALUE_TRUE |
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.
This static assert should be right after the definition of ECMA_SIMPLE_VALUE_TRUE and ECMA_SIMPLE_VALUE_FALSE.
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.
You cannot do that because they are in the header. And only this function depends on this condition at the moment.
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.
OK, at least move out of the function. IMHO, it should be placed at the top of the file like in ecma-helpers.c
eacc295
to
7895cd5
Compare
Thank you, fixed. |
LGTM |
The ecma_op_to_boolean return value is changed to bool for faster evaluation, and no need to swap operandos of relational compare. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
7895cd5
to
f24be95
Compare
Moved to the beginning |
@zherczeg, thanks for the update. LGTM |
The ecma_op_to_boolean return value is changed to bool for faster
evaluation, and no need to swap operandos of relational compare.