I am worried that we could accidentally dereference the handles from the other
thread and it would work most of the time and occasionally crash.  I would
suggest that in debug mode we could 'pickle' the object pointers in the arrays by flipping a bit. Then they will cause a crash if they are accessed. On GC they need to be unpickled and repickled and of course when we are back on the
main thread we need to unpickle them.

The plan is to first _allow_ dereferencing Handles from the compiler
thread (and lock out the phases of the GC that move stuff).  I'm
trying to get an estimate on how much work it will be to not deref
Handles in crankshaft altogether, and if that seems doable what you
said can be implemented.  Alternatively we could, in debug mode, have
Handle::operator* check a TLS variable and assert the deref doesn't
happen in the compiler thread.

This should be named_like_this, but I wonder whether this templatization is
worth it.  Do you have benchmark runs showing that just testing
last_block_before_compilation_ is too slow?

No, but this looked like a small, local change.  :) I'll revert it,
and add it back if this seems to slow things down.

http://codereview.chromium.org/10640012/

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to