| 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-stubs.h" | 5 #include "src/code-stubs.h" |
| 6 #include "src/compiler/common-operator.h" | 6 #include "src/compiler/common-operator.h" |
| 7 #include "src/compiler/graph-inl.h" | 7 #include "src/compiler/graph-inl.h" |
| 8 #include "src/compiler/js-generic-lowering.h" | 8 #include "src/compiler/js-generic-lowering.h" |
| 9 #include "src/compiler/machine-operator.h" | 9 #include "src/compiler/machine-operator.h" |
| 10 #include "src/compiler/node-aux-data-inl.h" | 10 #include "src/compiler/node-aux-data-inl.h" |
| (...skipping 359 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 Node* function_node = FunctionConstant(function); | 370 Node* function_node = FunctionConstant(function); |
| 371 PatchInsertInput(node, 0, stub_code); | 371 PatchInsertInput(node, 0, stub_code); |
| 372 PatchInsertInput(node, 1, function_node); | 372 PatchInsertInput(node, 1, function_node); |
| 373 PatchOperator(node, common()->Call(desc)); | 373 PatchOperator(node, common()->Call(desc)); |
| 374 } | 374 } |
| 375 | 375 |
| 376 | 376 |
| 377 void JSGenericLowering::ReplaceWithRuntimeCall(Node* node, | 377 void JSGenericLowering::ReplaceWithRuntimeCall(Node* node, |
| 378 Runtime::FunctionId f, | 378 Runtime::FunctionId f, |
| 379 int nargs_override) { | 379 int nargs_override) { |
| 380 Operator::Property props = node->op()->properties(); | 380 Operator::Properties properties = node->op()->properties(); |
| 381 const Runtime::Function* fun = Runtime::FunctionForId(f); | 381 const Runtime::Function* fun = Runtime::FunctionForId(f); |
| 382 int nargs = (nargs_override < 0) ? fun->nargs : nargs_override; | 382 int nargs = (nargs_override < 0) ? fun->nargs : nargs_override; |
| 383 CallDescriptor* desc = linkage()->GetRuntimeCallDescriptor(f, nargs, props); | 383 CallDescriptor* desc = |
| 384 linkage()->GetRuntimeCallDescriptor(f, nargs, properties); |
| 384 Node* ref = ExternalConstant(ExternalReference(f, isolate())); | 385 Node* ref = ExternalConstant(ExternalReference(f, isolate())); |
| 385 Node* arity = Int32Constant(nargs); | 386 Node* arity = Int32Constant(nargs); |
| 386 if (!centrystub_constant_.is_set()) { | 387 if (!centrystub_constant_.is_set()) { |
| 387 centrystub_constant_.set(CodeConstant(CEntryStub(isolate(), 1).GetCode())); | 388 centrystub_constant_.set(CodeConstant(CEntryStub(isolate(), 1).GetCode())); |
| 388 } | 389 } |
| 389 PatchInsertInput(node, 0, centrystub_constant_.get()); | 390 PatchInsertInput(node, 0, centrystub_constant_.get()); |
| 390 PatchInsertInput(node, nargs + 1, ref); | 391 PatchInsertInput(node, nargs + 1, ref); |
| 391 PatchInsertInput(node, nargs + 2, arity); | 392 PatchInsertInput(node, nargs + 2, arity); |
| 392 PatchOperator(node, common()->Call(desc)); | 393 PatchOperator(node, common()->Call(desc)); |
| 393 } | 394 } |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 563 Node* JSGenericLowering::LowerJSCallRuntime(Node* node) { | 564 Node* JSGenericLowering::LowerJSCallRuntime(Node* node) { |
| 564 Runtime::FunctionId function = OpParameter<Runtime::FunctionId>(node); | 565 Runtime::FunctionId function = OpParameter<Runtime::FunctionId>(node); |
| 565 int arity = OperatorProperties::GetValueInputCount(node->op()); | 566 int arity = OperatorProperties::GetValueInputCount(node->op()); |
| 566 ReplaceWithRuntimeCall(node, function, arity); | 567 ReplaceWithRuntimeCall(node, function, arity); |
| 567 return node; | 568 return node; |
| 568 } | 569 } |
| 569 | 570 |
| 570 } // namespace compiler | 571 } // namespace compiler |
| 571 } // namespace internal | 572 } // namespace internal |
| 572 } // namespace v8 | 573 } // namespace v8 |
| OLD | NEW |