Index: src/api.cc |
diff --git a/src/api.cc b/src/api.cc |
index 4352ef3301e2f56a44689bc27459219b8cf1961e..9e91d375410c6f04943039efb2c060bb44c7358f 100644 |
--- a/src/api.cc |
+++ b/src/api.cc |
@@ -6039,6 +6039,19 @@ Local<Integer> v8::Integer::NewFromUnsigned(uint32_t value, Isolate* isolate) { |
} |
+#ifdef DEBUG |
+v8::AssertNoGCScope::AssertNoGCScope(v8::Isolate* isolate) |
+ : isolate_(isolate), |
+ last_state_(i::EnterAllocationScope( |
+ reinterpret_cast<i::Isolate*>(isolate), false)) { |
+} |
+ |
+v8::AssertNoGCScope::~AssertNoGCScope() { |
+ i::ExitAllocationScope(reinterpret_cast<i::Isolate*>(isolate_), last_state_); |
+} |
+#endif |
+ |
+ |
void V8::IgnoreOutOfMemoryException() { |
EnterIsolateIfNeeded()->set_ignore_out_of_memory(true); |
} |