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

Side by Side Diff: src/isolate.h

Issue 2006673002: Reduce boilerplace for common pattern to return MaybeHandle. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: rebase Created 4 years, 6 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 | « src/ic/ic.cc ('k') | src/runtime/runtime-array.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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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_ISOLATE_H_ 5 #ifndef V8_ISOLATE_H_
6 #define V8_ISOLATE_H_ 6 #define V8_ISOLATE_H_
7 7
8 #include <queue> 8 #include <queue>
9 #include <set> 9 #include <set>
10 10
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 Isolate* __isolate__ = (isolate); \ 117 Isolate* __isolate__ = (isolate); \
118 if (__isolate__->has_scheduled_exception()) { \ 118 if (__isolate__->has_scheduled_exception()) { \
119 __isolate__->PromoteScheduledException(); \ 119 __isolate__->PromoteScheduledException(); \
120 return value; \ 120 return value; \
121 } \ 121 } \
122 } while (false) 122 } while (false)
123 123
124 #define RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, T) \ 124 #define RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, T) \
125 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, MaybeHandle<T>()) 125 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, MaybeHandle<T>())
126 126
127 #define RETURN_RESULT_OR_FAILURE(isolate, call) \
128 do { \
129 Handle<Object> __result__; \
130 if (!(call).ToHandle(&__result__)) { \
131 DCHECK((isolate)->has_pending_exception()); \
132 return isolate->heap()->exception(); \
Jakob Kummerow 2016/05/24 09:16:21 It seems inconsistent that the DCHECK line puts pa
Yang 2016/05/24 11:07:21 you are right. We actually have this problem below
133 } \
134 return *__result__; \
135 } while (false)
136
127 #define ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, dst, call, value) \ 137 #define ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, dst, call, value) \
128 do { \ 138 do { \
129 if (!(call).ToHandle(&dst)) { \ 139 if (!(call).ToHandle(&dst)) { \
130 DCHECK((isolate)->has_pending_exception()); \ 140 DCHECK((isolate)->has_pending_exception()); \
131 return value; \ 141 return value; \
132 } \ 142 } \
133 } while (false) 143 } while (false)
134 144
135 #define ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, dst, call) \ 145 #define ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, dst, call) \
136 ASSIGN_RETURN_ON_EXCEPTION_VALUE( \ 146 ASSIGN_RETURN_ON_EXCEPTION_VALUE( \
(...skipping 1477 matching lines...) Expand 10 before | Expand all | Expand 10 after
1614 1624
1615 EmbeddedVector<char, 128> filename_; 1625 EmbeddedVector<char, 128> filename_;
1616 FILE* file_; 1626 FILE* file_;
1617 int scope_depth_; 1627 int scope_depth_;
1618 }; 1628 };
1619 1629
1620 } // namespace internal 1630 } // namespace internal
1621 } // namespace v8 1631 } // namespace v8
1622 1632
1623 #endif // V8_ISOLATE_H_ 1633 #endif // V8_ISOLATE_H_
OLDNEW
« no previous file with comments | « src/ic/ic.cc ('k') | src/runtime/runtime-array.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698