-
Notifications
You must be signed in to change notification settings - Fork 683
Syntax error feedback support #211
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
@sand1k, could you, please, review the changes? |
@ruben-ayrapetyan, why do we need to move jerry-core/parser/collections to jerry-core/parser/js/collections? |
As for the rest, LGTM. |
@sand1k, thank you for review. The collections are currently used only in js parser. As one of the commit in the changes replaces heap allocation requests from the collections component with requests to parser-internal memory manager, it seems to me that it is better to move the collections component to make them parser-internal. Currently there are following collection types:
It seems to me that, probably, during further optimization of parser memory usage, all code, which is currently using the collections, could be updated to not use them. What do you think about this? |
@ruben-ayrapetyan, sounds reasonoble. Do we need 'js' folder, which is now the only one inside 'parser'? |
No, I think |
@sand1k, @egavrin, |
* syntax_get_syntax_error_longjmp_label | ||
* syntax_raise_error | ||
*/ | ||
jmp_buf jsp_syntax_error_label; |
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.
Shouldn't this be a static variable?
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.
The variable is anyway inaccessible outside of the module, as there are no extern
declarations for it. I could make it static
, if you prefer so.
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 think it would be better as the other variables here are also static (the STATIC_STACKs)
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, I'll add it.
@ruben-ayrapetyan I briefly checked, good to me. Get approve from @galpeter and |
f8dff65
to
fe50a02
Compare
@galpeter, I've updated pull request:
Please, add your note to discussion about |
fe50a02
to
aa8f242
Compare
@galpeter, I've updated pull request. |
@ruben-ayrapetyan, thanks. Looks good to me. |
@galpeter, thank you for review. |
JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
…e now performed in parser_parse_program); introduce boolean return value in parser invocation interfaces that would indicate whether SyntaxError was raised during parse. JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
…ers hash table. - literal identifiers hash table and byte-code array are now allocated in one heap block instead of four blocks; - memory regions with the hash tables and arrays are now linked into linked list using headers at start of the regions instead of using array_list. JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
… labels registered at the moment of call for usage upon raise of SyntaxError during parse. JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
…_mm_free_all that, upon call, frees all memory allocated with the allocator. JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
aa8f242
to
6fe2358
Compare
Now, parser correctly finishes parse procedure if syntax of source code is incorrect (syntax correctness is indicated using return value): - parser-internal memory management is performed using jsp_mm_alloc / jsp_mm_free; - upon detection of incorrect syntax, all parser-allocated memory regions are deallocated using jsp_mm_free_all and parse finishes with corresponding return value. JerryScript-DCO-1.0-Signed-off-by: Ruben Ayrapetyan r.ayrapetyan@samsung.com
6fe2358
to
a4e54e7
Compare
Related issue: #54