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/code-factory.h" | 5 #include "src/code-factory.h" |
6 #include "src/code-stubs.h" | 6 #include "src/code-stubs.h" |
7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
8 #include "src/compiler/graph-inl.h" | 8 #include "src/compiler/graph-inl.h" |
9 #include "src/compiler/js-generic-lowering.h" | 9 #include "src/compiler/js-generic-lowering.h" |
10 #include "src/compiler/machine-operator.h" | 10 #include "src/compiler/machine-operator.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 } | 169 } |
170 Node* compare = | 170 Node* compare = |
171 graph()->NewNode(common()->Call(desc_compare), | 171 graph()->NewNode(common()->Call(desc_compare), |
172 static_cast<int>(inputs.size()), &inputs.front()); | 172 static_cast<int>(inputs.size()), &inputs.front()); |
173 | 173 |
174 node->ReplaceInput(0, compare); | 174 node->ReplaceInput(0, compare); |
175 node->ReplaceInput(1, SmiConstant(token)); | 175 node->ReplaceInput(1, SmiConstant(token)); |
176 | 176 |
177 if (has_frame_state) { | 177 if (has_frame_state) { |
178 // Remove the frame state from inputs. | 178 // Remove the frame state from inputs. |
179 // TODO(jarin) This should use Node::RemoveInput (which does not exist yet). | 179 node->RemoveInput(NodeProperties::FirstFrameStateIndex(node)); |
180 int dest = NodeProperties::FirstFrameStateIndex(node); | |
181 for (int i = NodeProperties::PastFrameStateIndex(node); | |
182 i < node->InputCount(); i++) { | |
183 node->ReplaceInput(dest, node->InputAt(i)); | |
184 dest++; | |
185 } | |
186 node->TrimInputCount(dest); | |
187 } | 180 } |
188 | 181 |
189 ReplaceWithRuntimeCall(node, Runtime::kBooleanize); | 182 ReplaceWithRuntimeCall(node, Runtime::kBooleanize); |
190 } | 183 } |
191 | 184 |
192 | 185 |
193 void JSGenericLowering::ReplaceWithStubCall(Node* node, Callable callable, | 186 void JSGenericLowering::ReplaceWithStubCall(Node* node, Callable callable, |
194 CallDescriptor::Flags flags) { | 187 CallDescriptor::Flags flags) { |
195 CallDescriptor* desc = linkage()->GetStubCallDescriptor( | 188 CallDescriptor* desc = linkage()->GetStubCallDescriptor( |
196 callable.descriptor(), 0, flags | FlagsForNode(node)); | 189 callable.descriptor(), 0, flags | FlagsForNode(node)); |
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 | 394 |
402 void JSGenericLowering::LowerJSCallRuntime(Node* node) { | 395 void JSGenericLowering::LowerJSCallRuntime(Node* node) { |
403 Runtime::FunctionId function = OpParameter<Runtime::FunctionId>(node); | 396 Runtime::FunctionId function = OpParameter<Runtime::FunctionId>(node); |
404 int arity = OperatorProperties::GetValueInputCount(node->op()); | 397 int arity = OperatorProperties::GetValueInputCount(node->op()); |
405 ReplaceWithRuntimeCall(node, function, arity); | 398 ReplaceWithRuntimeCall(node, function, arity); |
406 } | 399 } |
407 | 400 |
408 } // namespace compiler | 401 } // namespace compiler |
409 } // namespace internal | 402 } // namespace internal |
410 } // namespace v8 | 403 } // namespace v8 |
OLD | NEW |