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

Unified Diff: src/factory.cc

Issue 254433002: Store JSGlobalProxy's identity hash directly on the proxy itself (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Re-introduce %UnwrapProxy to make Object.observe work Created 6 years, 8 months 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/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index 389789f7e85ca533c09a01500ddc204d90049986..e10b3e692565794b0e416ebb76be60334c0e3e5c 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -1752,6 +1752,9 @@ void Factory::ReinitializeJSGlobalProxy(Handle<JSGlobalProxy> object,
ASSERT(constructor->has_initial_map());
Handle<Map> map(constructor->initial_map(), isolate());
+ // The proxy's hash should be retained across reinitialization.
+ Handle<Object> hash(object->hash(), isolate());
+
// Check that the already allocated object has the same size and type as
// objects allocated using the constructor.
ASSERT(map->instance_size() == object->map()->instance_size());
@@ -1771,6 +1774,9 @@ void Factory::ReinitializeJSGlobalProxy(Handle<JSGlobalProxy> object,
Heap* heap = isolate()->heap();
// Reinitialize the object from the constructor map.
heap->InitializeJSObjectFromMap(*object, *properties, *map);
+
+ // Restore the saved hash.
+ object->set_hash(*hash);
}
« no previous file with comments | « src/bootstrapper.cc ('k') | src/object-observe.js » ('j') | src/object-observe.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698