Index: src/isolate.h |
diff --git a/src/isolate.h b/src/isolate.h |
index c51caf3212529b3a593b456dca8a88b436662f9f..3806be1282b321f78619ef8f3cc22ba5c62f0207 100644 |
--- a/src/isolate.h |
+++ b/src/isolate.h |
@@ -178,6 +178,20 @@ typedef ZoneList<Handle<Object> > ZoneObjectList; |
C(ExternalCaughtException, external_caught_exception) \ |
C(JSEntrySP, js_entry_sp) |
+#define FOR_WITH_HANDLE_SCOPE(isolate, loop_var_type, init, loop_var, \ |
+ limit_check, increment, body) \ |
+ do { \ |
+ loop_var_type init; \ |
+ loop_var_type for_with_handle_limit = 0; \ |
+ Isolate* for_with_handle_isolate = isolate; \ |
+ while (limit_check) { \ |
+ for_with_handle_limit += 1024; \ |
+ HandleScope loop_scope(for_with_handle_isolate); \ |
+ for (; limit_check && loop_var < for_with_handle_limit; increment) { \ |
Yang
2016/03/16 12:16:10
this only works as expected if "init" is "loop_var
Yang
2016/03/16 12:16:41
I meant to say "remove init and increment args".
Camillo Bruni
2016/03/16 15:54:52
from what I see it should work no matter what the
|
+ body \ |
+ } \ |
+ } \ |
+ } while (false) |
// Platform-independent, reliable thread identifier. |
class ThreadId { |