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 #include <set> | 10 #include <set> |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
119 Isolate* __isolate__ = (isolate); \ | 119 Isolate* __isolate__ = (isolate); \ |
120 if (__isolate__->has_scheduled_exception()) { \ | 120 if (__isolate__->has_scheduled_exception()) { \ |
121 __isolate__->PromoteScheduledException(); \ | 121 __isolate__->PromoteScheduledException(); \ |
122 return value; \ | 122 return value; \ |
123 } \ | 123 } \ |
124 } while (false) | 124 } while (false) |
125 | 125 |
126 #define RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, T) \ | 126 #define RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, T) \ |
127 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, MaybeHandle<T>()) | 127 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, MaybeHandle<T>()) |
128 | 128 |
129 #define RETURN_RESULT(isolate, call, T) \ | |
jgruber
2016/07/29 11:54:37
This is related to RETURN_RESULT_OR_FAILURE as ASS
| |
130 do { \ | |
131 Handle<T> __result__; \ | |
132 if (!(call).ToHandle(&__result__)) { \ | |
133 DCHECK((isolate)->has_pending_exception()); \ | |
134 return MaybeHandle<T>(); \ | |
135 } \ | |
136 return __result__; \ | |
137 } while (false) | |
138 | |
129 #define RETURN_RESULT_OR_FAILURE(isolate, call) \ | 139 #define RETURN_RESULT_OR_FAILURE(isolate, call) \ |
130 do { \ | 140 do { \ |
131 Handle<Object> __result__; \ | 141 Handle<Object> __result__; \ |
132 Isolate* __isolate__ = (isolate); \ | 142 Isolate* __isolate__ = (isolate); \ |
133 if (!(call).ToHandle(&__result__)) { \ | 143 if (!(call).ToHandle(&__result__)) { \ |
134 DCHECK(__isolate__->has_pending_exception()); \ | 144 DCHECK(__isolate__->has_pending_exception()); \ |
135 return __isolate__->heap()->exception(); \ | 145 return __isolate__->heap()->exception(); \ |
136 } \ | 146 } \ |
137 return *__result__; \ | 147 return *__result__; \ |
138 } while (false) | 148 } while (false) |
(...skipping 1504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1643 | 1653 |
1644 EmbeddedVector<char, 128> filename_; | 1654 EmbeddedVector<char, 128> filename_; |
1645 FILE* file_; | 1655 FILE* file_; |
1646 int scope_depth_; | 1656 int scope_depth_; |
1647 }; | 1657 }; |
1648 | 1658 |
1649 } // namespace internal | 1659 } // namespace internal |
1650 } // namespace v8 | 1660 } // namespace v8 |
1651 | 1661 |
1652 #endif // V8_ISOLATE_H_ | 1662 #endif // V8_ISOLATE_H_ |
OLD | NEW |