Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 101
src: fix context inspection for V8 6.8#201
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
Uh oh!
There was an error while loading. Please reload this page.
Conversation
mmarchini commented May 22, 2018 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
mmarchini commented May 22, 2018
There's still one problem though: since We could either:
|
joyeecheung commented Jun 5, 2018
Maybe we can do (b by default and add an option for (a? |
mmarchini commented Jul 4, 2018 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
Ok, I've been reading further on why the closure field was removed (v8/v8:7066) and turns out it was a memory leak vector, especially in IIFE. With the changes on V8 the closure might be garbage collected, thus I don't think we should try to guess it or add new post-mortem metadata to V8 to inspect it. IMO we should just replace the closure with scope_info in the inspect for V6.8+. The caller can be easily spotted with |
mmarchini commented Jul 4, 2018
Before 6.8, inspecting functions look like this: After 6.8 it would look like this: |
mmarchini commented Jul 12, 2018
@joyeecheung any thoughts on #201 (comment)? |
joyeecheung commented Jul 12, 2018 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
@mmarchini Displaying scope info is better than nothing, but does that mean now we have no way of knowing where (in the souce code) the context is coming from if we are simply inspecting a context? |
joyeecheung commented Jul 12, 2018
Looks like there are still |
mmarchini commented Jul 26, 2018
@joyeecheung yeah, we can get the function name from a ScopeInfo, but not the Script. I'm working on this, #211 and #195, and so far this is the most detailed output I could get with 6.8 when inspecting a function: I think I'll move forward with this approach and we can try to improve the situation later, maybe using some heuristic to try to find the script for the ScopeInfo. |
mmarchini commented Aug 2, 2018
I created a POC to inspect Context objects, and I think this would be enough to cover the current use case (we wouldn't know the script and line where the closure was defined, but this information can be inferred from the name + script of the current function). Here's what we would do today to inspect the current function and the closure: https://asciinema.org/a/BPvhOsMdv3aMRv1E5nYXWOdjp Here is the proposed solution (instead of inspecting the closure, inspect the previous context to find out which variables can be accessed in the current function): https://asciinema.org/a/pvS0iL81vtbjhZUijMMUpqW1j Am I missing any use cases? If this solution is acceptable I'll update our tests to fit it and add some more tests. |
V8 6.8 replaces Closure inside Context with ScopeInfo. Those are minimal changes to adopt llnode to the new behavior. Ref: https://chromium-review.googlesource.com/#/c/785151/Fixes: nodejs#193
This patch teaches llnode how to inspect Context objects. This is useful to inspect context variables. Fix: nodejs#211
mmarchini commented Aug 20, 2018
CI is happy with the latest changes 😄 P.S.: The last commit also fixes #211 |
mmarchini commented Aug 29, 2018
Ping @joyeecheung |
This comment was marked as off-topic.
This comment was marked as off-topic.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
V8 6.8 replaces Closure inside Context with ScopeInfo. Those are minimal changes to adopt llnode to the new behavior. Ref: https://chromium-review.googlesource.com/#/c/785151/Fixes: #193 PR-URL: #201 Reviewed-By: Joyee Cheung <[email protected]>
This patch teaches llnode how to inspect Context objects. This is useful to inspect context variables. PR-URL: #201Fixes: #211 Reviewed-By: Joyee Cheung <[email protected]>
mmarchini commented Aug 31, 2018
Landed in d348eff...d5e0ada. Thanks for the feedback! |
V8 6.8 replaces Closure inside Context with ScopeInfo. Those are minimal changes to adopt llnode to the new behavior. Ref: https://chromium-review.googlesource.com/#/c/785151/Fixes: nodejs#193 PR-URL: nodejs#201 Reviewed-By: Joyee Cheung <[email protected]>
This patch teaches llnode how to inspect Context objects. This is useful to inspect context variables. PR-URL: nodejs#201Fixes: nodejs#211 Reviewed-By: Joyee Cheung <[email protected]>
V8 6.8 replaces Closure inside Context with ScopeInfo. Those are minimal changes to adopt llnode to the new behavior. Ref: https://chromium-review.googlesource.com/#/c/785151/Fixes: nodejs#193 PR-URL: nodejs#201 Reviewed-By: Joyee Cheung <[email protected]>
This patch teaches llnode how to inspect Context objects. This is useful to inspect context variables. PR-URL: nodejs#201Fixes: nodejs#211 Reviewed-By: Joyee Cheung <[email protected]>
ETA: July 24th (after V8 6.8 lands on nodejs/node)
V8 6.8 replaces Closure inside Context with ScopeInfo. Those are minimal
changes to adopt llnode to the new behavior.
Ref: chromium-review.googlesource.com/#/c/785151
Fixes: #193