Reviewers: Mads Ager,

Description:
Merge r7635 "Initialize ThreadLocalTop" to 3.2.

BUG=http://crbug.com/79393
[email protected]

Please review this at http://codereview.chromium.org/6874025/

SVN Base: http://v8.googlecode.com/svn/branches/3.2/

Affected files:
  M     src/isolate.h
  M     src/top.cc
  M     src/version.cc


Index: src/isolate.h
===================================================================
--- src/isolate.h       (revision 7636)
+++ src/isolate.h       (working copy)
@@ -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_;
 };

Index: src/top.cc
===================================================================
--- src/top.cc  (revision 7636)
+++ src/top.cc  (working copy)
@@ -45,21 +45,17 @@
 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());
+  simulator_ = NULL;
 #endif
-#endif
 #ifdef ENABLE_LOGGING_AND_PROFILING
   js_entry_sp_ = NULL;
   external_callback_ = NULL;
@@ -69,7 +65,7 @@
 #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;
@@ -77,6 +73,24 @@
 }


+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) {
   return isolate_addresses_[id];
 }
Index: src/version.cc
===================================================================
--- src/version.cc      (revision 7636)
+++ src/version.cc      (working copy)
@@ -35,7 +35,7 @@
 #define MAJOR_VERSION     3
 #define MINOR_VERSION     2
 #define BUILD_NUMBER      10
-#define PATCH_LEVEL       1
+#define PATCH_LEVEL       2
 // Use 1 for candidates and 0 otherwise.
 // (Boolean macro values are not supported by all preprocessors.)
 #define IS_CANDIDATE_VERSION 0


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

Reply via email to