| OLD | NEW |
| 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 "src/allocation.h" | 8 #include "src/allocation.h" |
| 9 #include "src/base/platform/platform.h" | 9 #include "src/base/platform/platform.h" |
| 10 #include "src/utils.h" | 10 #include "src/utils.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 DEFERRED_HANDLE_DEREFERENCE_ASSERT, | 21 DEFERRED_HANDLE_DEREFERENCE_ASSERT, |
| 22 CODE_DEPENDENCY_CHANGE_ASSERT, | 22 CODE_DEPENDENCY_CHANGE_ASSERT, |
| 23 LAST_PER_THREAD_ASSERT_TYPE | 23 LAST_PER_THREAD_ASSERT_TYPE |
| 24 }; | 24 }; |
| 25 | 25 |
| 26 | 26 |
| 27 enum PerIsolateAssertType { | 27 enum PerIsolateAssertType { |
| 28 JAVASCRIPT_EXECUTION_ASSERT, | 28 JAVASCRIPT_EXECUTION_ASSERT, |
| 29 JAVASCRIPT_EXECUTION_THROWS, | 29 JAVASCRIPT_EXECUTION_THROWS, |
| 30 ALLOCATION_FAILURE_ASSERT, | 30 ALLOCATION_FAILURE_ASSERT, |
| 31 DEOPTIMIZATION_ASSERT | 31 DEOPTIMIZATION_ASSERT, |
| 32 COMPILATION_ASSERT |
| 32 }; | 33 }; |
| 33 | 34 |
| 34 | 35 |
| 35 class PerThreadAssertData { | 36 class PerThreadAssertData { |
| 36 public: | 37 public: |
| 37 PerThreadAssertData() : nesting_level_(0) { | 38 PerThreadAssertData() : nesting_level_(0) { |
| 38 for (int i = 0; i < LAST_PER_THREAD_ASSERT_TYPE; i++) { | 39 for (int i = 0; i < LAST_PER_THREAD_ASSERT_TYPE; i++) { |
| 39 assert_states_[i] = true; | 40 assert_states_[i] = true; |
| 40 } | 41 } |
| 41 } | 42 } |
| (...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 247 AllowAllocationFailure; | 248 AllowAllocationFailure; |
| 248 | 249 |
| 249 // Scope to document where we do not expect deoptimization. | 250 // Scope to document where we do not expect deoptimization. |
| 250 typedef PerIsolateAssertScopeDebugOnly<DEOPTIMIZATION_ASSERT, false> | 251 typedef PerIsolateAssertScopeDebugOnly<DEOPTIMIZATION_ASSERT, false> |
| 251 DisallowDeoptimization; | 252 DisallowDeoptimization; |
| 252 | 253 |
| 253 // Scope to introduce an exception to DisallowDeoptimization. | 254 // Scope to introduce an exception to DisallowDeoptimization. |
| 254 typedef PerIsolateAssertScopeDebugOnly<DEOPTIMIZATION_ASSERT, true> | 255 typedef PerIsolateAssertScopeDebugOnly<DEOPTIMIZATION_ASSERT, true> |
| 255 AllowDeoptimization; | 256 AllowDeoptimization; |
| 256 | 257 |
| 258 // Scope to document where we do not expect deoptimization. |
| 259 typedef PerIsolateAssertScopeDebugOnly<COMPILATION_ASSERT, false> |
| 260 DisallowCompilation; |
| 261 |
| 262 // Scope to introduce an exception to DisallowDeoptimization. |
| 263 typedef PerIsolateAssertScopeDebugOnly<COMPILATION_ASSERT, true> |
| 264 AllowCompilation; |
| 257 } } // namespace v8::internal | 265 } } // namespace v8::internal |
| 258 | 266 |
| 259 #endif // V8_ASSERT_SCOPE_H_ | 267 #endif // V8_ASSERT_SCOPE_H_ |
| OLD | NEW |