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

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

Issue 769263002: Add support for enabling DCHECKs in release mode (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 6 years 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
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 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 class DataBit; 63 class DataBit;
64 64
65 Isolate* isolate_; 65 Isolate* isolate_;
66 uint32_t old_data_; 66 uint32_t old_data_;
67 67
68 DISALLOW_COPY_AND_ASSIGN(PerIsolateAssertScope); 68 DISALLOW_COPY_AND_ASSIGN(PerIsolateAssertScope);
69 }; 69 };
70 70
71 71
72 template <PerThreadAssertType type, bool allow> 72 template <PerThreadAssertType type, bool allow>
73 #ifdef DEBUG 73 #if DCHECK_IS_ON
74 class PerThreadAssertScopeDebugOnly : public 74 class PerThreadAssertScopeDebugOnly : public PerThreadAssertScope<type, allow> {
75 PerThreadAssertScope<type, allow> {
76 #else 75 #else
77 class PerThreadAssertScopeDebugOnly { 76 class PerThreadAssertScopeDebugOnly {
78 public: 77 public:
79 PerThreadAssertScopeDebugOnly() { } 78 PerThreadAssertScopeDebugOnly() { }
80 #endif 79 #endif
81 }; 80 };
82 81
83 82
84 template <PerIsolateAssertType type, bool allow> 83 template <PerIsolateAssertType type, bool allow>
85 #ifdef DEBUG 84 #if DCHECK_IS_ON
86 class PerIsolateAssertScopeDebugOnly : public 85 class PerIsolateAssertScopeDebugOnly
87 PerIsolateAssertScope<type, allow> { 86 : public PerIsolateAssertScope<type, allow> {
88 public: 87 public:
89 explicit PerIsolateAssertScopeDebugOnly(Isolate* isolate) 88 explicit PerIsolateAssertScopeDebugOnly(Isolate* isolate)
90 : PerIsolateAssertScope<type, allow>(isolate) { } 89 : PerIsolateAssertScope<type, allow>(isolate) { }
91 #else 90 #else
92 class PerIsolateAssertScopeDebugOnly { 91 class PerIsolateAssertScopeDebugOnly {
93 public: 92 public:
94 explicit PerIsolateAssertScopeDebugOnly(Isolate* isolate) { } 93 explicit PerIsolateAssertScopeDebugOnly(Isolate* isolate) { }
95 #endif 94 #endif
96 }; 95 };
97 96
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 // Scope to document where we do not expect deoptimization. 174 // Scope to document where we do not expect deoptimization.
176 typedef PerIsolateAssertScopeDebugOnly<COMPILATION_ASSERT, false> 175 typedef PerIsolateAssertScopeDebugOnly<COMPILATION_ASSERT, false>
177 DisallowCompilation; 176 DisallowCompilation;
178 177
179 // Scope to introduce an exception to DisallowDeoptimization. 178 // Scope to introduce an exception to DisallowDeoptimization.
180 typedef PerIsolateAssertScopeDebugOnly<COMPILATION_ASSERT, true> 179 typedef PerIsolateAssertScopeDebugOnly<COMPILATION_ASSERT, true>
181 AllowCompilation; 180 AllowCompilation;
182 } } // namespace v8::internal 181 } } // namespace v8::internal
183 182
184 #endif // V8_ASSERT_SCOPE_H_ 183 #endif // V8_ASSERT_SCOPE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698