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 <memory> | 8 #include <memory> |
9 #include <queue> | 9 #include <queue> |
10 | 10 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 Isolate* __isolate__ = (isolate); \ | 110 Isolate* __isolate__ = (isolate); \ |
111 if (__isolate__->has_scheduled_exception()) { \ | 111 if (__isolate__->has_scheduled_exception()) { \ |
112 __isolate__->PromoteScheduledException(); \ | 112 __isolate__->PromoteScheduledException(); \ |
113 return value; \ | 113 return value; \ |
114 } \ | 114 } \ |
115 } while (false) | 115 } while (false) |
116 | 116 |
117 #define RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, T) \ | 117 #define RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, T) \ |
118 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, MaybeHandle<T>()) | 118 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, MaybeHandle<T>()) |
119 | 119 |
120 #define RETURN_RESULT(isolate, call, T) \ | |
121 do { \ | |
122 Handle<T> __result__; \ | |
123 if (!(call).ToHandle(&__result__)) { \ | |
124 DCHECK((isolate)->has_pending_exception()); \ | |
125 return MaybeHandle<T>(); \ | |
126 } \ | |
127 return __result__; \ | |
128 } while (false) | |
129 | |
130 #define RETURN_RESULT_OR_FAILURE(isolate, call) \ | 120 #define RETURN_RESULT_OR_FAILURE(isolate, call) \ |
131 do { \ | 121 do { \ |
132 Handle<Object> __result__; \ | 122 Handle<Object> __result__; \ |
133 Isolate* __isolate__ = (isolate); \ | 123 Isolate* __isolate__ = (isolate); \ |
134 if (!(call).ToHandle(&__result__)) { \ | 124 if (!(call).ToHandle(&__result__)) { \ |
135 DCHECK(__isolate__->has_pending_exception()); \ | 125 DCHECK(__isolate__->has_pending_exception()); \ |
136 return __isolate__->heap()->exception(); \ | 126 return __isolate__->heap()->exception(); \ |
137 } \ | 127 } \ |
138 return *__result__; \ | 128 return *__result__; \ |
139 } while (false) | 129 } while (false) |
(...skipping 1545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1685 | 1675 |
1686 EmbeddedVector<char, 128> filename_; | 1676 EmbeddedVector<char, 128> filename_; |
1687 FILE* file_; | 1677 FILE* file_; |
1688 int scope_depth_; | 1678 int scope_depth_; |
1689 }; | 1679 }; |
1690 | 1680 |
1691 } // namespace internal | 1681 } // namespace internal |
1692 } // namespace v8 | 1682 } // namespace v8 |
1693 | 1683 |
1694 #endif // V8_ISOLATE_H_ | 1684 #endif // V8_ISOLATE_H_ |
OLD | NEW |