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 "include/v8-debug.h" | 9 #include "include/v8-debug.h" |
10 #include "src/allocation.h" | 10 #include "src/allocation.h" |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 } \ | 130 } \ |
131 } while (false) | 131 } while (false) |
132 | 132 |
133 #define ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, dst, call) \ | 133 #define ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, dst, call) \ |
134 ASSIGN_RETURN_ON_EXCEPTION_VALUE( \ | 134 ASSIGN_RETURN_ON_EXCEPTION_VALUE( \ |
135 isolate, dst, call, isolate->heap()->exception()) | 135 isolate, dst, call, isolate->heap()->exception()) |
136 | 136 |
137 #define ASSIGN_RETURN_ON_EXCEPTION(isolate, dst, call, T) \ | 137 #define ASSIGN_RETURN_ON_EXCEPTION(isolate, dst, call, T) \ |
138 ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, dst, call, MaybeHandle<T>()) | 138 ASSIGN_RETURN_ON_EXCEPTION_VALUE(isolate, dst, call, MaybeHandle<T>()) |
139 | 139 |
140 #define THROW_NEW_ERROR(isolate, call, T) \ | 140 #define THROW_NEW_ERROR(isolate, call, T) \ |
141 do { \ | 141 do { \ |
142 Handle<Object> __error__; \ | 142 return isolate->Throw<T>(isolate->factory()->call); \ |
143 ASSIGN_RETURN_ON_EXCEPTION(isolate, __error__, isolate->factory()->call, \ | |
144 T); \ | |
145 return isolate->Throw<T>(__error__); \ | |
146 } while (false) | 143 } while (false) |
147 | 144 |
148 #define THROW_NEW_ERROR_RETURN_FAILURE(isolate, call) \ | 145 #define THROW_NEW_ERROR_RETURN_FAILURE(isolate, call) \ |
149 do { \ | 146 do { \ |
150 Handle<Object> __error__; \ | 147 return isolate->Throw(*isolate->factory()->call); \ |
151 ASSIGN_RETURN_FAILURE_ON_EXCEPTION(isolate, __error__, \ | |
152 isolate->factory()->call); \ | |
153 return isolate->Throw(*__error__); \ | |
154 } while (false) | 148 } while (false) |
155 | 149 |
156 #define RETURN_ON_EXCEPTION_VALUE(isolate, call, value) \ | 150 #define RETURN_ON_EXCEPTION_VALUE(isolate, call, value) \ |
157 do { \ | 151 do { \ |
158 if ((call).is_null()) { \ | 152 if ((call).is_null()) { \ |
159 DCHECK((isolate)->has_pending_exception()); \ | 153 DCHECK((isolate)->has_pending_exception()); \ |
160 return value; \ | 154 return value; \ |
161 } \ | 155 } \ |
162 } while (false) | 156 } while (false) |
163 | 157 |
(...skipping 1417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1581 } | 1575 } |
1582 | 1576 |
1583 EmbeddedVector<char, 128> filename_; | 1577 EmbeddedVector<char, 128> filename_; |
1584 FILE* file_; | 1578 FILE* file_; |
1585 int scope_depth_; | 1579 int scope_depth_; |
1586 }; | 1580 }; |
1587 | 1581 |
1588 } } // namespace v8::internal | 1582 } } // namespace v8::internal |
1589 | 1583 |
1590 #endif // V8_ISOLATE_H_ | 1584 #endif // V8_ISOLATE_H_ |
OLD | NEW |