| 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 #ifndef V8_COMPILER_LINKAGE_H_ | 5 #ifndef V8_COMPILER_LINKAGE_H_ |
| 6 #define V8_COMPILER_LINKAGE_H_ | 6 #define V8_COMPILER_LINKAGE_H_ |
| 7 | 7 |
| 8 #include "src/base/flags.h" | 8 #include "src/base/flags.h" |
| 9 #include "src/compiler/frame.h" | 9 #include "src/compiler/frame.h" |
| 10 #include "src/compiler/machine-type.h" | 10 #include "src/compiler/machine-type.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 | 181 |
| 182 // Returns the kind of this call. | 182 // Returns the kind of this call. |
| 183 Kind kind() const { return kind_; } | 183 Kind kind() const { return kind_; } |
| 184 | 184 |
| 185 // Returns {true} if this descriptor is a call to a C function. | 185 // Returns {true} if this descriptor is a call to a C function. |
| 186 bool IsCFunctionCall() const { return kind_ == kCallAddress; } | 186 bool IsCFunctionCall() const { return kind_ == kCallAddress; } |
| 187 | 187 |
| 188 // Returns {true} if this descriptor is a call to a JSFunction. | 188 // Returns {true} if this descriptor is a call to a JSFunction. |
| 189 bool IsJSFunctionCall() const { return kind_ == kCallJSFunction; } | 189 bool IsJSFunctionCall() const { return kind_ == kCallJSFunction; } |
| 190 | 190 |
| 191 bool RequiresFrameAsIncoming() const { |
| 192 return IsCFunctionCall() || IsJSFunctionCall(); |
| 193 } |
| 194 |
| 191 // The number of return values from this call. | 195 // The number of return values from this call. |
| 192 size_t ReturnCount() const { return machine_sig_->return_count(); } | 196 size_t ReturnCount() const { return machine_sig_->return_count(); } |
| 193 | 197 |
| 194 // The number of C parameters to this call. | 198 // The number of C parameters to this call. |
| 195 size_t CParameterCount() const { return machine_sig_->parameter_count(); } | 199 size_t CParameterCount() const { return machine_sig_->parameter_count(); } |
| 196 | 200 |
| 197 // The number of stack parameters to the call. | 201 // The number of stack parameters to the call. |
| 198 size_t StackParameterCount() const { return stack_param_count_; } | 202 size_t StackParameterCount() const { return stack_param_count_; } |
| 199 | 203 |
| 200 // The number of parameters to the JS function call. | 204 // The number of parameters to the JS function call. |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 } | 345 } |
| 342 | 346 |
| 343 // Get the machine type of this function's return value. | 347 // Get the machine type of this function's return value. |
| 344 MachineType GetReturnType(size_t index = 0) const { | 348 MachineType GetReturnType(size_t index = 0) const { |
| 345 return incoming_->GetReturnType(index); | 349 return incoming_->GetReturnType(index); |
| 346 } | 350 } |
| 347 | 351 |
| 348 bool ParameterHasSecondaryLocation(int index) const; | 352 bool ParameterHasSecondaryLocation(int index) const; |
| 349 LinkageLocation GetParameterSecondaryLocation(int index) const; | 353 LinkageLocation GetParameterSecondaryLocation(int index) const; |
| 350 | 354 |
| 351 // Get the frame offset for a given spill slot. The location depends on the | |
| 352 // calling convention and the specific frame layout, and may thus be | |
| 353 // architecture-specific. Negative spill slots indicate arguments on the | |
| 354 // caller's frame. | |
| 355 FrameOffset GetFrameOffset(int spill_slot, Frame* frame) const; | |
| 356 | |
| 357 static int FrameStateInputCount(Runtime::FunctionId function); | 355 static int FrameStateInputCount(Runtime::FunctionId function); |
| 358 | 356 |
| 359 // Get the location where an incoming OSR value is stored. | 357 // Get the location where an incoming OSR value is stored. |
| 360 LinkageLocation GetOsrValueLocation(int index) const; | 358 LinkageLocation GetOsrValueLocation(int index) const; |
| 361 | 359 |
| 362 // A special {Parameter} index for JSCalls that represents the new target. | 360 // A special {Parameter} index for JSCalls that represents the new target. |
| 363 static int GetJSCallNewTargetParamIndex(int parameter_count) { | 361 static int GetJSCallNewTargetParamIndex(int parameter_count) { |
| 364 return parameter_count + 0; // Parameter (arity + 0) is special. | 362 return parameter_count + 0; // Parameter (arity + 0) is special. |
| 365 } | 363 } |
| 366 | 364 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 393 CallDescriptor* const incoming_; | 391 CallDescriptor* const incoming_; |
| 394 | 392 |
| 395 DISALLOW_COPY_AND_ASSIGN(Linkage); | 393 DISALLOW_COPY_AND_ASSIGN(Linkage); |
| 396 }; | 394 }; |
| 397 | 395 |
| 398 } // namespace compiler | 396 } // namespace compiler |
| 399 } // namespace internal | 397 } // namespace internal |
| 400 } // namespace v8 | 398 } // namespace v8 |
| 401 | 399 |
| 402 #endif // V8_COMPILER_LINKAGE_H_ | 400 #endif // V8_COMPILER_LINKAGE_H_ |
| OLD | NEW |