Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Unified Diff: src/top.cc

Issue 6862005: Initialize ThreadLocalTop. (Closed)
Patch Set: Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/isolate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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];
}
« no previous file with comments | « src/isolate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698