OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/assert-scope.h" | 5 #include "src/assert-scope.h" |
6 | 6 |
7 #include "src/base/lazy-instance.h" | 7 #include "src/base/lazy-instance.h" |
8 #include "src/base/platform/platform.h" | 8 #include "src/base/platform/platform.h" |
9 #include "src/isolate-inl.h" | 9 #include "src/isolate-inl.h" |
10 #include "src/utils.h" | 10 #include "src/utils.h" |
11 | 11 |
12 namespace v8 { | 12 namespace v8 { |
13 namespace internal { | 13 namespace internal { |
14 | 14 |
15 namespace { | 15 namespace { |
16 | 16 |
17 struct PerThreadAssertKeyConstructTrait FINAL { | 17 struct PerThreadAssertKeyConstructTrait final { |
18 static void Construct(base::Thread::LocalStorageKey* key) { | 18 static void Construct(base::Thread::LocalStorageKey* key) { |
19 *key = base::Thread::CreateThreadLocalKey(); | 19 *key = base::Thread::CreateThreadLocalKey(); |
20 } | 20 } |
21 }; | 21 }; |
22 | 22 |
23 | 23 |
24 typedef base::LazyStaticInstance<base::Thread::LocalStorageKey, | 24 typedef base::LazyStaticInstance<base::Thread::LocalStorageKey, |
25 PerThreadAssertKeyConstructTrait>::type | 25 PerThreadAssertKeyConstructTrait>::type |
26 PerThreadAssertKey; | 26 PerThreadAssertKey; |
27 | 27 |
28 | 28 |
29 PerThreadAssertKey kPerThreadAssertKey; | 29 PerThreadAssertKey kPerThreadAssertKey; |
30 | 30 |
31 } // namespace | 31 } // namespace |
32 | 32 |
33 | 33 |
34 class PerThreadAssertData FINAL { | 34 class PerThreadAssertData final { |
35 public: | 35 public: |
36 PerThreadAssertData() : nesting_level_(0) { | 36 PerThreadAssertData() : nesting_level_(0) { |
37 for (int i = 0; i < LAST_PER_THREAD_ASSERT_TYPE; i++) { | 37 for (int i = 0; i < LAST_PER_THREAD_ASSERT_TYPE; i++) { |
38 assert_states_[i] = true; | 38 assert_states_[i] = true; |
39 } | 39 } |
40 } | 40 } |
41 | 41 |
42 ~PerThreadAssertData() { | 42 ~PerThreadAssertData() { |
43 for (int i = 0; i < LAST_PER_THREAD_ASSERT_TYPE; ++i) { | 43 for (int i = 0; i < LAST_PER_THREAD_ASSERT_TYPE; ++i) { |
44 DCHECK(assert_states_[i]); | 44 DCHECK(assert_states_[i]); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 template class PerIsolateAssertScope<JAVASCRIPT_EXECUTION_THROWS, true>; | 146 template class PerIsolateAssertScope<JAVASCRIPT_EXECUTION_THROWS, true>; |
147 template class PerIsolateAssertScope<ALLOCATION_FAILURE_ASSERT, false>; | 147 template class PerIsolateAssertScope<ALLOCATION_FAILURE_ASSERT, false>; |
148 template class PerIsolateAssertScope<ALLOCATION_FAILURE_ASSERT, true>; | 148 template class PerIsolateAssertScope<ALLOCATION_FAILURE_ASSERT, true>; |
149 template class PerIsolateAssertScope<DEOPTIMIZATION_ASSERT, false>; | 149 template class PerIsolateAssertScope<DEOPTIMIZATION_ASSERT, false>; |
150 template class PerIsolateAssertScope<DEOPTIMIZATION_ASSERT, true>; | 150 template class PerIsolateAssertScope<DEOPTIMIZATION_ASSERT, true>; |
151 template class PerIsolateAssertScope<COMPILATION_ASSERT, false>; | 151 template class PerIsolateAssertScope<COMPILATION_ASSERT, false>; |
152 template class PerIsolateAssertScope<COMPILATION_ASSERT, true>; | 152 template class PerIsolateAssertScope<COMPILATION_ASSERT, true>; |
153 | 153 |
154 } // namespace internal | 154 } // namespace internal |
155 } // namespace v8 | 155 } // namespace v8 |
OLD | NEW |