-
Notifications
You must be signed in to change notification settings - Fork 677
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
Improve Proxy recrusion check in their internal methods. #4568
Improve Proxy recrusion check in their internal methods. #4568
Conversation
4c629f4
to
172b643
Compare
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.
Looks good in general
172b643
to
fe2b5aa
Compare
Maybe it's worth to contribute this testcase to test262 |
Also please update jerryscript/.github/workflows/gh-actions.yml Lines 50 to 52 in fe2b5aa
|
true, thanks |
fe2b5aa
to
b25bfa1
Compare
Oh type in title |
For mark, fixes #4530 |
b25bfa1
to
5031c0b
Compare
4f0b049
to
5e5d4dd
Compare
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.
LGTM with minor change
jerry-core/jrt/jrt.h
Outdated
#else /* !defined(__clang__) && !defined(__GNUC__) */ | ||
/* On GCC 10.x this version also works. */ | ||
#define JERRY_BLOCK_TAIL_CALL_OPTIMIZATION() \ | ||
do { JERRY_CONTEXT (status_flags) |= ECMA_STATUS_API_AVAILABLE; } while (0) |
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 am not sure this syntax is allowed even in macros
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.
Could you please elaborate? What do you mean?
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.
newlines
do \
{ \
... \
} \
while (0)
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... true. I've updated the PR. thx!
3f6ecf0
to
3881c07
Compare
3881c07
to
227f0fd
Compare
227f0fd
to
7ff8580
Compare
7ff8580
to
7665e2c
Compare
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.
LGTM
In some parts of Proxy internal methods the compiler can do a bit of tail call optimalization which would be ok, but the current stack limit check framework in Jerry uses the stack pointer to calculate the stack depth. This way of stack depth calculation is affected by the tail call optimalization (as the stack does not increase). By disabling the tail call optimalization at given points the stack limit calculation will work as expected. This causes a bit of stack overhead, but the Proxy in it self is a fairly big chunk of code and this stack limit would only be relevant if the Proxy already does recusion which already very edge case. The stack limit (--stack-limit=..) should be enabled to correctly report such stack depth errors. JerryScript-DCO-1.0-Signed-off-by: Peter Gal [email protected]
7665e2c
to
1e164a6
Compare
In some parts of Proxy internal methods the compiler can do a bit of
tail call optimalization which would be ok, but the current stack limit
check framework in Jerry uses the stack pointer to calculate the stack depth.
This way of stack depth calculation is affected by the tail call optimalization
(as the stack does not increase).
By disabling the tail call optimalization at given points the stack limit calculation
will work as expected. This causes a bit of stack overhead, but the Proxy in it self
is a fairly big chunk of code and this stack limit would only be relevant if the Proxy
already does recursion which already very edge case.
The stack limit (--stack-limit=..) should be enabled to correctly report such stack
depth errors.