Index: src/top.cc |
diff --git a/src/top.cc b/src/top.cc |
index 899dfbe252c47e06750ccb17e8135fd4d6550c01..f44de7ad68d41c308f27fa9674925d91d08294ad 100644 |
--- a/src/top.cc |
+++ b/src/top.cc |
@@ -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,7 +65,7 @@ void ThreadLocalTop::Initialize() { |
#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() { |
} |
+void ThreadLocalTop::Initialize() { |
+ InitializeInternal(); |
Søren Thygesen Gjesse
2011/04/15 07:23:57
Do you need to call InitializeInternal() here as w
Vitaly Repeshko
2011/04/15 20:47:56
Yes, because Inititalize is called more than once
|
+#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]; |
} |