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

Side by Side Diff: src/isolate.cc

Issue 261953002: Fix for 3303 MultithreadedParallelIsolates has a race condition. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed ICache arm simulator issue. Created 6 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/isolate.h ('k') | src/objects.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stdlib.h> 5 #include <stdlib.h>
6 6
7 #include "v8.h" 7 #include "v8.h"
8 8
9 #include "ast.h" 9 #include "ast.h"
10 #include "bootstrapper.h" 10 #include "bootstrapper.h"
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 Isolate::FindOrAllocatePerThreadDataForThisThread() { 126 Isolate::FindOrAllocatePerThreadDataForThisThread() {
127 ThreadId thread_id = ThreadId::Current(); 127 ThreadId thread_id = ThreadId::Current();
128 PerIsolateThreadData* per_thread = NULL; 128 PerIsolateThreadData* per_thread = NULL;
129 { 129 {
130 LockGuard<Mutex> lock_guard(&process_wide_mutex_); 130 LockGuard<Mutex> lock_guard(&process_wide_mutex_);
131 per_thread = thread_data_table_->Lookup(this, thread_id); 131 per_thread = thread_data_table_->Lookup(this, thread_id);
132 if (per_thread == NULL) { 132 if (per_thread == NULL) {
133 per_thread = new PerIsolateThreadData(this, thread_id); 133 per_thread = new PerIsolateThreadData(this, thread_id);
134 thread_data_table_->Insert(per_thread); 134 thread_data_table_->Insert(per_thread);
135 } 135 }
136 ASSERT(thread_data_table_->Lookup(this, thread_id) == per_thread);
136 } 137 }
137 ASSERT(thread_data_table_->Lookup(this, thread_id) == per_thread);
138 return per_thread; 138 return per_thread;
139 } 139 }
140 140
141 141
142 Isolate::PerIsolateThreadData* Isolate::FindPerThreadDataForThisThread() { 142 Isolate::PerIsolateThreadData* Isolate::FindPerThreadDataForThisThread() {
143 ThreadId thread_id = ThreadId::Current(); 143 ThreadId thread_id = ThreadId::Current();
144 return FindPerThreadDataForThread(thread_id); 144 return FindPerThreadDataForThread(thread_id);
145 } 145 }
146 146
147 147
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after
1419 incomplete_message_(NULL), 1419 incomplete_message_(NULL),
1420 bootstrapper_(NULL), 1420 bootstrapper_(NULL),
1421 runtime_profiler_(NULL), 1421 runtime_profiler_(NULL),
1422 compilation_cache_(NULL), 1422 compilation_cache_(NULL),
1423 counters_(NULL), 1423 counters_(NULL),
1424 code_range_(NULL), 1424 code_range_(NULL),
1425 debugger_initialized_(false), 1425 debugger_initialized_(false),
1426 logger_(NULL), 1426 logger_(NULL),
1427 stats_table_(NULL), 1427 stats_table_(NULL),
1428 stub_cache_(NULL), 1428 stub_cache_(NULL),
1429 code_aging_helper_(NULL),
1429 deoptimizer_data_(NULL), 1430 deoptimizer_data_(NULL),
1430 materialized_object_store_(NULL), 1431 materialized_object_store_(NULL),
1431 capture_stack_trace_for_uncaught_exceptions_(false), 1432 capture_stack_trace_for_uncaught_exceptions_(false),
1432 stack_trace_for_uncaught_exceptions_frame_limit_(0), 1433 stack_trace_for_uncaught_exceptions_frame_limit_(0),
1433 stack_trace_for_uncaught_exceptions_options_(StackTrace::kOverview), 1434 stack_trace_for_uncaught_exceptions_options_(StackTrace::kOverview),
1434 memory_allocator_(NULL), 1435 memory_allocator_(NULL),
1435 keyed_lookup_cache_(NULL), 1436 keyed_lookup_cache_(NULL),
1436 context_slot_cache_(NULL), 1437 context_slot_cache_(NULL),
1437 descriptor_lookup_cache_(NULL), 1438 descriptor_lookup_cache_(NULL),
1438 handle_scope_implementer_(NULL), 1439 handle_scope_implementer_(NULL),
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
1653 1654
1654 delete descriptor_lookup_cache_; 1655 delete descriptor_lookup_cache_;
1655 descriptor_lookup_cache_ = NULL; 1656 descriptor_lookup_cache_ = NULL;
1656 delete context_slot_cache_; 1657 delete context_slot_cache_;
1657 context_slot_cache_ = NULL; 1658 context_slot_cache_ = NULL;
1658 delete keyed_lookup_cache_; 1659 delete keyed_lookup_cache_;
1659 keyed_lookup_cache_ = NULL; 1660 keyed_lookup_cache_ = NULL;
1660 1661
1661 delete stub_cache_; 1662 delete stub_cache_;
1662 stub_cache_ = NULL; 1663 stub_cache_ = NULL;
1664 delete code_aging_helper_;
1665 code_aging_helper_ = NULL;
1663 delete stats_table_; 1666 delete stats_table_;
1664 stats_table_ = NULL; 1667 stats_table_ = NULL;
1665 1668
1666 delete materialized_object_store_; 1669 delete materialized_object_store_;
1667 materialized_object_store_ = NULL; 1670 materialized_object_store_ = NULL;
1668 1671
1669 delete logger_; 1672 delete logger_;
1670 logger_ = NULL; 1673 logger_ = NULL;
1671 1674
1672 delete counters_; 1675 delete counters_;
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
1841 // Enable logging before setting up the heap 1844 // Enable logging before setting up the heap
1842 logger_->SetUp(this); 1845 logger_->SetUp(this);
1843 1846
1844 // Initialize other runtime facilities 1847 // Initialize other runtime facilities
1845 #if defined(USE_SIMULATOR) 1848 #if defined(USE_SIMULATOR)
1846 #if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_MIPS 1849 #if V8_TARGET_ARCH_ARM || V8_TARGET_ARCH_ARM64 || V8_TARGET_ARCH_MIPS
1847 Simulator::Initialize(this); 1850 Simulator::Initialize(this);
1848 #endif 1851 #endif
1849 #endif 1852 #endif
1850 1853
1854 code_aging_helper_ = new CodeAgingHelper();
1855
1851 { // NOLINT 1856 { // NOLINT
1852 // Ensure that the thread has a valid stack guard. The v8::Locker object 1857 // Ensure that the thread has a valid stack guard. The v8::Locker object
1853 // will ensure this too, but we don't have to use lockers if we are only 1858 // will ensure this too, but we don't have to use lockers if we are only
1854 // using one thread. 1859 // using one thread.
1855 ExecutionAccess lock(this); 1860 ExecutionAccess lock(this);
1856 stack_guard_.InitThread(lock); 1861 stack_guard_.InitThread(lock);
1857 } 1862 }
1858 1863
1859 // SetUp the object heap. 1864 // SetUp the object heap.
1860 ASSERT(!heap_.HasBeenSetUp()); 1865 ASSERT(!heap_.HasBeenSetUp());
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
2246 handle_scope_implementer()->IncrementCallDepth(); 2251 handle_scope_implementer()->IncrementCallDepth();
2247 if (run_microtasks) Execution::RunMicrotasks(this); 2252 if (run_microtasks) Execution::RunMicrotasks(this);
2248 for (int i = 0; i < call_completed_callbacks_.length(); i++) { 2253 for (int i = 0; i < call_completed_callbacks_.length(); i++) {
2249 call_completed_callbacks_.at(i)(); 2254 call_completed_callbacks_.at(i)();
2250 } 2255 }
2251 handle_scope_implementer()->DecrementCallDepth(); 2256 handle_scope_implementer()->DecrementCallDepth();
2252 } 2257 }
2253 2258
2254 2259
2255 } } // namespace v8::internal 2260 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/isolate.h ('k') | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698