Chromium Code Reviews| Index: src/compiler/linkage.cc |
| diff --git a/src/compiler/linkage.cc b/src/compiler/linkage.cc |
| index 58f9826369d495354c7c88719895d1d529e88da3..23711fc143bcf35eabdb23de04b0e5e6fc93a9ab 100644 |
| --- a/src/compiler/linkage.cc |
| +++ b/src/compiler/linkage.cc |
| @@ -2,12 +2,13 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| +#include "src/compiler/linkage.h" |
|
Jarin
2016/08/19 09:01:10
I think you should insert an empty line after this
jgruber
2016/08/19 11:17:07
Done. This was actually an automatic change by git
|
| #include "src/ast/scopes.h" |
| +#include "src/builtins/builtins-utils.h" |
| #include "src/code-stubs.h" |
| #include "src/compiler.h" |
| #include "src/compiler/common-operator.h" |
| #include "src/compiler/frame.h" |
| -#include "src/compiler/linkage.h" |
| #include "src/compiler/node.h" |
| #include "src/compiler/osr.h" |
| #include "src/compiler/pipeline.h" |
| @@ -222,6 +223,23 @@ bool CallDescriptor::UsesOnlyRegisters() const { |
| CallDescriptor* Linkage::GetRuntimeCallDescriptor( |
| Zone* zone, Runtime::FunctionId function_id, int js_parameter_count, |
| Operator::Properties properties, CallDescriptor::Flags flags) { |
| + const Runtime::Function* function = Runtime::FunctionForId(function_id); |
| + const int return_count = function->result_size; |
| + const char* debug_name = function->name; |
| + |
| + if (!Linkage::NeedsFrameStateInput(function_id)) { |
| + flags = static_cast<CallDescriptor::Flags>( |
| + flags & ~CallDescriptor::kNeedsFrameState); |
| + } |
| + |
| + return GetCEntryStubCallDescriptor(zone, return_count, js_parameter_count, |
| + debug_name, properties, flags); |
| +} |
| + |
| +CallDescriptor* Linkage::GetCEntryStubCallDescriptor( |
| + Zone* zone, int return_count, int js_parameter_count, |
| + const char* debug_name, Operator::Properties properties, |
| + CallDescriptor::Flags flags) { |
| const size_t function_count = 1; |
| const size_t num_args_count = 1; |
| const size_t context_count = 1; |
| @@ -229,10 +247,8 @@ CallDescriptor* Linkage::GetRuntimeCallDescriptor( |
| static_cast<size_t>(js_parameter_count) + |
| num_args_count + context_count; |
| - const Runtime::Function* function = Runtime::FunctionForId(function_id); |
| - const size_t return_count = static_cast<size_t>(function->result_size); |
| - |
| - LocationSignature::Builder locations(zone, return_count, parameter_count); |
| + LocationSignature::Builder locations(zone, static_cast<size_t>(return_count), |
| + static_cast<size_t>(parameter_count)); |
| // Add returns. |
| if (locations.return_count_ > 0) { |
| @@ -261,11 +277,6 @@ CallDescriptor* Linkage::GetRuntimeCallDescriptor( |
| // Add context. |
| locations.AddParam(regloc(kContextRegister, MachineType::AnyTagged())); |
| - if (!Linkage::NeedsFrameStateInput(function_id)) { |
| - flags = static_cast<CallDescriptor::Flags>( |
| - flags & ~CallDescriptor::kNeedsFrameState); |
| - } |
| - |
| // The target for runtime calls is a code object. |
| MachineType target_type = MachineType::AnyTagged(); |
| LinkageLocation target_loc = |
| @@ -280,10 +291,9 @@ CallDescriptor* Linkage::GetRuntimeCallDescriptor( |
| kNoCalleeSaved, // callee-saved |
| kNoCalleeSaved, // callee-saved fp |
| flags, // flags |
| - function->name); // debug name |
| + debug_name); // debug name |
| } |
| - |
| CallDescriptor* Linkage::GetJSCallDescriptor(Zone* zone, bool is_osr, |
| int js_parameter_count, |
| CallDescriptor::Flags flags) { |