Reviewers: Vitaly, Dmitry Titov,

Message:
Bits of this were unexpectedly tricky. Profiling is very much left to future
work.

Description:
[Isolates] Unify TLS, clean up initialization.

This is a followup to http://codereview.chromium.org/2847048/show . Rather than initialize lazily (which would require conditional checks in Isolate::Current),
we endeavor to initialize using a static initializer. This should generally
work; problems would occur when clients try to touch V8 from their own static
initializers (like cctest.cc). Internally we can use
Isolate::EnsureStaticInitialized() to force proper initialization order.
(I believe that the way I've implemented the initialization is threadsafe,
provided that during static initialization new threads are not created
that simultaneously try to call EnsureStaticInitialized().) The data
structure for mapping (threadid,isolate)->thread-local-data is simpler now
and lives under the aegis of the process-wide mutex.

Thread::Thread() now takes an isolate pointer argument; this is the isolate
in which the thread is meant to run. (Passing in null would give the old
semantics.) It is important to make this explicit, especially as we move to
running multiple isolates.


Please review this at http://codereview.chromium.org/2910004/show

SVN Base: http://v8.googlecode.com/svn/branches/experimental/isolates/

Affected files:
  M     src/api.cc
  M     src/cpu-profiler.h
  M     src/cpu-profiler.cc
  M     src/debug-agent.h
  M     src/debug-agent.cc
  M     src/debug.h
  M     src/debug.cc
  M     src/execution.h
  M     src/execution.cc
  M     src/isolate.h
  M     src/isolate.cc
  M     src/log.cc
  M     src/platform-linux.cc
  M     src/platform-macos.cc
  M     src/platform.h
  M     src/serialize.cc
  M     src/v8threads.h
  M     src/v8threads.cc
  M     test/cctest/cctest.h
  M     test/cctest/cctest.cc
  M     test/cctest/test-api.cc
  M     test/cctest/test-circular-queue.cc
  M     test/cctest/test-cpu-profiler.cc
  M     test/cctest/test-debug.cc
  M     test/cctest/test-log.cc
  M     test/cctest/test-sockets.cc
  M     test/cctest/test-thread-termination.cc
  M     test/cctest/test-threads.cc


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

Reply via email to