 Chromium Code Reviews
 Chromium Code Reviews Issue 709033002:
  Teach TurboFan to call C functions with result_size > 1.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
    
  
    Issue 709033002:
  Teach TurboFan to call C functions with result_size > 1.  (Closed) 
  Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge| 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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 216 void JSGenericLowering::ReplaceWithRuntimeCall(Node* node, | 216 void JSGenericLowering::ReplaceWithRuntimeCall(Node* node, | 
| 217 Runtime::FunctionId f, | 217 Runtime::FunctionId f, | 
| 218 int nargs_override) { | 218 int nargs_override) { | 
| 219 Operator::Properties properties = node->op()->properties(); | 219 Operator::Properties properties = node->op()->properties(); | 
| 220 const Runtime::Function* fun = Runtime::FunctionForId(f); | 220 const Runtime::Function* fun = Runtime::FunctionForId(f); | 
| 221 int nargs = (nargs_override < 0) ? fun->nargs : nargs_override; | 221 int nargs = (nargs_override < 0) ? fun->nargs : nargs_override; | 
| 222 CallDescriptor* desc = | 222 CallDescriptor* desc = | 
| 223 linkage()->GetRuntimeCallDescriptor(f, nargs, properties); | 223 linkage()->GetRuntimeCallDescriptor(f, nargs, properties); | 
| 224 Node* ref = ExternalConstant(ExternalReference(f, isolate())); | 224 Node* ref = ExternalConstant(ExternalReference(f, isolate())); | 
| 225 Node* arity = Int32Constant(nargs); | 225 Node* arity = Int32Constant(nargs); | 
| 226 PatchInsertInput(node, 0, jsgraph()->CEntryStubConstant()); | 226 CEntryStub stub(isolate(), fun->result_size); | 
| 
titzer
2014/11/07 14:41:12
Can you make the result size a parameter to the JS
 
mvstanton
2014/11/07 14:49:38
Done.
 | |
| 227 Node* stub_code = CodeConstant(stub.GetCode()); | |
| 228 PatchInsertInput(node, 0, stub_code); | |
| 227 PatchInsertInput(node, nargs + 1, ref); | 229 PatchInsertInput(node, nargs + 1, ref); | 
| 228 PatchInsertInput(node, nargs + 2, arity); | 230 PatchInsertInput(node, nargs + 2, arity); | 
| 229 PatchOperator(node, common()->Call(desc)); | 231 PatchOperator(node, common()->Call(desc)); | 
| 230 } | 232 } | 
| 231 | 233 | 
| 232 | 234 | 
| 233 void JSGenericLowering::LowerBranch(Node* node) { | 235 void JSGenericLowering::LowerBranch(Node* node) { | 
| 234 if (!info()->is_typing_enabled()) { | 236 if (!info()->is_typing_enabled()) { | 
| 235 // TODO(mstarzinger): If typing is enabled then simplified lowering will | 237 // TODO(mstarzinger): If typing is enabled then simplified lowering will | 
| 236 // have inserted the correct ChangeBoolToBit, otherwise we need to perform | 238 // have inserted the correct ChangeBoolToBit, otherwise we need to perform | 
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 443 | 445 | 
| 444 | 446 | 
| 445 void JSGenericLowering::LowerJSCallRuntime(Node* node) { | 447 void JSGenericLowering::LowerJSCallRuntime(Node* node) { | 
| 446 const CallRuntimeParameters& p = CallRuntimeParametersOf(node->op()); | 448 const CallRuntimeParameters& p = CallRuntimeParametersOf(node->op()); | 
| 447 ReplaceWithRuntimeCall(node, p.id(), static_cast<int>(p.arity())); | 449 ReplaceWithRuntimeCall(node, p.id(), static_cast<int>(p.arity())); | 
| 448 } | 450 } | 
| 449 | 451 | 
| 450 } // namespace compiler | 452 } // namespace compiler | 
| 451 } // namespace internal | 453 } // namespace internal | 
| 452 } // namespace v8 | 454 } // namespace v8 | 
| OLD | NEW |