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.h" | 6 #include "src/compiler.h" |
7 #include "src/compiler/common-operator.h" | 7 #include "src/compiler/common-operator.h" |
8 #include "src/compiler/frame.h" | 8 #include "src/compiler/frame.h" |
9 #include "src/compiler/linkage.h" | 9 #include "src/compiler/linkage.h" |
10 #include "src/compiler/node.h" | 10 #include "src/compiler/node.h" |
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 | 164 |
165 CallDescriptor* Linkage::ComputeIncoming(Zone* zone, CompilationInfo* info) { | 165 CallDescriptor* Linkage::ComputeIncoming(Zone* zone, CompilationInfo* info) { |
166 if (info->code_stub() != NULL) { | 166 if (info->code_stub() != NULL) { |
167 // Use the code stub interface descriptor. | 167 // Use the code stub interface descriptor. |
168 CodeStub* stub = info->code_stub(); | 168 CodeStub* stub = info->code_stub(); |
169 CallInterfaceDescriptor descriptor = stub->GetCallInterfaceDescriptor(); | 169 CallInterfaceDescriptor descriptor = stub->GetCallInterfaceDescriptor(); |
170 return GetStubCallDescriptor( | 170 return GetStubCallDescriptor( |
171 info->isolate(), zone, descriptor, stub->GetStackParameterCount(), | 171 info->isolate(), zone, descriptor, stub->GetStackParameterCount(), |
172 CallDescriptor::kNoFlags, Operator::kNoProperties); | 172 CallDescriptor::kNoFlags, Operator::kNoProperties); |
173 } | 173 } |
174 if (info->function() != NULL) { | 174 if (info->has_literal()) { |
175 // If we already have the function literal, use the number of parameters | 175 // If we already have the function literal, use the number of parameters |
176 // plus the receiver. | 176 // plus the receiver. |
177 return GetJSCallDescriptor(zone, info->is_osr(), | 177 return GetJSCallDescriptor(zone, info->is_osr(), |
178 1 + info->function()->parameter_count(), | 178 1 + info->literal()->parameter_count(), |
179 CallDescriptor::kNoFlags); | 179 CallDescriptor::kNoFlags); |
180 } | 180 } |
181 if (!info->closure().is_null()) { | 181 if (!info->closure().is_null()) { |
182 // If we are compiling a JS function, use a JS call descriptor, | 182 // If we are compiling a JS function, use a JS call descriptor, |
183 // plus the receiver. | 183 // plus the receiver. |
184 SharedFunctionInfo* shared = info->closure()->shared(); | 184 SharedFunctionInfo* shared = info->closure()->shared(); |
185 return GetJSCallDescriptor(zone, info->is_osr(), | 185 return GetJSCallDescriptor(zone, info->is_osr(), |
186 1 + shared->internal_formal_parameter_count(), | 186 1 + shared->internal_formal_parameter_count(), |
187 CallDescriptor::kNoFlags); | 187 CallDescriptor::kNoFlags); |
188 } | 188 } |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 return LinkageLocation::ForCalleeFrameSlot(spill_index); | 505 return LinkageLocation::ForCalleeFrameSlot(spill_index); |
506 } else { | 506 } else { |
507 // Parameter. Use the assigned location from the incoming call descriptor. | 507 // Parameter. Use the assigned location from the incoming call descriptor. |
508 int parameter_index = 1 + index; // skip index 0, which is the target. | 508 int parameter_index = 1 + index; // skip index 0, which is the target. |
509 return incoming_->GetInputLocation(parameter_index); | 509 return incoming_->GetInputLocation(parameter_index); |
510 } | 510 } |
511 } | 511 } |
512 } // namespace compiler | 512 } // namespace compiler |
513 } // namespace internal | 513 } // namespace internal |
514 } // namespace v8 | 514 } // namespace v8 |
OLD | NEW |