| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/compiler/js-inlining.h" | 5 #include "src/compiler/js-inlining.h" |
| 6 | 6 |
| 7 #include "src/ast/ast.h" | 7 #include "src/ast/ast.h" |
| 8 #include "src/compilation-info.h" | 8 #include "src/compilation-info.h" |
| 9 #include "src/compiler.h" | 9 #include "src/compiler.h" |
| 10 #include "src/compiler/all-nodes.h" | 10 #include "src/compiler/all-nodes.h" |
| (...skipping 289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 300 // | 300 // |
| 301 // SmallMapSet NodeProperties::CollectMapWitness(receiver, effect) | 301 // SmallMapSet NodeProperties::CollectMapWitness(receiver, effect) |
| 302 // | 302 // |
| 303 // function, which either returns the map set from the CheckMaps or | 303 // function, which either returns the map set from the CheckMaps or |
| 304 // a singleton set from a StoreField. | 304 // a singleton set from a StoreField. |
| 305 bool NeedsConvertReceiver(Node* receiver, Node* effect) { | 305 bool NeedsConvertReceiver(Node* receiver, Node* effect) { |
| 306 for (Node* dominator = effect;;) { | 306 for (Node* dominator = effect;;) { |
| 307 if (dominator->opcode() == IrOpcode::kCheckMaps && | 307 if (dominator->opcode() == IrOpcode::kCheckMaps && |
| 308 IsSame(dominator->InputAt(0), receiver)) { | 308 IsSame(dominator->InputAt(0), receiver)) { |
| 309 // Check if all maps have the given {instance_type}. | 309 // Check if all maps have the given {instance_type}. |
| 310 for (int i = 1; i < dominator->op()->ValueInputCount(); ++i) { | 310 ZoneHandleSet<Map> const& maps = |
| 311 HeapObjectMatcher m(NodeProperties::GetValueInput(dominator, i)); | 311 CheckMapsParametersOf(dominator->op()).maps(); |
| 312 if (!m.HasValue()) return true; | 312 for (size_t i = 0; i < maps.size(); ++i) { |
| 313 Handle<Map> const map = Handle<Map>::cast(m.Value()); | 313 if (!maps[i]->IsJSReceiverMap()) return true; |
| 314 if (!map->IsJSReceiverMap()) return true; | |
| 315 } | 314 } |
| 316 return false; | 315 return false; |
| 317 } | 316 } |
| 318 switch (dominator->opcode()) { | 317 switch (dominator->opcode()) { |
| 319 case IrOpcode::kStoreField: { | 318 case IrOpcode::kStoreField: { |
| 320 FieldAccess const& access = FieldAccessOf(dominator->op()); | 319 FieldAccess const& access = FieldAccessOf(dominator->op()); |
| 321 if (access.base_is_tagged == kTaggedBase && | 320 if (access.base_is_tagged == kTaggedBase && |
| 322 access.offset == HeapObject::kMapOffset) { | 321 access.offset == HeapObject::kMapOffset) { |
| 323 return true; | 322 return true; |
| 324 } | 323 } |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 670 | 669 |
| 671 CommonOperatorBuilder* JSInliner::common() const { return jsgraph()->common(); } | 670 CommonOperatorBuilder* JSInliner::common() const { return jsgraph()->common(); } |
| 672 | 671 |
| 673 SimplifiedOperatorBuilder* JSInliner::simplified() const { | 672 SimplifiedOperatorBuilder* JSInliner::simplified() const { |
| 674 return jsgraph()->simplified(); | 673 return jsgraph()->simplified(); |
| 675 } | 674 } |
| 676 | 675 |
| 677 } // namespace compiler | 676 } // namespace compiler |
| 678 } // namespace internal | 677 } // namespace internal |
| 679 } // namespace v8 | 678 } // namespace v8 |
| OLD | NEW |