11 ms·
What's the gist of these supposedly major changes to the V8 APIs?
by jey 13y ago
What's the gist of these supposedly major changes to the V8 APIs?
- mraleph 13y agoIn short it was easy to misuse global v8::Persistent<T>`handles leading to memory corruptions and such. Unfortunately making them safe to use also means making them hard to use directly. Previously they were just interchangeable with normal v8::Local<T> handles for things like calls. https://groups.google.com/d/msg/v8-users/6kSAbnUb-rQ/e-GI0b1ThA4J https://groups.google.com/d/msg/v8-users/6kSAbnUb-rQ/e-GI0b1...
- bradleyjg 13y agoThis seems to be the biggest issue: Changing all callbacks that return Handle<Value> to return void and instead pass the return value in as a parameter.
- mraleph 13y agoThis is actually easy to work around by creating trampolines. Dan Carney creating a small header file with templates to create those trampolines easily: https://github.com/drcarney66/v8-backport https://github.com/drcarney66/v8-backport Amount of typing one needs to do is minimal, I think.
- sgbeal 13y agoThat approach doesn't work (without a lot of effort) with templates at the level cvv8 uses them. There are literally thousands of InvocationCallback instances in the cvv8 tree, most of which are bound via the XTo templates, which run through 4 or 5 layers of metatemplate magic to do their things. It's a bit more complicated than a drop-in replacement can solve unless the drop-in replacement has the same signature AND type name as the old one (and even then it would require more effort than i'm willing to commit to).