-
Notifications
You must be signed in to change notification settings - Fork 18
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
clean up interfaces for working with functions and strings #35
Comments
This ticket is a first step towards cleaning up various internal mdb_v8 interfaces. There's a lot that could be done here, but I'm trying to focus on cleanup that's pretty clearly helpful in the short term. (I actually started by developing crisper interfaces for new work, as with #17, and this is the first step that involves improving existing interfaces.) I've polished a decent chunk of this in this branch: The new interfaces are encapsulated in this file: The interesting parts of this interface are implemented in these files: https://github.com/joyent/mdb_v8/blob/6b8cf0aa0b6f2bc4b10b6c63f5d766bcd239274b/src/mdb_v8_string.c You'll find that there are some pretty strong conventions about how these interfaces look. Because I want to do this incrementally rather than trying to rewrite mdb_v8, not everything has a new-style interface, nor have all the consumers been updated. But several consumers have been updated, like dcmd_v8str() and dcmd_v8function(). The latter used to look like this: That code has direct knowledge of the structure of V8 functions -- knowledge that's duplicated in other dcmds like which I think is a lot cleaner. |
It's a big diff and without having used these new interfaces myself, it's difficult to challenge them, but I can see clear improvements over what exists right now, and couldn't think of any red flag. I like where this is going. |
Thanks for taking a look. |
Last call for major feedback on this change. (I'll still be happy to get feedback after this, but I'm going to land the change into master.) |
It took me a long time to do enough regression-testing that I'm satisfied with the change, but I feel it's ready to integrate now. On the plus side, my testing found several bugs that I fixed (mostly not regressions). I'm pretty confident that this is a net step forward, but @misterdjules, please let me know if you want to take another look before I integrate it. The delta from #master is here: Here's the delta from the last review I sent out (on 10/8): The real work from the last time I sent this out includes:
|
As part of the general internal interface clean-up, this ticket covers cleaning up the function-specific interfaces (like getting the name for a function, source code, instructions, and the like).
The text was updated successfully, but these errors were encountered: