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

Side by Side Diff: src/assert-scope.h

Issue 2360983002: Enable component builds for fuzzers (Closed)
Patch Set: Rebase Created 4 years, 2 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
« no previous file with comments | « BUILD.gn ('k') | src/contexts.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 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 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 #ifndef V8_ASSERT_SCOPE_H_ 5 #ifndef V8_ASSERT_SCOPE_H_
6 #define V8_ASSERT_SCOPE_H_ 6 #define V8_ASSERT_SCOPE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 #include "src/base/macros.h" 9 #include "src/base/macros.h"
10 #include "src/globals.h"
10 11
11 namespace v8 { 12 namespace v8 {
12 namespace internal { 13 namespace internal {
13 14
14 // Forward declarations. 15 // Forward declarations.
15 class Isolate; 16 class Isolate;
16 class PerThreadAssertData; 17 class PerThreadAssertData;
17 18
18 19
19 enum PerThreadAssertType { 20 enum PerThreadAssertType {
20 HEAP_ALLOCATION_ASSERT, 21 HEAP_ALLOCATION_ASSERT,
21 HANDLE_ALLOCATION_ASSERT, 22 HANDLE_ALLOCATION_ASSERT,
22 HANDLE_DEREFERENCE_ASSERT, 23 HANDLE_DEREFERENCE_ASSERT,
23 DEFERRED_HANDLE_DEREFERENCE_ASSERT, 24 DEFERRED_HANDLE_DEREFERENCE_ASSERT,
24 CODE_DEPENDENCY_CHANGE_ASSERT, 25 CODE_DEPENDENCY_CHANGE_ASSERT,
25 LAST_PER_THREAD_ASSERT_TYPE 26 LAST_PER_THREAD_ASSERT_TYPE
26 }; 27 };
27 28
28 29
29 enum PerIsolateAssertType { 30 enum PerIsolateAssertType {
30 JAVASCRIPT_EXECUTION_ASSERT, 31 JAVASCRIPT_EXECUTION_ASSERT,
31 JAVASCRIPT_EXECUTION_THROWS, 32 JAVASCRIPT_EXECUTION_THROWS,
32 DEOPTIMIZATION_ASSERT, 33 DEOPTIMIZATION_ASSERT,
33 COMPILATION_ASSERT 34 COMPILATION_ASSERT
34 }; 35 };
35 36
36
37 template <PerThreadAssertType kType, bool kAllow> 37 template <PerThreadAssertType kType, bool kAllow>
38 class PerThreadAssertScope { 38 class PerThreadAssertScope {
39 public: 39 public:
40 PerThreadAssertScope(); 40 V8_EXPORT_PRIVATE PerThreadAssertScope();
41 ~PerThreadAssertScope(); 41 V8_EXPORT_PRIVATE ~PerThreadAssertScope();
42 42
43 static bool IsAllowed(); 43 V8_EXPORT_PRIVATE static bool IsAllowed();
44 44
45 private: 45 private:
46 PerThreadAssertData* data_; 46 PerThreadAssertData* data_;
47 bool old_state_; 47 bool old_state_;
48 48
49 DISALLOW_COPY_AND_ASSIGN(PerThreadAssertScope); 49 DISALLOW_COPY_AND_ASSIGN(PerThreadAssertScope);
50 }; 50 };
51 51
52 52
53 template <PerIsolateAssertType type, bool allow> 53 template <PerIsolateAssertType type, bool allow>
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
167 typedef PerIsolateAssertScopeDebugOnly<COMPILATION_ASSERT, false> 167 typedef PerIsolateAssertScopeDebugOnly<COMPILATION_ASSERT, false>
168 DisallowCompilation; 168 DisallowCompilation;
169 169
170 // Scope to introduce an exception to DisallowDeoptimization. 170 // Scope to introduce an exception to DisallowDeoptimization.
171 typedef PerIsolateAssertScopeDebugOnly<COMPILATION_ASSERT, true> 171 typedef PerIsolateAssertScopeDebugOnly<COMPILATION_ASSERT, true>
172 AllowCompilation; 172 AllowCompilation;
173 } // namespace internal 173 } // namespace internal
174 } // namespace v8 174 } // namespace v8
175 175
176 #endif // V8_ASSERT_SCOPE_H_ 176 #endif // V8_ASSERT_SCOPE_H_
OLDNEW
« no previous file with comments | « BUILD.gn ('k') | src/contexts.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698