-
Notifications
You must be signed in to change notification settings - Fork 34
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
N-APIs to get information for JS function objects #295
Comments
No opinion from anyone? |
It sounds like this is inherently v8 functionality (as opposed to general JS functionality) that you want here, which I don't think is a good fit for N-API. What is it that you want to do with this information? It sounds like you are trying to map from text obtained from a stack trace back to the actual function object? |
Agree that this is not general JS but the functionality itself is most likely in any JS-VM. I did a fast check with Node Chakra and found that call stacks there use also inferred names for anonymous functions - but different ones. I try to provide some more info on what we do now via V8 APIs; hope it becomes more clear. Maybe I have a misunderstanding on what NAPI should provide:
(1) is clear but not sure about (2). As long as it is ensured that VM ABIs are stable across at least one major NodeJS version I'm fine with using these APIs directly. But once ABI may change within a major node version it would imply to either recompile always or provide binaries for every patch version which would be a pain. Is it planned to keep VM ABI stability even N-API gets out of experimental? |
I believe the VM ABI should be stable within a major release (ie there are no changes planned on this front due to N-API). I do think that we want commonly used functions to be part of N-API, but those need to be generic enough so that they can be implemented across platforms. @aruneshchandra, @hashseed do you have input on what a generic api might be to match functions to entries in a stack trace? |
I'm going to close this as there has been no discussion for quite some time. @Flarna if this is still an issue I'd suggest opening an issue in the nodejs/node repo. Closing. Please let us know if you think that was not the right thing to do. |
As of now we stick on these v8 APIs and a few more others. It's not a problem as of now as we still have the ABI guarantee with a major nodejs version. |
In our module we use following v8 Apis to get more details of function objects:
Not 100% sure but maybe
v8::Function::GetName()
is available viaFunction#name
in JS but the others are not available to my knowledge.We use/need this info as this is actually what v8 uses internally during creation of callstacks and we need a mechanism to actually map callstacks created at one place to real functions.
Is is planned/possible to extend NAPI to offer above APIs?
The text was updated successfully, but these errors were encountered: