-
Notifications
You must be signed in to change notification settings - Fork 676
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
Rearrange fields of ecma_property_t to be naturally aligned. #904
Conversation
|
} | ||
if (is_writable) | ||
{ | ||
prop_p->flags = (uint8_t) (prop_p->flags | ECMA_PROPERTY_FLAG_WRITABLE); |
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.
Wouldn't prop_p->flags |= (uint8_t) ECMA_PROPERTY_FLAG_xxx;
work here and above? (It's a bit more compact.)
Actually, using a local variable to compose the flags and then copy that into prop_p->flags
would be even nicer.
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.
No :( c99 int conversion issue. I cannot say how much I hate it but only ++ and -- is accepted for types smaller than int. Everything else will be a warning. I even introduced macros for them in the parser.
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.
Ahh, too bad. I was not aware of that limitation. OK then.
5670f25
to
e334809
Compare
On Sunspider benchmark suite the currently used MaxRSS measuring script reported a large memory growth, and I decided to analyse the reason. I created a new valgrind tool called heimdall which reports all page ranges that are accessed by an application. Then I picked bitops-bitwise-and.js which memory footprint growth from 24K to 32K. Here are the results: Original:
It turned out that the MaxRSS measuring script underestimated the real memory consumption. This is a known disadvantage of the script, since its precision depends on its sampling frequency. After the patch:
The growth is visible here as well. However, the interesting part comes here. We change the page size to 1K (down from 4K) and measured these tests again: Original:
After the patch:
We can notice that the memory consumption decreased to 12K, and that is not changed after the patch. The ranges are the same, although the base address with the patch is a bit lower than the original. So the page alignment increase the 12K memory consumption to 28-32K on Linux. A huge waste! Fortunately this does not affect the microcontrollers, our real targets, so I propose to land this patch. |
…ttribute and __extension__ keywords are removed. The standard approach reduced the binary size by 2K. JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg [email protected]
e334809
to
cb2ad29
Compare
LGTM |
Landed in b8b587f. |
Rearrange fields of ecma_property_t to be naturally aligned. Packed attribute and extension keywords are removed. The standard approach reduced the binary size by 2K.