Index: src/handles.cc |
=================================================================== |
--- src/handles.cc (revision 1641) |
+++ src/handles.cc (working copy) |
@@ -308,6 +308,11 @@ |
// associated with the wrapper and get rid of both the wrapper and the |
// handle. |
static void ClearWrapperCache(Persistent<v8::Value> handle, void*) { |
+#ifdef ENABLE_HEAP_PROTECTION |
+ // Weak reference callbacks are called as if from outside V8. We |
+ // need to reeenter to unprotect the heap. |
+ VMState state(OTHER); |
+#endif |
Handle<Object> cache = Utils::OpenHandle(*handle); |
JSValue* wrapper = JSValue::cast(*cache); |
Proxy* proxy = Script::cast(wrapper->value())->wrapper(); |