Index: src/json-parser.h |
diff --git a/src/json-parser.h b/src/json-parser.h |
index 0cfe44640eec7d4d92b06d9dabfaa3987df847bb..7cf80966dfd18d317d61c6ff2e34ee7d38c09fa3 100644 |
--- a/src/json-parser.h |
+++ b/src/json-parser.h |
@@ -261,6 +261,11 @@ Handle<Object> JsonParser<seq_one_byte>::ParseJsonValue() { |
return Handle<Object>::null(); |
} |
+ if (isolate_->stack_guard()->InterruptRequested()) { |
+ // Avoid blocking GC in long running parser (v8:3974). |
+ isolate_->stack_guard()->CheckAndHandleGCInterrupt(); |
+ } |
+ |
if (c0_ == '"') return ParseJsonString(); |
if ((c0_ >= '0' && c0_ <= '9') || c0_ == '-') return ParseJsonNumber(); |
if (c0_ == '{') return ParseJsonObject(); |