Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(630)

Unified Diff: src/objects.h

Issue 101733002: Fixed global object leak (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: ASSERT that Global is not called after detaching the global object Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: src/objects.h
diff --git a/src/objects.h b/src/objects.h
index bbdefc14a5942122092dd2f82345b4b4d73a2bb6..32b7b2d83a145f20fb0ae762e84df5d84c3ab9b4 100644
--- a/src/objects.h
+++ b/src/objects.h
@@ -7418,6 +7418,8 @@ class JSGlobalProxy : public JSObject {
// Casting.
static inline JSGlobalProxy* cast(Object* obj);
+ bool IsDetached() { return GetPrototype()->IsNull(); }
+
// Dispatched behavior.
DECLARE_PRINTER(JSGlobalProxy)
DECLARE_VERIFIER(JSGlobalProxy)
@@ -7487,6 +7489,10 @@ class JSGlobalObject: public GlobalObject {
static Handle<PropertyCell> EnsurePropertyCell(Handle<JSGlobalObject> global,
Handle<Name> name);
+ bool IsDetached() {
+ return JSGlobalProxy::cast(global_receiver())->IsDetached();
+ }
+
// Dispatched behavior.
DECLARE_PRINTER(JSGlobalObject)
DECLARE_VERIFIER(JSGlobalObject)
« no previous file with comments | « src/bootstrapper.cc ('k') | src/runtime.h » ('j') | test/cctest/test-object-observe.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698