Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2017 the V8 project authors. All rights reserved. | 1 // Copyright 2017 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 "src/map-updater.h" | 5 #include "src/map-updater.h" |
| 6 | 6 |
| 7 #include "src/field-type.h" | 7 #include "src/field-type.h" |
| 8 #include "src/handles.h" | 8 #include "src/handles.h" |
| 9 #include "src/isolate.h" | 9 #include "src/isolate.h" |
| 10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
| 11 #include "src/objects.h" | 11 #include "src/objects.h" |
| 12 #include "src/transitions.h" | 12 #include "src/transitions.h" |
| 13 | 13 |
| 14 namespace v8 { | 14 namespace v8 { |
| 15 namespace internal { | 15 namespace internal { |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 inline bool EqualImmutableValues(Object* obj1, Object* obj2) { | 19 inline bool EqualImmutableValues(Object* obj1, Object* obj2) { |
| 20 if (obj1 == obj2) return true; // Valid for both kData and kAccessor kinds. | 20 if (obj1 == obj2) return true; // Valid for both kData and kAccessor kinds. |
| 21 // TODO(ishell): compare AccessorPairs. | 21 // TODO(ishell): compare AccessorPairs. |
| 22 return false; | 22 return false; |
| 23 } | 23 } |
| 24 | 24 |
| 25 inline bool LocationFitsInto(PropertyLocation what, PropertyLocation where) { | |
| 26 return where == kField || what == kDescriptor; | |
| 27 } | |
| 28 | |
| 29 } // namespace | 25 } // namespace |
| 30 | 26 |
| 31 Name* MapUpdater::GetKey(int descriptor) const { | 27 Name* MapUpdater::GetKey(int descriptor) const { |
| 32 return old_descriptors_->GetKey(descriptor); | 28 return old_descriptors_->GetKey(descriptor); |
| 33 } | 29 } |
| 34 | 30 |
| 35 PropertyDetails MapUpdater::GetDetails(int descriptor) const { | 31 PropertyDetails MapUpdater::GetDetails(int descriptor) const { |
| 36 DCHECK_LE(0, descriptor); | 32 DCHECK_LE(0, descriptor); |
| 37 if (descriptor == modified_descriptor_) { | 33 if (descriptor == modified_descriptor_) { |
| 38 return PropertyDetails(new_kind_, new_attributes_, new_location_, | 34 return PropertyDetails(new_kind_, new_attributes_, new_location_, |
| 39 new_representation_); | 35 new_constness_, new_representation_); |
| 40 } | 36 } |
| 41 return old_descriptors_->GetDetails(descriptor); | 37 return old_descriptors_->GetDetails(descriptor); |
| 42 } | 38 } |
| 43 | 39 |
| 44 Object* MapUpdater::GetValue(int descriptor) const { | 40 Object* MapUpdater::GetValue(int descriptor) const { |
| 45 DCHECK_LE(0, descriptor); | 41 DCHECK_LE(0, descriptor); |
| 46 if (descriptor == modified_descriptor_) { | 42 if (descriptor == modified_descriptor_) { |
| 47 DCHECK_EQ(kDescriptor, new_location_); | 43 DCHECK_EQ(kDescriptor, new_location_); |
| 48 return *new_value_; | 44 return *new_value_; |
| 49 } | 45 } |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 PropertyAttributes attributes, | 87 PropertyAttributes attributes, |
| 92 Representation representation, | 88 Representation representation, |
| 93 Handle<FieldType> field_type) { | 89 Handle<FieldType> field_type) { |
| 94 DCHECK_EQ(kInitialized, state_); | 90 DCHECK_EQ(kInitialized, state_); |
| 95 DCHECK_LE(0, descriptor); | 91 DCHECK_LE(0, descriptor); |
| 96 DCHECK(!old_map_->is_dictionary_map()); | 92 DCHECK(!old_map_->is_dictionary_map()); |
| 97 modified_descriptor_ = descriptor; | 93 modified_descriptor_ = descriptor; |
| 98 new_kind_ = kData; | 94 new_kind_ = kData; |
| 99 new_attributes_ = attributes; | 95 new_attributes_ = attributes; |
| 100 new_location_ = kField; | 96 new_location_ = kField; |
| 101 new_representation_ = representation; | |
| 102 new_field_type_ = field_type; | |
| 103 | 97 |
| 104 PropertyDetails old_details = | 98 PropertyDetails old_details = |
| 105 old_descriptors_->GetDetails(modified_descriptor_); | 99 old_descriptors_->GetDetails(modified_descriptor_); |
| 106 | 100 |
| 107 // If property kind is not reconfigured merge the result with | 101 // If property kind is not reconfigured merge the result with |
| 108 // representation/field type from the old descriptor. | 102 // representation/field type from the old descriptor. |
| 109 if (old_details.kind() == new_kind_) { | 103 if (old_details.kind() == new_kind_) { |
| 104 new_constness_ = old_details.constness(); | |
| 105 | |
| 110 Representation old_representation = old_details.representation(); | 106 Representation old_representation = old_details.representation(); |
| 111 new_representation_ = new_representation_.generalize(old_representation); | 107 new_representation_ = representation.generalize(old_representation); |
| 112 | 108 |
| 113 Handle<FieldType> old_field_type = | 109 Handle<FieldType> old_field_type = |
| 114 GetOrComputeFieldType(old_descriptors_, modified_descriptor_, | 110 GetOrComputeFieldType(old_descriptors_, modified_descriptor_, |
| 115 old_details.location(), new_representation_); | 111 old_details.location(), new_representation_); |
| 116 | 112 |
| 117 new_field_type_ = Map::GeneralizeFieldType( | 113 new_field_type_ = |
| 118 old_representation, old_field_type, new_representation_, | 114 Map::GeneralizeFieldType(old_representation, old_field_type, |
| 119 new_field_type_, isolate_); | 115 new_representation_, field_type, isolate_); |
| 116 } else { | |
| 117 // We don't know if this is a first property kind reconfiguration | |
| 118 // and we don't know which value was in this property previously | |
| 119 // therefore we can't treat such a property as constant. | |
| 120 new_constness_ = kMutable; | |
| 121 new_representation_ = representation; | |
| 122 new_field_type_ = field_type; | |
| 120 } | 123 } |
| 121 | 124 |
| 122 if (TryRecofigureToDataFieldInplace() == kEnd) return result_map_; | 125 if (TryRecofigureToDataFieldInplace() == kEnd) return result_map_; |
| 123 if (FindRootMap() == kEnd) return result_map_; | 126 if (FindRootMap() == kEnd) return result_map_; |
| 124 if (FindTargetMap() == kEnd) return result_map_; | 127 if (FindTargetMap() == kEnd) return result_map_; |
| 125 ConstructNewMap(); | 128 ConstructNewMap(); |
| 126 DCHECK_EQ(kEnd, state_); | 129 DCHECK_EQ(kEnd, state_); |
| 127 return result_map_; | 130 return result_map_; |
| 128 } | 131 } |
| 129 | 132 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 221 return CopyGeneralizeAllFields("GenAll_InvalidElementsTransition"); | 224 return CopyGeneralizeAllFields("GenAll_InvalidElementsTransition"); |
| 222 } | 225 } |
| 223 | 226 |
| 224 if (modified_descriptor_ >= 0 && modified_descriptor_ < root_nof) { | 227 if (modified_descriptor_ >= 0 && modified_descriptor_ < root_nof) { |
| 225 PropertyDetails old_details = | 228 PropertyDetails old_details = |
| 226 old_descriptors_->GetDetails(modified_descriptor_); | 229 old_descriptors_->GetDetails(modified_descriptor_); |
| 227 if (old_details.kind() != new_kind_ || | 230 if (old_details.kind() != new_kind_ || |
| 228 old_details.attributes() != new_attributes_) { | 231 old_details.attributes() != new_attributes_) { |
| 229 return CopyGeneralizeAllFields("GenAll_RootModification1"); | 232 return CopyGeneralizeAllFields("GenAll_RootModification1"); |
| 230 } | 233 } |
| 231 if (!new_representation_.fits_into(old_details.representation())) { | 234 if (old_details.location() != kField) { |
| 232 return CopyGeneralizeAllFields("GenAll_RootModification2"); | 235 return CopyGeneralizeAllFields("GenAll_RootModification2"); |
| 233 } | 236 } |
| 234 if (old_details.location() != kField) { | 237 DCHECK_EQ(kMutable, old_details.constness()); |
| 238 if (!new_representation_.fits_into(old_details.representation())) { | |
| 235 return CopyGeneralizeAllFields("GenAll_RootModification3"); | 239 return CopyGeneralizeAllFields("GenAll_RootModification3"); |
| 236 } | 240 } |
| 237 DCHECK_EQ(kData, old_details.kind()); | 241 DCHECK_EQ(kData, old_details.kind()); |
| 238 DCHECK_EQ(kData, new_kind_); | 242 DCHECK_EQ(kData, new_kind_); |
| 239 DCHECK_EQ(kField, new_location_); | 243 DCHECK_EQ(kField, new_location_); |
| 240 FieldType* old_field_type = | 244 FieldType* old_field_type = |
| 241 old_descriptors_->GetFieldType(modified_descriptor_); | 245 old_descriptors_->GetFieldType(modified_descriptor_); |
| 242 if (!new_field_type_->NowIs(old_field_type)) { | 246 if (!new_field_type_->NowIs(old_field_type)) { |
| 243 return CopyGeneralizeAllFields("GenAll_RootModification4"); | 247 return CopyGeneralizeAllFields("GenAll_RootModification4"); |
| 244 } | 248 } |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 269 | 273 |
| 270 // Check if target map is incompatible. | 274 // Check if target map is incompatible. |
| 271 PropertyDetails tmp_details = tmp_descriptors->GetDetails(i); | 275 PropertyDetails tmp_details = tmp_descriptors->GetDetails(i); |
| 272 DCHECK_EQ(old_details.kind(), tmp_details.kind()); | 276 DCHECK_EQ(old_details.kind(), tmp_details.kind()); |
| 273 DCHECK_EQ(old_details.attributes(), tmp_details.attributes()); | 277 DCHECK_EQ(old_details.attributes(), tmp_details.attributes()); |
| 274 if (old_details.kind() == kAccessor && | 278 if (old_details.kind() == kAccessor && |
| 275 !EqualImmutableValues(GetValue(i), tmp_descriptors->GetValue(i))) { | 279 !EqualImmutableValues(GetValue(i), tmp_descriptors->GetValue(i))) { |
| 276 // TODO(ishell): mutable accessors are not implemented yet. | 280 // TODO(ishell): mutable accessors are not implemented yet. |
| 277 return CopyGeneralizeAllFields("GenAll_Incompatible"); | 281 return CopyGeneralizeAllFields("GenAll_Incompatible"); |
| 278 } | 282 } |
| 283 // Check if old constness fits into tmp constness. | |
| 284 if (!ConstnessFitsInto(old_details.constness(), tmp_details.constness())) { | |
| 285 break; | |
| 286 } | |
| 279 // Check if old location fits into tmp location. | 287 // Check if old location fits into tmp location. |
| 280 if (!LocationFitsInto(old_details.location(), tmp_details.location())) { | 288 if (!LocationFitsInto(old_details.location(), tmp_details.location())) { |
| 281 break; | 289 break; |
| 282 } | 290 } |
| 283 | 291 |
| 284 // Check if old representation fits into tmp representation. | 292 // Check if old representation fits into tmp representation. |
| 285 Representation tmp_representation = tmp_details.representation(); | 293 Representation tmp_representation = tmp_details.representation(); |
| 286 if (!old_details.representation().fits_into(tmp_representation)) { | 294 if (!old_details.representation().fits_into(tmp_representation)) { |
| 287 break; | 295 break; |
| 288 } | 296 } |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 334 | 342 |
| 335 // Find the last compatible target map in the transition tree. | 343 // Find the last compatible target map in the transition tree. |
| 336 for (int i = target_nof; i < old_nof_; ++i) { | 344 for (int i = target_nof; i < old_nof_; ++i) { |
| 337 PropertyDetails old_details = GetDetails(i); | 345 PropertyDetails old_details = GetDetails(i); |
| 338 Map* transition = TransitionArray::SearchTransition( | 346 Map* transition = TransitionArray::SearchTransition( |
| 339 *target_map_, old_details.kind(), GetKey(i), old_details.attributes()); | 347 *target_map_, old_details.kind(), GetKey(i), old_details.attributes()); |
| 340 if (transition == NULL) break; | 348 if (transition == NULL) break; |
| 341 Handle<Map> tmp_map(transition, isolate_); | 349 Handle<Map> tmp_map(transition, isolate_); |
| 342 Handle<DescriptorArray> tmp_descriptors(tmp_map->instance_descriptors(), | 350 Handle<DescriptorArray> tmp_descriptors(tmp_map->instance_descriptors(), |
| 343 isolate_); | 351 isolate_); |
| 344 | |
| 345 #ifdef DEBUG | 352 #ifdef DEBUG |
| 346 // Check that target map is compatible. | 353 // Check that target map is compatible. |
| 347 PropertyDetails tmp_details = tmp_descriptors->GetDetails(i); | 354 PropertyDetails tmp_details = tmp_descriptors->GetDetails(i); |
| 348 DCHECK_EQ(old_details.kind(), tmp_details.kind()); | 355 DCHECK_EQ(old_details.kind(), tmp_details.kind()); |
| 349 DCHECK_EQ(old_details.attributes(), tmp_details.attributes()); | 356 DCHECK_EQ(old_details.attributes(), tmp_details.attributes()); |
| 350 #endif | 357 #endif |
| 351 if (old_details.kind() == kAccessor && | 358 if (old_details.kind() == kAccessor && |
| 352 !EqualImmutableValues(GetValue(i), tmp_descriptors->GetValue(i))) { | 359 !EqualImmutableValues(GetValue(i), tmp_descriptors->GetValue(i))) { |
| 353 return CopyGeneralizeAllFields("GenAll_Incompatible"); | 360 return CopyGeneralizeAllFields("GenAll_Incompatible"); |
| 354 } | 361 } |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 397 | 404 |
| 398 // Merge "updated" old_descriptor entries with target_descriptor entries. | 405 // Merge "updated" old_descriptor entries with target_descriptor entries. |
| 399 // |root_nof| -> |target_nof| | 406 // |root_nof| -> |target_nof| |
| 400 for (int i = root_nof; i < target_nof; ++i) { | 407 for (int i = root_nof; i < target_nof; ++i) { |
| 401 Handle<Name> key(GetKey(i), isolate_); | 408 Handle<Name> key(GetKey(i), isolate_); |
| 402 PropertyDetails old_details = GetDetails(i); | 409 PropertyDetails old_details = GetDetails(i); |
| 403 PropertyDetails target_details = target_descriptors->GetDetails(i); | 410 PropertyDetails target_details = target_descriptors->GetDetails(i); |
| 404 | 411 |
| 405 PropertyKind next_kind = old_details.kind(); | 412 PropertyKind next_kind = old_details.kind(); |
| 406 PropertyAttributes next_attributes = old_details.attributes(); | 413 PropertyAttributes next_attributes = old_details.attributes(); |
| 414 DCHECK_EQ(next_kind, target_details.kind()); | |
| 415 DCHECK_EQ(next_attributes, target_details.attributes()); | |
| 416 | |
| 417 PropertyConstness next_constness = GeneralizeConstness( | |
| 418 old_details.constness(), target_details.constness()); | |
| 419 | |
| 420 // Note: failed values equality check does not invalidate per-object | |
| 421 // property constness. | |
| 407 PropertyLocation next_location = | 422 PropertyLocation next_location = |
| 408 old_details.location() == kField || | 423 old_details.location() == kField || |
| 409 target_details.location() == kField || | 424 target_details.location() == kField || |
| 410 !EqualImmutableValues(target_descriptors->GetValue(i), | 425 !EqualImmutableValues(target_descriptors->GetValue(i), |
| 411 GetValue(i)) | 426 GetValue(i)) |
| 412 ? kField | 427 ? kField |
| 413 : kDescriptor; | 428 : kDescriptor; |
| 414 | 429 |
| 430 // Ensure that mutable values are stored in fields. | |
| 431 if (next_location == kField) next_constness = kMutable; | |
|
Toon Verwaest
2017/01/18 12:04:05
The description doesn't describe the line above, b
Igor Sheludko
2017/01/18 14:06:43
Done.
| |
| 432 DCHECK_IMPLIES(next_constness == kMutable, next_location == kField); | |
| 433 | |
| 415 Representation next_representation = | 434 Representation next_representation = |
| 416 old_details.representation().generalize( | 435 old_details.representation().generalize( |
| 417 target_details.representation()); | 436 target_details.representation()); |
| 418 | 437 |
| 419 DCHECK_EQ(next_kind, target_details.kind()); | |
| 420 DCHECK_EQ(next_attributes, target_details.attributes()); | |
| 421 | |
| 422 if (next_location == kField) { | 438 if (next_location == kField) { |
| 423 Handle<FieldType> old_field_type = | 439 Handle<FieldType> old_field_type = |
| 424 GetOrComputeFieldType(i, old_details.location(), next_representation); | 440 GetOrComputeFieldType(i, old_details.location(), next_representation); |
| 425 | 441 |
| 426 Handle<FieldType> target_field_type = | 442 Handle<FieldType> target_field_type = |
| 427 GetOrComputeFieldType(target_descriptors, i, | 443 GetOrComputeFieldType(target_descriptors, i, |
| 428 target_details.location(), next_representation); | 444 target_details.location(), next_representation); |
| 429 | 445 |
| 430 Handle<FieldType> next_field_type = Map::GeneralizeFieldType( | 446 Handle<FieldType> next_field_type = Map::GeneralizeFieldType( |
| 431 old_details.representation(), old_field_type, next_representation, | 447 old_details.representation(), old_field_type, next_representation, |
| 432 target_field_type, isolate_); | 448 target_field_type, isolate_); |
| 433 | 449 |
| 434 Handle<Object> wrapped_type(Map::WrapFieldType(next_field_type)); | 450 Handle<Object> wrapped_type(Map::WrapFieldType(next_field_type)); |
| 435 Descriptor d; | 451 Descriptor d; |
| 436 if (next_kind == kData) { | 452 if (next_kind == kData) { |
| 437 d = Descriptor::DataField(key, current_offset, wrapped_type, | 453 d = Descriptor::DataField(key, current_offset, next_attributes, |
| 438 next_attributes, next_representation); | 454 next_constness, next_representation, |
| 455 wrapped_type); | |
| 439 } else { | 456 } else { |
| 440 // TODO(ishell): mutable accessors are not implemented yet. | 457 // TODO(ishell): mutable accessors are not implemented yet. |
| 441 UNIMPLEMENTED(); | 458 UNIMPLEMENTED(); |
| 442 } | 459 } |
| 443 current_offset += d.GetDetails().field_width_in_words(); | 460 current_offset += d.GetDetails().field_width_in_words(); |
| 444 new_descriptors->Set(i, &d); | 461 new_descriptors->Set(i, &d); |
| 445 } else { | 462 } else { |
| 446 DCHECK_EQ(kDescriptor, next_location); | 463 DCHECK_EQ(kDescriptor, next_location); |
| 464 DCHECK_EQ(kConst, next_constness); | |
| 447 | 465 |
| 448 Handle<Object> value(GetValue(i), isolate_); | 466 Handle<Object> value(GetValue(i), isolate_); |
| 449 Descriptor d; | 467 Descriptor d; |
| 450 if (next_kind == kData) { | 468 if (next_kind == kData) { |
| 451 d = Descriptor::DataConstant(key, value, next_attributes); | 469 d = Descriptor::DataConstant(key, value, next_attributes); |
| 452 } else { | 470 } else { |
| 453 DCHECK_EQ(kAccessor, next_kind); | 471 DCHECK_EQ(kAccessor, next_kind); |
| 454 d = Descriptor::AccessorConstant(key, value, next_attributes); | 472 d = Descriptor::AccessorConstant(key, value, next_attributes); |
| 455 } | 473 } |
| 456 new_descriptors->Set(i, &d); | 474 new_descriptors->Set(i, &d); |
| 457 } | 475 } |
| 458 } | 476 } |
| 459 | 477 |
| 460 // Take "updated" old_descriptor entries. | 478 // Take "updated" old_descriptor entries. |
| 461 // |target_nof| -> |old_nof| | 479 // |target_nof| -> |old_nof| |
| 462 for (int i = target_nof; i < old_nof_; ++i) { | 480 for (int i = target_nof; i < old_nof_; ++i) { |
| 463 PropertyDetails old_details = GetDetails(i); | 481 PropertyDetails old_details = GetDetails(i); |
| 464 Handle<Name> key(GetKey(i), isolate_); | 482 Handle<Name> key(GetKey(i), isolate_); |
| 465 | 483 |
| 466 PropertyKind next_kind = old_details.kind(); | 484 PropertyKind next_kind = old_details.kind(); |
| 467 PropertyAttributes next_attributes = old_details.attributes(); | 485 PropertyAttributes next_attributes = old_details.attributes(); |
| 486 PropertyConstness next_constness = old_details.constness(); | |
| 468 PropertyLocation next_location = old_details.location(); | 487 PropertyLocation next_location = old_details.location(); |
| 469 Representation next_representation = old_details.representation(); | 488 Representation next_representation = old_details.representation(); |
| 470 | 489 |
| 471 Descriptor d; | 490 Descriptor d; |
| 472 if (next_location == kField) { | 491 if (next_location == kField) { |
| 492 DCHECK_EQ(kMutable, next_constness); | |
| 473 Handle<FieldType> old_field_type = | 493 Handle<FieldType> old_field_type = |
| 474 GetOrComputeFieldType(i, old_details.location(), next_representation); | 494 GetOrComputeFieldType(i, old_details.location(), next_representation); |
| 475 | 495 |
| 476 Handle<Object> wrapped_type(Map::WrapFieldType(old_field_type)); | 496 Handle<Object> wrapped_type(Map::WrapFieldType(old_field_type)); |
| 477 Descriptor d; | 497 Descriptor d; |
| 478 if (next_kind == kData) { | 498 if (next_kind == kData) { |
| 479 d = Descriptor::DataField(key, current_offset, wrapped_type, | 499 d = Descriptor::DataField(key, current_offset, next_attributes, |
| 480 next_attributes, next_representation); | 500 next_constness, next_representation, |
| 501 wrapped_type); | |
| 481 } else { | 502 } else { |
| 482 // TODO(ishell): mutable accessors are not implemented yet. | 503 // TODO(ishell): mutable accessors are not implemented yet. |
| 483 UNIMPLEMENTED(); | 504 UNIMPLEMENTED(); |
| 484 } | 505 } |
| 485 current_offset += d.GetDetails().field_width_in_words(); | 506 current_offset += d.GetDetails().field_width_in_words(); |
| 486 new_descriptors->Set(i, &d); | 507 new_descriptors->Set(i, &d); |
| 487 } else { | 508 } else { |
| 488 DCHECK_EQ(kDescriptor, next_location); | 509 DCHECK_EQ(kDescriptor, next_location); |
| 510 DCHECK_EQ(kConst, next_constness); | |
| 489 | 511 |
| 490 Handle<Object> value(GetValue(i), isolate_); | 512 Handle<Object> value(GetValue(i), isolate_); |
| 491 if (next_kind == kData) { | 513 if (next_kind == kData) { |
| 492 d = Descriptor::DataConstant(key, value, next_attributes); | 514 d = Descriptor::DataConstant(key, value, next_attributes); |
| 493 } else { | 515 } else { |
| 494 DCHECK_EQ(kAccessor, next_kind); | 516 DCHECK_EQ(kAccessor, next_kind); |
| 495 d = Descriptor::AccessorConstant(key, value, next_attributes); | 517 d = Descriptor::AccessorConstant(key, value, next_attributes); |
| 496 } | 518 } |
| 497 new_descriptors->Set(i, &d); | 519 new_descriptors->Set(i, &d); |
| 498 } | 520 } |
| (...skipping 12 matching lines...) Expand all Loading... | |
| 511 Name* name = descriptors->GetKey(i); | 533 Name* name = descriptors->GetKey(i); |
| 512 PropertyDetails details = descriptors->GetDetails(i); | 534 PropertyDetails details = descriptors->GetDetails(i); |
| 513 Map* next = TransitionArray::SearchTransition(current, details.kind(), name, | 535 Map* next = TransitionArray::SearchTransition(current, details.kind(), name, |
| 514 details.attributes()); | 536 details.attributes()); |
| 515 if (next == NULL) break; | 537 if (next == NULL) break; |
| 516 DescriptorArray* next_descriptors = next->instance_descriptors(); | 538 DescriptorArray* next_descriptors = next->instance_descriptors(); |
| 517 | 539 |
| 518 PropertyDetails next_details = next_descriptors->GetDetails(i); | 540 PropertyDetails next_details = next_descriptors->GetDetails(i); |
| 519 DCHECK_EQ(details.kind(), next_details.kind()); | 541 DCHECK_EQ(details.kind(), next_details.kind()); |
| 520 DCHECK_EQ(details.attributes(), next_details.attributes()); | 542 DCHECK_EQ(details.attributes(), next_details.attributes()); |
| 543 if (details.constness() != next_details.constness()) break; | |
| 521 if (details.location() != next_details.location()) break; | 544 if (details.location() != next_details.location()) break; |
| 522 if (!details.representation().Equals(next_details.representation())) break; | 545 if (!details.representation().Equals(next_details.representation())) break; |
| 523 | 546 |
| 524 if (next_details.location() == kField) { | 547 if (next_details.location() == kField) { |
| 525 FieldType* next_field_type = next_descriptors->GetFieldType(i); | 548 FieldType* next_field_type = next_descriptors->GetFieldType(i); |
| 526 if (!descriptors->GetFieldType(i)->NowIs(next_field_type)) { | 549 if (!descriptors->GetFieldType(i)->NowIs(next_field_type)) { |
| 527 break; | 550 break; |
| 528 } | 551 } |
| 529 } else { | 552 } else { |
| 530 if (!EqualImmutableValues(descriptors->GetValue(i), | 553 if (!EqualImmutableValues(descriptors->GetValue(i), |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 606 // the new descriptors to maintain descriptors sharing invariant. | 629 // the new descriptors to maintain descriptors sharing invariant. |
| 607 split_map->ReplaceDescriptors(*new_descriptors, *new_layout_descriptor); | 630 split_map->ReplaceDescriptors(*new_descriptors, *new_layout_descriptor); |
| 608 | 631 |
| 609 result_map_ = new_map; | 632 result_map_ = new_map; |
| 610 state_ = kEnd; | 633 state_ = kEnd; |
| 611 return state_; // Done. | 634 return state_; // Done. |
| 612 } | 635 } |
| 613 | 636 |
| 614 } // namespace internal | 637 } // namespace internal |
| 615 } // namespace v8 | 638 } // namespace v8 |
| OLD | NEW |