whats the difference between v8::Handle and v8::Local ?

1,494 views
Skip to first unread message

David Xanatos

unread,
Mar 10, 2015, 3:32:46 AM3/10/15
to v8-u...@googlegroups.com
whats the difference between v8::Handle and v8::Local ?

Sven Panne

unread,
Mar 10, 2015, 3:54:51 AM3/10/15
to v8-u...@googlegroups.com
On Tue, Mar 10, 2015 at 8:32 AM, David Xanatos <xanato...@gmail.com> wrote:
whats the difference between v8::Handle and v8::Local ?

"Handle" is a historical artifact and will go away completely soon: There will be only v8::Local (normal implicitly handled references to JavaScript object) and v8::Global (explicitly handled persistent references, currently known as "UniquePersistent", but this name will go away, too).

All those handle-related changes in the external API are a bit unfortunate, but it simply took us some time to make the API correct and more or less fool-proof.

David Xanatos

unread,
Mar 10, 2015, 3:58:05 AM3/10/15
to v8-u...@googlegroups.com
So I should use v8::Local everyware where i now have v8::Handle ok

and what about v8::Persistent is that repalced by v8::Global?

David Xanatos

unread,
Mar 10, 2015, 4:01:13 AM3/10/15
to v8-u...@googlegroups.com
PS: do i still need HandleScope if working with v8::Local ?

Sven Panne

unread,
Mar 10, 2015, 4:28:10 AM3/10/15
to v8-u...@googlegroups.com
On Tue, Mar 10, 2015 at 8:58 AM, David Xanatos <xanato...@gmail.com> wrote:
[...] and what about v8::Persistent is that repalced by v8::Global?

If you're working with a bleeding edge v8, you should use v8::Global already.

Sven Panne

unread,
Mar 10, 2015, 4:28:23 AM3/10/15
to v8-u...@googlegroups.com
On Tue, Mar 10, 2015 at 9:01 AM, David Xanatos <xanato...@gmail.com> wrote:
PS: do i still need HandleScope if working with v8::Local ?

Yes, nothing changed regarding this.

David Xanatos

unread,
Mar 10, 2015, 4:34:49 AM3/10/15
to v8-u...@googlegroups.com

Is v8-git-mirror-4.3.26.zip bleeding edge or is that a stabile build?

Sven Panne

unread,
Mar 10, 2015, 4:56:23 AM3/10/15
to v8-u...@googlegroups.com
On Tue, Mar 10, 2015 at 9:34 AM, David Xanatos <xanato...@gmail.com> wrote:
Is v8-git-mirror-4.3.26.zip bleeding edge or is that a stabile build?

It's an almost bleeding edge vesion, see https://github.com/v8/v8-git-mirror/branches: It's currently 30 commits behind.

David Xanatos

unread,
Mar 10, 2015, 2:26:51 PM3/10/15
to v8-u...@googlegroups.com

ok, and which version would be the last stabile one?

Shezan Baig

unread,
Sep 4, 2015, 9:27:08 AM9/4/15
to v8-users
The V8 embedder's guide [1] still mentioned using v8::UniquePersistent or v8::Persistent.  Should that be updated to suggest using v8::Global instead?

[1] https://developers.google.com/v8/embed#handles-and-garbage-collection

Michael Hablich

unread,
Sep 9, 2015, 6:31:59 AM9/9/15
to v8-users
Unfortunately the transition is not complete yet.
Reply all
Reply to author
Forward
0 new messages