I agree and I've tried to use the form of the Handle constructor that you
mentioned. Unfortunately, it doesn't seem to work - in most cases, compiler
picks the generic version rather then the one you created for HeapObject
specifically.
Try to add ASSERT(!obj->IsHeapObject()); into generic one to see what I
mean.
It'll fire quite a lot.
I tried to figure it out but apparently my template-fu is weak. I wonder if
you
have an idea how to fix it.
A bit unrelated note - if we do have a separate constructor for HeapObjects,
we'll need to decide at each point which one to use, and it is not very easy
decision (need to run perf tests that exercise the code path?) This may
translate in the future to v8 devs not sure which form to use. When isolates
land in the trunk, there will be some new "rule of thumb" for everybody.At
this
point it could be better to just have one constructor and bite the bullet
and
convert all of them into version that takes isolate. I'm trying to build up
a
case for not having Handle<T>::Handle(HeapObject*) :-)
http://codereview.chromium.org/3770015/show
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev