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 "src/compiler/js-type-feedback-lowering.h" | 5 #include "src/compiler/js-type-feedback-lowering.h" |
6 | 6 |
7 #include "src/compiler/access-builder.h" | 7 #include "src/compiler/access-builder.h" |
8 #include "src/compiler/js-graph.h" | 8 #include "src/compiler/js-graph.h" |
9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
10 #include "src/objects-inl.h" // TODO(mstarzinger): Temporary cycle breaker! | 10 #include "src/objects-inl.h" // TODO(mstarzinger): Temporary cycle breaker! |
(...skipping 25 matching lines...) Expand all Loading... |
36 Reduction JSTypeFeedbackLowering::ReduceJSLoadNamed(Node* node) { | 36 Reduction JSTypeFeedbackLowering::ReduceJSLoadNamed(Node* node) { |
37 DCHECK_EQ(IrOpcode::kJSLoadNamed, node->opcode()); | 37 DCHECK_EQ(IrOpcode::kJSLoadNamed, node->opcode()); |
38 Node* receiver = NodeProperties::GetValueInput(node, 0); | 38 Node* receiver = NodeProperties::GetValueInput(node, 0); |
39 Type* receiver_type = NodeProperties::GetType(receiver); | 39 Type* receiver_type = NodeProperties::GetType(receiver); |
40 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); | 40 Node* frame_state = NodeProperties::GetFrameStateInput(node, 1); |
41 Node* effect = NodeProperties::GetEffectInput(node); | 41 Node* effect = NodeProperties::GetEffectInput(node); |
42 Node* control = NodeProperties::GetControlInput(node); | 42 Node* control = NodeProperties::GetControlInput(node); |
43 // We need to make optimistic assumptions to continue. | 43 // We need to make optimistic assumptions to continue. |
44 if (!(flags() & kDeoptimizationEnabled)) return NoChange(); | 44 if (!(flags() & kDeoptimizationEnabled)) return NoChange(); |
45 LoadNamedParameters const& p = LoadNamedParametersOf(node->op()); | 45 LoadNamedParameters const& p = LoadNamedParametersOf(node->op()); |
46 if (p.feedback().vector().is_null()) return NoChange(); | 46 if (!p.feedback().IsValid()) return NoChange(); // No feedback. |
47 if (p.name().is_identical_to(factory()->length_string())) { | 47 if (p.name().is_identical_to(factory()->length_string())) { |
48 LoadICNexus nexus(p.feedback().vector(), p.feedback().slot()); | 48 LoadICNexus nexus(p.feedback().vector(), p.feedback().slot()); |
49 MapHandleList maps; | 49 MapHandleList maps; |
50 if (nexus.ExtractMaps(&maps) > 0) { | 50 if (nexus.ExtractMaps(&maps) > 0) { |
51 for (Handle<Map> map : maps) { | 51 for (Handle<Map> map : maps) { |
52 if (map->instance_type() >= FIRST_NONSTRING_TYPE) return NoChange(); | 52 if (map->instance_type() >= FIRST_NONSTRING_TYPE) return NoChange(); |
53 } | 53 } |
54 // Optimistic optimization for "length" property of strings. | 54 // Optimistic optimization for "length" property of strings. |
55 if (receiver_type->Maybe(Type::TaggedSigned())) { | 55 if (receiver_type->Maybe(Type::TaggedSigned())) { |
56 Node* check = graph()->NewNode(simplified()->ObjectIsSmi(), receiver); | 56 Node* check = graph()->NewNode(simplified()->ObjectIsSmi(), receiver); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 } | 110 } |
111 | 111 |
112 | 112 |
113 MachineOperatorBuilder* JSTypeFeedbackLowering::machine() const { | 113 MachineOperatorBuilder* JSTypeFeedbackLowering::machine() const { |
114 return jsgraph()->machine(); | 114 return jsgraph()->machine(); |
115 } | 115 } |
116 | 116 |
117 } // namespace compiler | 117 } // namespace compiler |
118 } // namespace internal | 118 } // namespace internal |
119 } // namespace v8 | 119 } // namespace v8 |
OLD | NEW |