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

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

Issue 254763007: Introduce DisallowDeoptimization scope. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressed comment Created 6 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | src/objects.cc » ('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 // 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
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
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_
OLDNEW
« no previous file with comments | « no previous file | src/objects.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698