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

Side by Side 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, 6 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 unified diff | Download patch
« no previous file with comments | « src/objects.h ('k') | test/mjsunit/regress/regress-crbug-493568.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 the V8 project authors. All rights reserved. 1 // Copyright 2013 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <iomanip> 5 #include <iomanip>
6 #include <sstream> 6 #include <sstream>
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/accessors.h" 10 #include "src/accessors.h"
(...skipping 7383 matching lines...) Expand 10 before | Expand all | Expand 10 after
7394 isolate); 7394 isolate);
7395 Handle<Map> new_map = CopyReplaceDescriptors( 7395 Handle<Map> new_map = CopyReplaceDescriptors(
7396 map, new_desc, new_layout_descriptor, INSERT_TRANSITION, 7396 map, new_desc, new_layout_descriptor, INSERT_TRANSITION,
7397 transition_marker, reason, SPECIAL_TRANSITION); 7397 transition_marker, reason, SPECIAL_TRANSITION);
7398 new_map->set_is_extensible(false); 7398 new_map->set_is_extensible(false);
7399 new_map->set_elements_kind(DICTIONARY_ELEMENTS); 7399 new_map->set_elements_kind(DICTIONARY_ELEMENTS);
7400 return new_map; 7400 return new_map;
7401 } 7401 }
7402 7402
7403 7403
7404 Handle<Map> Map::FixProxy(Handle<Map> map, InstanceType type, int size) {
7405 DCHECK(type == JS_OBJECT_TYPE || type == JS_FUNCTION_TYPE);
7406 DCHECK(map->IsJSProxyMap());
7407
7408 Isolate* isolate = map->GetIsolate();
7409
7410 // Allocate fresh map.
7411 // TODO(rossberg): Once we optimize proxies, cache these maps.
7412 Handle<Map> new_map = isolate->factory()->NewMap(type, size);
7413
7414 Handle<Object> prototype(map->prototype(), isolate);
7415 Map::SetPrototype(new_map, prototype);
7416
7417 map->NotifyLeafMapLayoutChange();
7418
7419 return new_map;
7420 }
7421
7422
7404 bool DescriptorArray::CanHoldValue(int descriptor, Object* value) { 7423 bool DescriptorArray::CanHoldValue(int descriptor, Object* value) {
7405 PropertyDetails details = GetDetails(descriptor); 7424 PropertyDetails details = GetDetails(descriptor);
7406 switch (details.type()) { 7425 switch (details.type()) {
7407 case DATA: 7426 case DATA:
7408 return value->FitsRepresentation(details.representation()) && 7427 return value->FitsRepresentation(details.representation()) &&
7409 GetFieldType(descriptor)->NowContains(value); 7428 GetFieldType(descriptor)->NowContains(value);
7410 7429
7411 case DATA_CONSTANT: 7430 case DATA_CONSTANT:
7412 DCHECK(GetConstant(descriptor) != value || 7431 DCHECK(GetConstant(descriptor) != value ||
7413 value->FitsRepresentation(details.representation())); 7432 value->FitsRepresentation(details.representation()));
(...skipping 9971 matching lines...) Expand 10 before | Expand all | Expand 10 after
17385 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell, 17404 void PropertyCell::SetValueWithInvalidation(Handle<PropertyCell> cell,
17386 Handle<Object> new_value) { 17405 Handle<Object> new_value) {
17387 if (cell->value() != *new_value) { 17406 if (cell->value() != *new_value) {
17388 cell->set_value(*new_value); 17407 cell->set_value(*new_value);
17389 Isolate* isolate = cell->GetIsolate(); 17408 Isolate* isolate = cell->GetIsolate();
17390 cell->dependent_code()->DeoptimizeDependentCodeGroup( 17409 cell->dependent_code()->DeoptimizeDependentCodeGroup(
17391 isolate, DependentCode::kPropertyCellChangedGroup); 17410 isolate, DependentCode::kPropertyCellChangedGroup);
17392 } 17411 }
17393 } 17412 }
17394 } } // namespace v8::internal 17413 } } // namespace v8::internal
OLDNEW
« 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