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 (!IsGeneralizableTo(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 (!IsGeneralizableTo(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 } |
289 | 297 |
290 if (tmp_details.location() == kField) { | 298 if (tmp_details.location() == kField) { |
(...skipping 43 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 // TODO(ishell): remove once constant field tracking is done. |
| 431 if (next_location == kField) next_constness = kMutable; |
| 432 // Ensure that mutable values are stored in fields. |
| 433 DCHECK_IMPLIES(next_constness == kMutable, next_location == kField); |
| 434 |
415 Representation next_representation = | 435 Representation next_representation = |
416 old_details.representation().generalize( | 436 old_details.representation().generalize( |
417 target_details.representation()); | 437 target_details.representation()); |
418 | 438 |
419 DCHECK_EQ(next_kind, target_details.kind()); | |
420 DCHECK_EQ(next_attributes, target_details.attributes()); | |
421 | |
422 if (next_location == kField) { | 439 if (next_location == kField) { |
423 Handle<FieldType> old_field_type = | 440 Handle<FieldType> old_field_type = |
424 GetOrComputeFieldType(i, old_details.location(), next_representation); | 441 GetOrComputeFieldType(i, old_details.location(), next_representation); |
425 | 442 |
426 Handle<FieldType> target_field_type = | 443 Handle<FieldType> target_field_type = |
427 GetOrComputeFieldType(target_descriptors, i, | 444 GetOrComputeFieldType(target_descriptors, i, |
428 target_details.location(), next_representation); | 445 target_details.location(), next_representation); |
429 | 446 |
430 Handle<FieldType> next_field_type = Map::GeneralizeFieldType( | 447 Handle<FieldType> next_field_type = Map::GeneralizeFieldType( |
431 old_details.representation(), old_field_type, next_representation, | 448 old_details.representation(), old_field_type, next_representation, |
432 target_field_type, isolate_); | 449 target_field_type, isolate_); |
433 | 450 |
434 Handle<Object> wrapped_type(Map::WrapFieldType(next_field_type)); | 451 Handle<Object> wrapped_type(Map::WrapFieldType(next_field_type)); |
435 Descriptor d; | 452 Descriptor d; |
436 if (next_kind == kData) { | 453 if (next_kind == kData) { |
437 d = Descriptor::DataField(key, current_offset, wrapped_type, | 454 d = Descriptor::DataField(key, current_offset, next_attributes, |
438 next_attributes, next_representation); | 455 next_constness, next_representation, |
| 456 wrapped_type); |
439 } else { | 457 } else { |
440 // TODO(ishell): mutable accessors are not implemented yet. | 458 // TODO(ishell): mutable accessors are not implemented yet. |
441 UNIMPLEMENTED(); | 459 UNIMPLEMENTED(); |
442 } | 460 } |
443 current_offset += d.GetDetails().field_width_in_words(); | 461 current_offset += d.GetDetails().field_width_in_words(); |
444 new_descriptors->Set(i, &d); | 462 new_descriptors->Set(i, &d); |
445 } else { | 463 } else { |
446 DCHECK_EQ(kDescriptor, next_location); | 464 DCHECK_EQ(kDescriptor, next_location); |
| 465 DCHECK_EQ(kConst, next_constness); |
447 | 466 |
448 Handle<Object> value(GetValue(i), isolate_); | 467 Handle<Object> value(GetValue(i), isolate_); |
449 Descriptor d; | 468 Descriptor d; |
450 if (next_kind == kData) { | 469 if (next_kind == kData) { |
451 d = Descriptor::DataConstant(key, value, next_attributes); | 470 d = Descriptor::DataConstant(key, value, next_attributes); |
452 } else { | 471 } else { |
453 DCHECK_EQ(kAccessor, next_kind); | 472 DCHECK_EQ(kAccessor, next_kind); |
454 d = Descriptor::AccessorConstant(key, value, next_attributes); | 473 d = Descriptor::AccessorConstant(key, value, next_attributes); |
455 } | 474 } |
456 new_descriptors->Set(i, &d); | 475 new_descriptors->Set(i, &d); |
457 } | 476 } |
458 } | 477 } |
459 | 478 |
460 // Take "updated" old_descriptor entries. | 479 // Take "updated" old_descriptor entries. |
461 // |target_nof| -> |old_nof| | 480 // |target_nof| -> |old_nof| |
462 for (int i = target_nof; i < old_nof_; ++i) { | 481 for (int i = target_nof; i < old_nof_; ++i) { |
463 PropertyDetails old_details = GetDetails(i); | 482 PropertyDetails old_details = GetDetails(i); |
464 Handle<Name> key(GetKey(i), isolate_); | 483 Handle<Name> key(GetKey(i), isolate_); |
465 | 484 |
466 PropertyKind next_kind = old_details.kind(); | 485 PropertyKind next_kind = old_details.kind(); |
467 PropertyAttributes next_attributes = old_details.attributes(); | 486 PropertyAttributes next_attributes = old_details.attributes(); |
| 487 PropertyConstness next_constness = old_details.constness(); |
468 PropertyLocation next_location = old_details.location(); | 488 PropertyLocation next_location = old_details.location(); |
469 Representation next_representation = old_details.representation(); | 489 Representation next_representation = old_details.representation(); |
470 | 490 |
471 Descriptor d; | 491 Descriptor d; |
472 if (next_location == kField) { | 492 if (next_location == kField) { |
| 493 DCHECK_EQ(kMutable, next_constness); |
473 Handle<FieldType> old_field_type = | 494 Handle<FieldType> old_field_type = |
474 GetOrComputeFieldType(i, old_details.location(), next_representation); | 495 GetOrComputeFieldType(i, old_details.location(), next_representation); |
475 | 496 |
476 Handle<Object> wrapped_type(Map::WrapFieldType(old_field_type)); | 497 Handle<Object> wrapped_type(Map::WrapFieldType(old_field_type)); |
477 Descriptor d; | 498 Descriptor d; |
478 if (next_kind == kData) { | 499 if (next_kind == kData) { |
479 d = Descriptor::DataField(key, current_offset, wrapped_type, | 500 d = Descriptor::DataField(key, current_offset, next_attributes, |
480 next_attributes, next_representation); | 501 next_constness, next_representation, |
| 502 wrapped_type); |
481 } else { | 503 } else { |
482 // TODO(ishell): mutable accessors are not implemented yet. | 504 // TODO(ishell): mutable accessors are not implemented yet. |
483 UNIMPLEMENTED(); | 505 UNIMPLEMENTED(); |
484 } | 506 } |
485 current_offset += d.GetDetails().field_width_in_words(); | 507 current_offset += d.GetDetails().field_width_in_words(); |
486 new_descriptors->Set(i, &d); | 508 new_descriptors->Set(i, &d); |
487 } else { | 509 } else { |
488 DCHECK_EQ(kDescriptor, next_location); | 510 DCHECK_EQ(kDescriptor, next_location); |
| 511 DCHECK_EQ(kConst, next_constness); |
489 | 512 |
490 Handle<Object> value(GetValue(i), isolate_); | 513 Handle<Object> value(GetValue(i), isolate_); |
491 if (next_kind == kData) { | 514 if (next_kind == kData) { |
492 d = Descriptor::DataConstant(key, value, next_attributes); | 515 d = Descriptor::DataConstant(key, value, next_attributes); |
493 } else { | 516 } else { |
494 DCHECK_EQ(kAccessor, next_kind); | 517 DCHECK_EQ(kAccessor, next_kind); |
495 d = Descriptor::AccessorConstant(key, value, next_attributes); | 518 d = Descriptor::AccessorConstant(key, value, next_attributes); |
496 } | 519 } |
497 new_descriptors->Set(i, &d); | 520 new_descriptors->Set(i, &d); |
498 } | 521 } |
(...skipping 12 matching lines...) Expand all Loading... |
511 Name* name = descriptors->GetKey(i); | 534 Name* name = descriptors->GetKey(i); |
512 PropertyDetails details = descriptors->GetDetails(i); | 535 PropertyDetails details = descriptors->GetDetails(i); |
513 Map* next = TransitionArray::SearchTransition(current, details.kind(), name, | 536 Map* next = TransitionArray::SearchTransition(current, details.kind(), name, |
514 details.attributes()); | 537 details.attributes()); |
515 if (next == NULL) break; | 538 if (next == NULL) break; |
516 DescriptorArray* next_descriptors = next->instance_descriptors(); | 539 DescriptorArray* next_descriptors = next->instance_descriptors(); |
517 | 540 |
518 PropertyDetails next_details = next_descriptors->GetDetails(i); | 541 PropertyDetails next_details = next_descriptors->GetDetails(i); |
519 DCHECK_EQ(details.kind(), next_details.kind()); | 542 DCHECK_EQ(details.kind(), next_details.kind()); |
520 DCHECK_EQ(details.attributes(), next_details.attributes()); | 543 DCHECK_EQ(details.attributes(), next_details.attributes()); |
| 544 if (details.constness() != next_details.constness()) break; |
521 if (details.location() != next_details.location()) break; | 545 if (details.location() != next_details.location()) break; |
522 if (!details.representation().Equals(next_details.representation())) break; | 546 if (!details.representation().Equals(next_details.representation())) break; |
523 | 547 |
524 if (next_details.location() == kField) { | 548 if (next_details.location() == kField) { |
525 FieldType* next_field_type = next_descriptors->GetFieldType(i); | 549 FieldType* next_field_type = next_descriptors->GetFieldType(i); |
526 if (!descriptors->GetFieldType(i)->NowIs(next_field_type)) { | 550 if (!descriptors->GetFieldType(i)->NowIs(next_field_type)) { |
527 break; | 551 break; |
528 } | 552 } |
529 } else { | 553 } else { |
530 if (!EqualImmutableValues(descriptors->GetValue(i), | 554 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. | 630 // the new descriptors to maintain descriptors sharing invariant. |
607 split_map->ReplaceDescriptors(*new_descriptors, *new_layout_descriptor); | 631 split_map->ReplaceDescriptors(*new_descriptors, *new_layout_descriptor); |
608 | 632 |
609 result_map_ = new_map; | 633 result_map_ = new_map; |
610 state_ = kEnd; | 634 state_ = kEnd; |
611 return state_; // Done. | 635 return state_; // Done. |
612 } | 636 } |
613 | 637 |
614 } // namespace internal | 638 } // namespace internal |
615 } // namespace v8 | 639 } // namespace v8 |
OLD | NEW |