-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -361,9 +361,16 @@ typedef struct | |
*/ | ||
typedef struct | ||
{ | ||
#ifdef JERRY_CPOINTER_32_BIT | ||
jmem_cpointer_t next_property_cp; /**< next cpointer */ | ||
#endif /* JERRY_CPOINTER_32_BIT */ | ||
ecma_property_t types[ECMA_PROPERTY_PAIR_ITEM_COUNT]; /**< two property type slot. The first represent | ||
* the type of this property (e.g. property pair) */ | ||
#ifdef JERRY_CPOINTER_32_BIT | ||
uint16_t padding; /**< an unused value */ | ||
#else /* !JERRY_CPOINTER_32_BIT */ | ||
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 commentThe 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 commentThe 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. |
||
|
||
/** | ||
|
@@ -381,7 +388,11 @@ typedef struct | |
typedef union | ||
{ | ||
ecma_value_t value; /**< value of a property */ | ||
#ifdef JERRY_CPOINTER_32_BIT | ||
jmem_cpointer_t getter_setter_pair_cp; /**< cpointer to getter setter pair */ | ||
#else /* !JERRY_CPOINTER_32_BIT */ | ||
ecma_getter_setter_pointers_t getter_setter_pair; /**< getter setter pair */ | ||
#endif /* JERRY_CPOINTER_32_BIT */ | ||
} ecma_property_value_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.
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.