OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 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 <ostream> | 5 #include <ostream> |
6 | 6 |
7 #include "src/accessors.h" | 7 #include "src/accessors.h" |
8 #include "src/compilation-dependencies.h" | 8 #include "src/compilation-dependencies.h" |
9 #include "src/compiler/access-info.h" | 9 #include "src/compiler/access-info.h" |
10 #include "src/compiler/type-cache.h" | 10 #include "src/compiler/type-cache.h" |
(...skipping 497 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
508 return true; | 508 return true; |
509 } | 509 } |
510 return false; | 510 return false; |
511 } | 511 } |
512 | 512 |
513 | 513 |
514 bool AccessInfoFactory::LookupTransition(Handle<Map> map, Handle<Name> name, | 514 bool AccessInfoFactory::LookupTransition(Handle<Map> map, Handle<Name> name, |
515 MaybeHandle<JSObject> holder, | 515 MaybeHandle<JSObject> holder, |
516 PropertyAccessInfo* access_info) { | 516 PropertyAccessInfo* access_info) { |
517 // Check if the {map} has a data transition with the given {name}. | 517 // Check if the {map} has a data transition with the given {name}. |
518 if (map->unused_property_fields() == 0) { | |
519 *access_info = PropertyAccessInfo::Generic(MapList{map}); | |
520 return true; | |
521 } | |
522 Handle<Map> transition_map; | 518 Handle<Map> transition_map; |
523 if (TransitionArray::SearchTransition(map, kData, name, NONE) | 519 if (TransitionArray::SearchTransition(map, kData, name, NONE) |
524 .ToHandle(&transition_map)) { | 520 .ToHandle(&transition_map)) { |
525 int const number = transition_map->LastAdded(); | 521 int const number = transition_map->LastAdded(); |
526 PropertyDetails const details = | 522 PropertyDetails const details = |
527 transition_map->instance_descriptors()->GetDetails(number); | 523 transition_map->instance_descriptors()->GetDetails(number); |
528 // Don't bother optimizing stores to read-only properties. | 524 // Don't bother optimizing stores to read-only properties. |
529 if (details.IsReadOnly()) return false; | 525 if (details.IsReadOnly()) return false; |
530 // TODO(bmeurer): Handle transition to data constant? | 526 // TODO(bmeurer): Handle transition to data constant? |
531 if (details.location() != kField) return false; | 527 if (details.location() != kField) return false; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 } | 568 } |
573 return false; | 569 return false; |
574 } | 570 } |
575 | 571 |
576 | 572 |
577 Factory* AccessInfoFactory::factory() const { return isolate()->factory(); } | 573 Factory* AccessInfoFactory::factory() const { return isolate()->factory(); } |
578 | 574 |
579 } // namespace compiler | 575 } // namespace compiler |
580 } // namespace internal | 576 } // namespace internal |
581 } // namespace v8 | 577 } // namespace v8 |
OLD | NEW |