OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/isolate.h" | 5 #include "src/isolate.h" |
6 | 6 |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 | 8 |
9 #include <fstream> // NOLINT(readability/streams) | 9 #include <fstream> // NOLINT(readability/streams) |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 1829 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1840 | 1840 |
1841 | 1841 |
1842 void Isolate::TearDown() { | 1842 void Isolate::TearDown() { |
1843 TRACE_ISOLATE(tear_down); | 1843 TRACE_ISOLATE(tear_down); |
1844 | 1844 |
1845 // Temporarily set this isolate as current so that various parts of | 1845 // Temporarily set this isolate as current so that various parts of |
1846 // the isolate can access it in their destructors without having a | 1846 // the isolate can access it in their destructors without having a |
1847 // direct pointer. We don't use Enter/Exit here to avoid | 1847 // direct pointer. We don't use Enter/Exit here to avoid |
1848 // initializing the thread data. | 1848 // initializing the thread data. |
1849 PerIsolateThreadData* saved_data = CurrentPerIsolateThreadData(); | 1849 PerIsolateThreadData* saved_data = CurrentPerIsolateThreadData(); |
1850 Isolate* saved_isolate = UncheckedCurrent(); | 1850 DCHECK(base::NoBarrier_Load(&isolate_key_created_) == 1); |
| 1851 Isolate* saved_isolate = |
| 1852 reinterpret_cast<Isolate*>(base::Thread::GetThreadLocal(isolate_key_)); |
1851 SetIsolateThreadLocals(this, NULL); | 1853 SetIsolateThreadLocals(this, NULL); |
1852 | 1854 |
1853 Deinit(); | 1855 Deinit(); |
1854 | 1856 |
1855 { | 1857 { |
1856 base::LockGuard<base::Mutex> lock_guard(thread_data_table_mutex_.Pointer()); | 1858 base::LockGuard<base::Mutex> lock_guard(thread_data_table_mutex_.Pointer()); |
1857 thread_data_table_->RemoveAllThreads(this); | 1859 thread_data_table_->RemoveAllThreads(this); |
1858 } | 1860 } |
1859 | 1861 |
1860 delete this; | 1862 delete this; |
(...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2840 // Then check whether this scope intercepts. | 2842 // Then check whether this scope intercepts. |
2841 if ((flag & intercept_mask_)) { | 2843 if ((flag & intercept_mask_)) { |
2842 intercepted_flags_ |= flag; | 2844 intercepted_flags_ |= flag; |
2843 return true; | 2845 return true; |
2844 } | 2846 } |
2845 return false; | 2847 return false; |
2846 } | 2848 } |
2847 | 2849 |
2848 } // namespace internal | 2850 } // namespace internal |
2849 } // namespace v8 | 2851 } // namespace v8 |
OLD | NEW |