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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 C(Context, context) \ | 171 C(Context, context) \ |
172 C(PendingException, pending_exception) \ | 172 C(PendingException, pending_exception) \ |
173 C(PendingHandlerContext, pending_handler_context) \ | 173 C(PendingHandlerContext, pending_handler_context) \ |
174 C(PendingHandlerCode, pending_handler_code) \ | 174 C(PendingHandlerCode, pending_handler_code) \ |
175 C(PendingHandlerOffset, pending_handler_offset) \ | 175 C(PendingHandlerOffset, pending_handler_offset) \ |
176 C(PendingHandlerFP, pending_handler_fp) \ | 176 C(PendingHandlerFP, pending_handler_fp) \ |
177 C(PendingHandlerSP, pending_handler_sp) \ | 177 C(PendingHandlerSP, pending_handler_sp) \ |
178 C(ExternalCaughtException, external_caught_exception) \ | 178 C(ExternalCaughtException, external_caught_exception) \ |
179 C(JSEntrySP, js_entry_sp) | 179 C(JSEntrySP, js_entry_sp) |
180 | 180 |
| 181 #define FOR_WITH_HANDLE_SCOPE(isolate, loop_var_type, init, loop_var, \ |
| 182 limit_check, increment, body) \ |
| 183 do { \ |
| 184 loop_var_type init; \ |
| 185 loop_var_type for_with_handle_limit = loop_var; \ |
| 186 Isolate* for_with_handle_isolate = isolate; \ |
| 187 while (limit_check) { \ |
| 188 for_with_handle_limit += 1024; \ |
| 189 HandleScope loop_scope(for_with_handle_isolate); \ |
| 190 for (; limit_check && loop_var < for_with_handle_limit; increment) { \ |
| 191 body \ |
| 192 } \ |
| 193 } \ |
| 194 } while (false) |
181 | 195 |
182 // Platform-independent, reliable thread identifier. | 196 // Platform-independent, reliable thread identifier. |
183 class ThreadId { | 197 class ThreadId { |
184 public: | 198 public: |
185 // Creates an invalid ThreadId. | 199 // Creates an invalid ThreadId. |
186 ThreadId() { base::NoBarrier_Store(&id_, kInvalidId); } | 200 ThreadId() { base::NoBarrier_Store(&id_, kInvalidId); } |
187 | 201 |
188 ThreadId& operator=(const ThreadId& other) { | 202 ThreadId& operator=(const ThreadId& other) { |
189 base::NoBarrier_Store(&id_, base::NoBarrier_Load(&other.id_)); | 203 base::NoBarrier_Store(&id_, base::NoBarrier_Load(&other.id_)); |
190 return *this; | 204 return *this; |
(...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1566 | 1580 |
1567 EmbeddedVector<char, 128> filename_; | 1581 EmbeddedVector<char, 128> filename_; |
1568 FILE* file_; | 1582 FILE* file_; |
1569 int scope_depth_; | 1583 int scope_depth_; |
1570 }; | 1584 }; |
1571 | 1585 |
1572 } // namespace internal | 1586 } // namespace internal |
1573 } // namespace v8 | 1587 } // namespace v8 |
1574 | 1588 |
1575 #endif // V8_ISOLATE_H_ | 1589 #endif // V8_ISOLATE_H_ |
OLD | NEW |