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 "include/v8-debug.h" | 8 #include "include/v8-debug.h" |
9 #include "src/allocation.h" | 9 #include "src/allocation.h" |
10 #include "src/assert-scope.h" | 10 #include "src/assert-scope.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 #define RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate) \ | 99 #define RETURN_FAILURE_IF_SCHEDULED_EXCEPTION(isolate) \ |
100 do { \ | 100 do { \ |
101 Isolate* __isolate__ = (isolate); \ | 101 Isolate* __isolate__ = (isolate); \ |
102 if (__isolate__->has_scheduled_exception()) { \ | 102 if (__isolate__->has_scheduled_exception()) { \ |
103 return __isolate__->PromoteScheduledException(); \ | 103 return __isolate__->PromoteScheduledException(); \ |
104 } \ | 104 } \ |
105 } while (false) | 105 } while (false) |
106 | 106 |
107 // Macros for MaybeHandle. | 107 // Macros for MaybeHandle. |
108 | 108 |
109 #define RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, T) \ | 109 #define RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, value) \ |
110 do { \ | 110 do { \ |
111 Isolate* __isolate__ = (isolate); \ | 111 Isolate* __isolate__ = (isolate); \ |
112 if (__isolate__->has_scheduled_exception()) { \ | 112 if (__isolate__->has_scheduled_exception()) { \ |
113 __isolate__->PromoteScheduledException(); \ | 113 __isolate__->PromoteScheduledException(); \ |
114 return MaybeHandle<T>(); \ | 114 return value; \ |
115 } \ | 115 } \ |
116 } while (false) | 116 } while (false) |
117 | 117 |
| 118 #define RETURN_EXCEPTION_IF_SCHEDULED_EXCEPTION(isolate, T) \ |
| 119 RETURN_VALUE_IF_SCHEDULED_EXCEPTION(isolate, MaybeHandle<T>()) |
| 120 |
118 #define ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, dst, call, value) \ | 121 #define ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, dst, call, value) \ |
119 do { \ | 122 do { \ |
120 if (!(call).ToHandle(&dst)) { \ | 123 if (!(call).ToHandle(&dst)) { \ |
121 ASSERT((isolate)->has_pending_exception()); \ | 124 ASSERT((isolate)->has_pending_exception()); \ |
122 return value; \ | 125 return value; \ |
123 } \ | 126 } \ |
124 } while (false) | 127 } while (false) |
125 | 128 |
126 #define ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, dst, call) \ | 129 #define ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, dst, call) \ |
127 ASSIGN_RETURN_ON_EXCEPTION_VALUE( \ | 130 ASSIGN_RETURN_ON_EXCEPTION_VALUE( \ |
(...skipping 1400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1528 } | 1531 } |
1529 | 1532 |
1530 EmbeddedVector<char, 128> filename_; | 1533 EmbeddedVector<char, 128> filename_; |
1531 FILE* file_; | 1534 FILE* file_; |
1532 int scope_depth_; | 1535 int scope_depth_; |
1533 }; | 1536 }; |
1534 | 1537 |
1535 } } // namespace v8::internal | 1538 } } // namespace v8::internal |
1536 | 1539 |
1537 #endif // V8_ISOLATE_H_ | 1540 #endif // V8_ISOLATE_H_ |
OLD | NEW |