Commit 0f6f6a0e authored by vitalyr@chromium.org's avatar vitalyr@chromium.org

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

git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@7635 ce2b1a6d-e550-0410-aec6-3dcde31c8c00
parent d637c32e
......@@ -185,6 +185,10 @@ class ThreadId {
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 @@ class ThreadLocalTop BASE_EMBEDDED {
v8::FailedAccessCheckCallback failed_access_check_callback_;
private:
void InitializeInternal();
Address try_catch_handler_address_;
};
......
......@@ -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();
#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];
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment