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

Unified Diff: src/objects.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 | « src/objects.h ('k') | test/mjsunit/regress/regress-crbug-493568.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/objects.cc
diff --git a/src/objects.cc b/src/objects.cc
index 125a76716c034b8b61e74f2d62920fcf6b6615a0..16201a861411acd2bf99afa7c1a0c4c294dc1304 100644
--- a/src/objects.cc
+++ b/src/objects.cc
@@ -7401,6 +7401,25 @@ Handle<Map> Map::CopyForPreventExtensions(Handle<Map> map,
}
+Handle<Map> Map::FixProxy(Handle<Map> map, InstanceType type, int size) {
+ DCHECK(type == JS_OBJECT_TYPE || type == JS_FUNCTION_TYPE);
+ DCHECK(map->IsJSProxyMap());
+
+ Isolate* isolate = map->GetIsolate();
+
+ // Allocate fresh map.
+ // TODO(rossberg): Once we optimize proxies, cache these maps.
+ Handle<Map> new_map = isolate->factory()->NewMap(type, size);
+
+ Handle<Object> prototype(map->prototype(), isolate);
+ Map::SetPrototype(new_map, prototype);
+
+ map->NotifyLeafMapLayoutChange();
+
+ return new_map;
+}
+
+
bool DescriptorArray::CanHoldValue(int descriptor, Object* value) {
PropertyDetails details = GetDetails(descriptor);
switch (details.type()) {
« no previous file with comments | « src/objects.h ('k') | test/mjsunit/regress/regress-crbug-493568.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698