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-call-reducer.h" | 5 #include "src/compiler/js-call-reducer.h" |
6 | 6 |
7 #include "src/compiler/js-graph.h" | 7 #include "src/compiler/js-graph.h" |
8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
9 #include "src/compiler/simplified-operator.h" | 9 #include "src/compiler/simplified-operator.h" |
10 #include "src/objects-inl.h" | 10 #include "src/objects-inl.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 for (Edge edge : arg_array->use_edges()) { | 122 for (Edge edge : arg_array->use_edges()) { |
123 if (edge.from()->opcode() == IrOpcode::kStateValues) continue; | 123 if (edge.from()->opcode() == IrOpcode::kStateValues) continue; |
124 if (!NodeProperties::IsValueEdge(edge)) continue; | 124 if (!NodeProperties::IsValueEdge(edge)) continue; |
125 if (edge.from() == node) continue; | 125 if (edge.from() == node) continue; |
126 return NoChange(); | 126 return NoChange(); |
127 } | 127 } |
128 // Get to the actual frame state from which to extract the arguments; | 128 // Get to the actual frame state from which to extract the arguments; |
129 // we can only optimize this in case the {node} was already inlined into | 129 // we can only optimize this in case the {node} was already inlined into |
130 // some other function (and same for the {arg_array}). | 130 // some other function (and same for the {arg_array}). |
131 CreateArgumentsType type = CreateArgumentsTypeOf(arg_array->op()); | 131 CreateArgumentsType type = CreateArgumentsTypeOf(arg_array->op()); |
132 Node* frame_state = NodeProperties::GetFrameStateInput(arg_array, 0); | 132 Node* frame_state = NodeProperties::GetFrameStateInput(arg_array); |
133 Node* outer_state = frame_state->InputAt(kFrameStateOuterStateInput); | 133 Node* outer_state = frame_state->InputAt(kFrameStateOuterStateInput); |
134 if (outer_state->opcode() != IrOpcode::kFrameState) return NoChange(); | 134 if (outer_state->opcode() != IrOpcode::kFrameState) return NoChange(); |
135 FrameStateInfo outer_info = OpParameter<FrameStateInfo>(outer_state); | 135 FrameStateInfo outer_info = OpParameter<FrameStateInfo>(outer_state); |
136 if (outer_info.type() == FrameStateType::kArgumentsAdaptor) { | 136 if (outer_info.type() == FrameStateType::kArgumentsAdaptor) { |
137 // Need to take the parameters from the arguments adaptor. | 137 // Need to take the parameters from the arguments adaptor. |
138 frame_state = outer_state; | 138 frame_state = outer_state; |
139 } | 139 } |
140 FrameStateInfo state_info = OpParameter<FrameStateInfo>(frame_state); | 140 FrameStateInfo state_info = OpParameter<FrameStateInfo>(frame_state); |
141 int start_index = 0; | 141 int start_index = 0; |
142 if (type == CreateArgumentsType::kMappedArguments) { | 142 if (type == CreateArgumentsType::kMappedArguments) { |
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 return jsgraph()->javascript(); | 503 return jsgraph()->javascript(); |
504 } | 504 } |
505 | 505 |
506 SimplifiedOperatorBuilder* JSCallReducer::simplified() const { | 506 SimplifiedOperatorBuilder* JSCallReducer::simplified() const { |
507 return jsgraph()->simplified(); | 507 return jsgraph()->simplified(); |
508 } | 508 } |
509 | 509 |
510 } // namespace compiler | 510 } // namespace compiler |
511 } // namespace internal | 511 } // namespace internal |
512 } // namespace v8 | 512 } // namespace v8 |
OLD | NEW |