OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |