OLD | NEW |
---|---|
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 1585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1596 HValue* object, | 1596 HValue* object, |
1597 SmallMapList* types, | 1597 SmallMapList* types, |
1598 Handle<String> name) | 1598 Handle<String> name) |
1599 : types_(Min(types->length(), kMaxLoadPolymorphism)), | 1599 : types_(Min(types->length(), kMaxLoadPolymorphism)), |
1600 name_(name), | 1600 name_(name), |
1601 need_generic_(false) { | 1601 need_generic_(false) { |
1602 SetOperandAt(0, context); | 1602 SetOperandAt(0, context); |
1603 SetOperandAt(1, object); | 1603 SetOperandAt(1, object); |
1604 set_representation(Representation::Tagged()); | 1604 set_representation(Representation::Tagged()); |
1605 SetGVNFlag(kDependsOnMaps); | 1605 SetGVNFlag(kDependsOnMaps); |
1606 int map_transitions = 0; | |
1606 for (int i = 0; | 1607 for (int i = 0; |
1607 i < types->length() && types_.length() < kMaxLoadPolymorphism; | 1608 i < types->length() && types_.length() < kMaxLoadPolymorphism; |
1608 ++i) { | 1609 ++i) { |
1609 Handle<Map> map = types->at(i); | 1610 Handle<Map> map = types->at(i); |
1610 LookupResult lookup(map->GetIsolate()); | 1611 LookupResult lookup(map->GetIsolate()); |
1611 map->LookupInDescriptors(NULL, *name, &lookup); | 1612 map->LookupInDescriptors(NULL, *name, &lookup); |
1612 if (lookup.IsFound()) { | 1613 if (lookup.IsFound()) { |
1613 switch (lookup.type()) { | 1614 switch (lookup.type()) { |
1614 case FIELD: { | 1615 case FIELD: { |
1615 int index = lookup.GetLocalFieldIndexFromMap(*map); | 1616 int index = lookup.GetLocalFieldIndexFromMap(*map); |
1616 if (index < 0) { | 1617 if (index < 0) { |
1617 SetGVNFlag(kDependsOnInobjectFields); | 1618 SetGVNFlag(kDependsOnInobjectFields); |
1618 } else { | 1619 } else { |
1619 SetGVNFlag(kDependsOnBackingStoreFields); | 1620 SetGVNFlag(kDependsOnBackingStoreFields); |
1620 } | 1621 } |
1621 types_.Add(types->at(i)); | 1622 types_.Add(types->at(i)); |
1622 break; | 1623 break; |
1623 } | 1624 } |
1624 case CONSTANT_FUNCTION: | 1625 case CONSTANT_FUNCTION: |
1625 types_.Add(types->at(i)); | 1626 types_.Add(types->at(i)); |
1626 break; | 1627 break; |
1628 case MAP_TRANSITION: | |
Michael Starzinger
2012/05/02 13:39:29
I think that check is not general enough. We have
Sven Panne
2012/05/02 13:55:00
Michael's comment is correct, but things are even
Erik Corry
2012/05/03 10:39:14
All I want to do is to ignore this particular map
| |
1629 // We should just ignore these since they are not relevant to a load | |
1630 // operation. | |
Michael Starzinger
2012/05/03 14:12:22
In this case, this comment should contain somethin
| |
1631 map_transitions++; | |
1632 break; | |
1627 default: | 1633 default: |
Sven Panne
2012/05/02 13:55:00
We should never use a default case when doing a sw
Erik Corry
2012/05/03 10:39:14
I didn't add this default clause. All it is sayin
| |
1628 break; | 1634 break; |
1629 } | 1635 } |
1630 } | 1636 } |
1631 } | 1637 } |
1632 | 1638 |
1633 if (types_.length() == types->length() && FLAG_deoptimize_uncommon_cases) { | 1639 if (types_.length() + map_transitions == types->length() && |
1640 FLAG_deoptimize_uncommon_cases) { | |
1634 SetFlag(kUseGVN); | 1641 SetFlag(kUseGVN); |
1635 } else { | 1642 } else { |
1636 SetAllSideEffects(); | 1643 SetAllSideEffects(); |
1637 need_generic_ = true; | 1644 need_generic_ = true; |
1638 } | 1645 } |
1639 } | 1646 } |
1640 | 1647 |
1641 | 1648 |
1642 bool HLoadNamedFieldPolymorphic::DataEquals(HValue* value) { | 1649 bool HLoadNamedFieldPolymorphic::DataEquals(HValue* value) { |
1643 HLoadNamedFieldPolymorphic* other = HLoadNamedFieldPolymorphic::cast(value); | 1650 HLoadNamedFieldPolymorphic* other = HLoadNamedFieldPolymorphic::cast(value); |
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2428 | 2435 |
2429 | 2436 |
2430 void HCheckPrototypeMaps::Verify() { | 2437 void HCheckPrototypeMaps::Verify() { |
2431 HInstruction::Verify(); | 2438 HInstruction::Verify(); |
2432 ASSERT(HasNoUses()); | 2439 ASSERT(HasNoUses()); |
2433 } | 2440 } |
2434 | 2441 |
2435 #endif | 2442 #endif |
2436 | 2443 |
2437 } } // namespace v8::internal | 2444 } } // namespace v8::internal |
OLD | NEW |