Skip to content
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

Make multiple contexts possible #1

Open
joskuijpers opened this issue Mar 13, 2014 · 1 comment
Open

Make multiple contexts possible #1

joskuijpers opened this issue Mar 13, 2014 · 1 comment

Comments

@joskuijpers
Copy link
Owner

The API of L8Framework could be changed to match even more like JavaScriptCore:

L8Runtime now wraps both v8::Context and v8::Isolate. It could be made into L8Context, wrapping v8::Context in a specific isolate, namely L8VirtualMachine, which wraps v8::Isolate.

Managed values only use an isolate so they go into L8VirtualMachine. L8Value is bound to a context, so -[valueWithXX:] changes into -[valueWithXX:inContext:], just like JSC.

If there is interest in this, it can be build in a new branch. It is however not backward compatible. (it can be, but that makes it very messy).

joskuijpers added a commit that referenced this issue Mar 17, 2014
…\n\nAdd L8VirtualMachine for wrapping v8::Isolate, #1.\nMove around code to integrate the virtual machine.\nRequire Context for new L8Values, #1.\nRemove all avoidable uses of Isolate::GetCurrent(), +[L8Runtime currentRuntime] and GetCurrentContext() for #1, #5. This needed a lot of code to be moved around.\nUse modern ObjC suntax: make use of instancetype.\nMake some code cleaner and more guideline-conforming, #4.
joskuijpers added a commit that referenced this issue Mar 18, 2014
…ntContext() in callbacks.

Because of the strong reference to the WrapperMap, and the WrapperMap containing a strong reference to the Runtime, plus the strong reference in the v8::Context, a Runtime would never deallocate. #1.
The use of GetCurrentContext() on the Isolate is correct, as in callbacks, the current context is always the context the callback came from. #5. (v8-users mailing list)
@joskuijpers
Copy link
Owner Author

It should work, but I have not tested it yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant