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

Unified Diff: src/factory.cc

Issue 1158023003: Mark proxy map as unstable during fixing freezing, sealing or preventing extensions). (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Addressed comments Created 5 years, 7 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
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/factory.cc
diff --git a/src/factory.cc b/src/factory.cc
index f4b609a7f94fd882faacfe89847d8c495cf58456..6d2187c0a21e1057acafb7179d7f83d331c839fe 100644
--- a/src/factory.cc
+++ b/src/factory.cc
@@ -2019,17 +2019,13 @@ void Factory::ReinitializeJSProxy(Handle<JSProxy> proxy, InstanceType type,
int size) {
DCHECK(type == JS_OBJECT_TYPE || type == JS_FUNCTION_TYPE);
- // Allocate fresh map.
- // TODO(rossberg): Once we optimize proxies, cache these maps.
- Handle<Map> map = NewMap(type, size);
+ Handle<Map> proxy_map(proxy->map());
+ Handle<Map> map = Map::FixProxy(proxy_map, type, size);
// Check that the receiver has at least the size of the fresh object.
- int size_difference = proxy->map()->instance_size() - map->instance_size();
+ int size_difference = proxy_map->instance_size() - map->instance_size();
DCHECK(size_difference >= 0);
- Handle<Object> prototype(proxy->map()->prototype(), isolate());
- Map::SetPrototype(map, prototype);
-
// Allocate the backing storage for the properties.
int prop_size = map->InitialPropertiesLength();
Handle<FixedArray> properties = NewFixedArray(prop_size, TENURED);
« no previous file with comments | « no previous file | src/objects.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698