Index: src/isolate.h |
diff --git a/src/isolate.h b/src/isolate.h |
index c51caf3212529b3a593b456dca8a88b436662f9f..28d07d1197bf3e4caa2d65ef2e8bda4c684393d7 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 = loop_var; \ |
+ 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) { \ |
+ body \ |
+ } \ |
+ } \ |
+ } while (false) |
// Platform-independent, reliable thread identifier. |
class ThreadId { |