Revision: 7635 Author: [email protected] Date: Fri Apr 15 13:47:27 2011 Log: Initialize ThreadLocalTop.
ThreadLocalTop used to be static and was zero initialized by the linker. With isolates we have to give it a constructor. BUG=http://crbug.com/79393 Review URL: http://codereview.chromium.org/6862005 http://code.google.com/p/v8/source/detail?r=7635 Modified: /branches/bleeding_edge/src/isolate.h /branches/bleeding_edge/src/top.cc ======================================= --- /branches/bleeding_edge/src/isolate.h Tue Apr 12 01:27:38 2011 +++ /branches/bleeding_edge/src/isolate.h Fri Apr 15 13:47:27 2011 @@ -185,6 +185,10 @@ class ThreadLocalTop BASE_EMBEDDED { public: + // Does early low-level initialization that does not depend on the + // isolate being present. + ThreadLocalTop(); + // Initialize the thread data. void Initialize(); @@ -264,6 +268,8 @@ v8::FailedAccessCheckCallback failed_access_check_callback_; private: + void InitializeInternal(); + Address try_catch_handler_address_; }; ======================================= --- /branches/bleeding_edge/src/top.cc Mon Apr 11 16:46:22 2011 +++ /branches/bleeding_edge/src/top.cc Fri Apr 15 13:47:27 2011 @@ -45,20 +45,16 @@ namespace v8 { namespace internal { -v8::TryCatch* ThreadLocalTop::TryCatchHandler() { - return TRY_CATCH_FROM_ADDRESS(try_catch_handler_address()); +ThreadLocalTop::ThreadLocalTop() { + InitializeInternal(); } -void ThreadLocalTop::Initialize() { +void ThreadLocalTop::InitializeInternal() { c_entry_fp_ = 0; handler_ = 0; #ifdef USE_SIMULATOR -#ifdef V8_TARGET_ARCH_ARM - simulator_ = Simulator::current(Isolate::Current()); -#elif V8_TARGET_ARCH_MIPS - simulator_ = Simulator::current(Isolate::Current()); -#endif + simulator_ = NULL; #endif #ifdef ENABLE_LOGGING_AND_PROFILING js_entry_sp_ = NULL; @@ -69,12 +65,30 @@ #endif try_catch_handler_address_ = NULL; context_ = NULL; - thread_id_ = ThreadId::Current(); + thread_id_ = ThreadId::Invalid(); external_caught_exception_ = false; failed_access_check_callback_ = NULL; save_context_ = NULL; catcher_ = NULL; } + + +void ThreadLocalTop::Initialize() { + InitializeInternal(); +#ifdef USE_SIMULATOR +#ifdef V8_TARGET_ARCH_ARM + simulator_ = Simulator::current(Isolate::Current()); +#elif V8_TARGET_ARCH_MIPS + simulator_ = Simulator::current(Isolate::Current()); +#endif +#endif + thread_id_ = ThreadId::Current(); +} + + +v8::TryCatch* ThreadLocalTop::TryCatchHandler() { + return TRY_CATCH_FROM_ADDRESS(try_catch_handler_address()); +} Address Isolate::get_address_from_id(Isolate::AddressId id) { -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
