| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 HANDLE_DEREFERENCE_ASSERT, | 43 HANDLE_DEREFERENCE_ASSERT, |
| 44 DEFERRED_HANDLE_DEREFERENCE_ASSERT, | 44 DEFERRED_HANDLE_DEREFERENCE_ASSERT, |
| 45 CODE_DEPENDENCY_CHANGE_ASSERT, | 45 CODE_DEPENDENCY_CHANGE_ASSERT, |
| 46 LAST_PER_THREAD_ASSERT_TYPE | 46 LAST_PER_THREAD_ASSERT_TYPE |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 | 49 |
| 50 enum PerIsolateAssertType { | 50 enum PerIsolateAssertType { |
| 51 JAVASCRIPT_EXECUTION_ASSERT, | 51 JAVASCRIPT_EXECUTION_ASSERT, |
| 52 JAVASCRIPT_EXECUTION_THROWS, | 52 JAVASCRIPT_EXECUTION_THROWS, |
| 53 ALLOCATION_FAILURE_ASSERT | 53 ALLOCATION_FAILURE_ASSERT, |
| 54 DEOPTIMIZATION_ASSERT |
| 54 }; | 55 }; |
| 55 | 56 |
| 56 | 57 |
| 57 class PerThreadAssertData { | 58 class PerThreadAssertData { |
| 58 public: | 59 public: |
| 59 PerThreadAssertData() : nesting_level_(0) { | 60 PerThreadAssertData() : nesting_level_(0) { |
| 60 for (int i = 0; i < LAST_PER_THREAD_ASSERT_TYPE; i++) { | 61 for (int i = 0; i < LAST_PER_THREAD_ASSERT_TYPE; i++) { |
| 61 assert_states_[i] = true; | 62 assert_states_[i] = true; |
| 62 } | 63 } |
| 63 } | 64 } |
| (...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 NoThrowOnJavascriptExecution; | 262 NoThrowOnJavascriptExecution; |
| 262 | 263 |
| 263 // Scope to document where we do not expect an allocation failure. | 264 // Scope to document where we do not expect an allocation failure. |
| 264 typedef PerIsolateAssertScopeDebugOnly<ALLOCATION_FAILURE_ASSERT, false> | 265 typedef PerIsolateAssertScopeDebugOnly<ALLOCATION_FAILURE_ASSERT, false> |
| 265 DisallowAllocationFailure; | 266 DisallowAllocationFailure; |
| 266 | 267 |
| 267 // Scope to introduce an exception to DisallowAllocationFailure. | 268 // Scope to introduce an exception to DisallowAllocationFailure. |
| 268 typedef PerIsolateAssertScopeDebugOnly<ALLOCATION_FAILURE_ASSERT, true> | 269 typedef PerIsolateAssertScopeDebugOnly<ALLOCATION_FAILURE_ASSERT, true> |
| 269 AllowAllocationFailure; | 270 AllowAllocationFailure; |
| 270 | 271 |
| 272 // Scope to document where we do not expect deoptimization. |
| 273 typedef PerIsolateAssertScopeDebugOnly<DEOPTIMIZATION_ASSERT, false> |
| 274 DisallowDeoptimization; |
| 275 |
| 276 // Scope to introduce an exception to DisallowDeoptimization. |
| 277 typedef PerIsolateAssertScopeDebugOnly<DEOPTIMIZATION_ASSERT, true> |
| 278 AllowDeoptimization; |
| 279 |
| 271 } } // namespace v8::internal | 280 } } // namespace v8::internal |
| 272 | 281 |
| 273 #endif // V8_ASSERT_SCOPE_H_ | 282 #endif // V8_ASSERT_SCOPE_H_ |
| OLD | NEW |