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-numbering.h" | 7 #include "src/ast/ast-numbering.h" |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 #include "src/compilation-info.h" | 9 #include "src/compilation-info.h" |
10 #include "src/compiler.h" | 10 #include "src/compiler.h" |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 // | 291 // |
292 // SmallMapSet NodeProperties::CollectMapWitness(receiver, effect) | 292 // SmallMapSet NodeProperties::CollectMapWitness(receiver, effect) |
293 // | 293 // |
294 // function, which either returns the map set from the CheckMaps or | 294 // function, which either returns the map set from the CheckMaps or |
295 // a singleton set from a StoreField. | 295 // a singleton set from a StoreField. |
296 bool NeedsConvertReceiver(Node* receiver, Node* effect) { | 296 bool NeedsConvertReceiver(Node* receiver, Node* effect) { |
297 for (Node* dominator = effect;;) { | 297 for (Node* dominator = effect;;) { |
298 if (dominator->opcode() == IrOpcode::kCheckMaps && | 298 if (dominator->opcode() == IrOpcode::kCheckMaps && |
299 dominator->InputAt(0) == receiver) { | 299 dominator->InputAt(0) == receiver) { |
300 // Check if all maps have the given {instance_type}. | 300 // Check if all maps have the given {instance_type}. |
301 for (int i = 1; i < dominator->op()->ValueInputCount(); ++i) { | 301 ZoneHandleSet<Map> const& maps = |
302 HeapObjectMatcher m(NodeProperties::GetValueInput(dominator, i)); | 302 CheckMapsParametersOf(dominator->op()).maps(); |
303 if (!m.HasValue()) return true; | 303 for (size_t i = 0; i < maps.size(); ++i) { |
304 Handle<Map> const map = Handle<Map>::cast(m.Value()); | 304 if (!maps[i]->IsJSReceiverMap()) return true; |
305 if (!map->IsJSReceiverMap()) return true; | |
306 } | 305 } |
307 return false; | 306 return false; |
308 } | 307 } |
309 switch (dominator->opcode()) { | 308 switch (dominator->opcode()) { |
310 case IrOpcode::kStoreField: { | 309 case IrOpcode::kStoreField: { |
311 FieldAccess const& access = FieldAccessOf(dominator->op()); | 310 FieldAccess const& access = FieldAccessOf(dominator->op()); |
312 if (access.base_is_tagged == kTaggedBase && | 311 if (access.base_is_tagged == kTaggedBase && |
313 access.offset == HeapObject::kMapOffset) { | 312 access.offset == HeapObject::kMapOffset) { |
314 return true; | 313 return true; |
315 } | 314 } |
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
691 | 690 |
692 CommonOperatorBuilder* JSInliner::common() const { return jsgraph()->common(); } | 691 CommonOperatorBuilder* JSInliner::common() const { return jsgraph()->common(); } |
693 | 692 |
694 SimplifiedOperatorBuilder* JSInliner::simplified() const { | 693 SimplifiedOperatorBuilder* JSInliner::simplified() const { |
695 return jsgraph()->simplified(); | 694 return jsgraph()->simplified(); |
696 } | 695 } |
697 | 696 |
698 } // namespace compiler | 697 } // namespace compiler |
699 } // namespace internal | 698 } // namespace internal |
700 } // namespace v8 | 699 } // namespace v8 |
OLD | NEW |