OLD | NEW |
---|---|
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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
157 } \ | 157 } \ |
158 } while (false) | 158 } while (false) |
159 | 159 |
160 #define RETURN_FAILURE_ON_EXCEPTION(isolate, call) \ | 160 #define RETURN_FAILURE_ON_EXCEPTION(isolate, call) \ |
161 RETURN_ON_EXCEPTION_VALUE(isolate, call, isolate->heap()->exception()) | 161 RETURN_ON_EXCEPTION_VALUE(isolate, call, isolate->heap()->exception()) |
162 | 162 |
163 #define RETURN_ON_EXCEPTION(isolate, call, T) \ | 163 #define RETURN_ON_EXCEPTION(isolate, call, T) \ |
164 RETURN_ON_EXCEPTION_VALUE(isolate, call, MaybeHandle<T>()) | 164 RETURN_ON_EXCEPTION_VALUE(isolate, call, MaybeHandle<T>()) |
165 | 165 |
166 | 166 |
167 // Macros for Maybe. | |
168 | |
169 #define ASSIGN_OR_RETURN_EXCEPTION(isolate, T, dst, call) \ | |
170 T dst; \ | |
rossberg
2015/10/19 14:33:08
I'm afraid you can't do that, this breaks the macr
neis
2015/10/20 07:58:35
Done.
| |
171 do { \ | |
172 Maybe<T> result_of_the_call = (call); \ | |
173 if (result_of_the_call.IsNothing()) { \ | |
174 DCHECK((isolate)->has_pending_exception()); \ | |
175 return isolate->heap()->exception(); \ | |
176 } \ | |
177 dst = result_of_the_call.FromJust(); \ | |
178 } while (false) | |
179 | |
180 | |
181 #define ASSIGN_OR_RETURN(T, dst, call, value) \ | |
182 T dst; \ | |
183 do { \ | |
184 Maybe<T> result_of_the_call = (call); \ | |
185 if (result_of_the_call.IsNothing()) { \ | |
186 return value; \ | |
187 } \ | |
188 dst = result_of_the_call.FromJust(); \ | |
189 } while (false) | |
190 | |
191 | |
167 #define FOR_EACH_ISOLATE_ADDRESS_NAME(C) \ | 192 #define FOR_EACH_ISOLATE_ADDRESS_NAME(C) \ |
168 C(Handler, handler) \ | 193 C(Handler, handler) \ |
169 C(CEntryFP, c_entry_fp) \ | 194 C(CEntryFP, c_entry_fp) \ |
170 C(CFunction, c_function) \ | 195 C(CFunction, c_function) \ |
171 C(Context, context) \ | 196 C(Context, context) \ |
172 C(PendingException, pending_exception) \ | 197 C(PendingException, pending_exception) \ |
173 C(PendingHandlerContext, pending_handler_context) \ | 198 C(PendingHandlerContext, pending_handler_context) \ |
174 C(PendingHandlerCode, pending_handler_code) \ | 199 C(PendingHandlerCode, pending_handler_code) \ |
175 C(PendingHandlerOffset, pending_handler_offset) \ | 200 C(PendingHandlerOffset, pending_handler_offset) \ |
176 C(PendingHandlerFP, pending_handler_fp) \ | 201 C(PendingHandlerFP, pending_handler_fp) \ |
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1556 | 1581 |
1557 EmbeddedVector<char, 128> filename_; | 1582 EmbeddedVector<char, 128> filename_; |
1558 FILE* file_; | 1583 FILE* file_; |
1559 int scope_depth_; | 1584 int scope_depth_; |
1560 }; | 1585 }; |
1561 | 1586 |
1562 } // namespace internal | 1587 } // namespace internal |
1563 } // namespace v8 | 1588 } // namespace v8 |
1564 | 1589 |
1565 #endif // V8_ISOLATE_H_ | 1590 #endif // V8_ISOLATE_H_ |
OLD | NEW |