| Index: src/compiler/js-builtin-reducer.cc
|
| diff --git a/src/compiler/js-builtin-reducer.cc b/src/compiler/js-builtin-reducer.cc
|
| index 762020438878fdbc5566ba07848fd601c870b6ca..b4db6fe2b0696f8e5f10fd3e4f1f959f345064c7 100644
|
| --- a/src/compiler/js-builtin-reducer.cc
|
| +++ b/src/compiler/js-builtin-reducer.cc
|
| @@ -113,11 +113,10 @@ MaybeHandle<Map> GetMapWitness(Node* node) {
|
| for (Node* dominator = effect;;) {
|
| if (dominator->opcode() == IrOpcode::kCheckMaps &&
|
| dominator->InputAt(0) == receiver) {
|
| - if (dominator->op()->ValueInputCount() == 2) {
|
| - HeapObjectMatcher m(dominator->InputAt(1));
|
| - if (m.HasValue()) return Handle<Map>::cast(m.Value());
|
| - }
|
| - return MaybeHandle<Map>();
|
| + ZoneHandleSet<Map> const& maps =
|
| + CheckMapsParametersOf(dominator->op()).maps();
|
| + return (maps.size() == 1) ? MaybeHandle<Map>(maps[0])
|
| + : MaybeHandle<Map>();
|
| }
|
| if (dominator->op()->EffectInputCount() != 1) {
|
| // Didn't find any appropriate CheckMaps node.
|
| @@ -326,14 +325,11 @@ bool HasInstanceTypeWitness(Node* receiver, Node* effect,
|
| for (Node* dominator = effect;;) {
|
| if (dominator->opcode() == IrOpcode::kCheckMaps &&
|
| dominator->InputAt(0) == receiver) {
|
| + ZoneHandleSet<Map> const& maps =
|
| + CheckMapsParametersOf(dominator->op()).maps();
|
| // Check if all maps have the given {instance_type}.
|
| - for (int i = 1; i < dominator->op()->ValueInputCount(); ++i) {
|
| - Node* const map = NodeProperties::GetValueInput(dominator, i);
|
| - Type* const map_type = NodeProperties::GetType(map);
|
| - if (!map_type->IsConstant()) return false;
|
| - Handle<Map> const map_value =
|
| - Handle<Map>::cast(map_type->AsConstant()->Value());
|
| - if (map_value->instance_type() != instance_type) return false;
|
| + for (size_t i = 0; i < maps.size(); ++i) {
|
| + if (maps[i]->instance_type() != instance_type) return false;
|
| }
|
| return true;
|
| }
|
|
|