-
Notifications
You must be signed in to change notification settings - Fork 684
Add 32 bit compressed pointer support. #1271
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
Conversation
910da8c
to
5600c4c
Compare
Around 20% memory increase (9% RSS increase), a little perf gain (2%) and a small binary size reduction (200 byte).
|
IMHO, we should add a new travis job and test this feature on every new commit. |
As you can see travis is failing, since you need a 32 bit system (travis is 64 bit by default). I dont have any idea how to test it. |
jmem_cpointer_t next_property_cp; /**< next cpointer */ | ||
#endif /* JERRY_CPOINTER_32_BIT */ | ||
} ecma_property_header_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.
Can you explain this change? Why did you move the next cpointer on 32 bit?
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.
Because ECMA_PROPERTY_VALUE_PTR expects that the type fields are packed in a 4 byte word, which is followed by maximum of four value words. For 16 bit cpointers the next pointer can be squeezed in the last two bytes of the first word. This is not possible with 32 bit cpointers, where that 16 bit is unused.
The code looks good, but |
c7f876f
to
3f1c9a1
Compare
Description added, patch updated. |
LGTM |
@@ -39,8 +39,6 @@ | |||
*/ | |||
#ifndef CONFIG_MEM_HEAP_AREA_SIZE | |||
# define CONFIG_MEM_HEAP_AREA_SIZE (512 * 1024) | |||
#elif CONFIG_MEM_HEAP_AREA_SIZE > (512 * 1024) | |||
# error "Currently, maximum 512 kilobytes heap size is supported" |
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.
Removing this may be a bad idea, I think it would be better to add && !JERRY_CPOINTER_32_BIT
to the condition instead.
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.
Another assertion is added instead of it.
LGTM otherwise. |
two_pow_mem_heap_offset_should_not_be_less_than_mem_heap_size); | ||
#ifndef JERRY_CPOINTER_32_BIT | ||
JERRY_STATIC_ASSERT (((UINT16_MAX + 1) << JMEM_ALIGNMENT_LOG) >= JMEM_HEAP_SIZE, | ||
maximum_heap_size_for_16_bit_compressed_pointers_is_512K); |
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.
Here.
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.
Oh, I see. Okay.
LGTM |
JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg [email protected]
3f1c9a1
to
da47ded
Compare
This is a WIP patch, which will not be landed before the 1.0 release.
This patch extends compressed pointers to be 32 bit long when "--cpointer_32_bit on" is passed. After custom allocators will be added to Jerry, this will allow to use the full 32 bit address space on 32 bit systems at the cost of increased memory size. I will do some measurements to estimate this trade-of with the current allocator.