| 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 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 | 105 |
| 106 // Describes a call to various parts of the compiler. Every call has the notion | 106 // Describes a call to various parts of the compiler. Every call has the notion |
| 107 // of a "target", which is the first input to the call. | 107 // of a "target", which is the first input to the call. |
| 108 class CallDescriptor final : public ZoneObject { | 108 class CallDescriptor final : public ZoneObject { |
| 109 public: | 109 public: |
| 110 // Describes the kind of this call, which determines the target. | 110 // Describes the kind of this call, which determines the target. |
| 111 enum Kind { | 111 enum Kind { |
| 112 kCallCodeObject, // target is a Code object | 112 kCallCodeObject, // target is a Code object |
| 113 kCallJSFunction, // target is a JSFunction object | 113 kCallJSFunction, // target is a JSFunction object |
| 114 kCallAddress, // target is a machine pointer | 114 kCallAddress, // target is a machine pointer |
| 115 kInterpreterDispatch // target is an interpreter bytecode handler | |
| 116 }; | 115 }; |
| 117 | 116 |
| 118 enum Flag { | 117 enum Flag { |
| 119 kNoFlags = 0u, | 118 kNoFlags = 0u, |
| 120 kNeedsFrameState = 1u << 0, | 119 kNeedsFrameState = 1u << 0, |
| 121 kPatchableCallSite = 1u << 1, | 120 kPatchableCallSite = 1u << 1, |
| 122 kNeedsNopAfterCall = 1u << 2, | 121 kNeedsNopAfterCall = 1u << 2, |
| 123 kHasExceptionHandler = 1u << 3, | 122 kHasExceptionHandler = 1u << 3, |
| 124 kHasLocalCatchHandler = 1u << 4, | 123 kHasLocalCatchHandler = 1u << 4, |
| 125 kSupportsTailCalls = 1u << 5, | 124 kSupportsTailCalls = 1u << 5, |
| 125 kCanUseRoots = 1u << 6, |
| 126 kPatchableCallSiteWithNop = kPatchableCallSite | kNeedsNopAfterCall | 126 kPatchableCallSiteWithNop = kPatchableCallSite | kNeedsNopAfterCall |
| 127 }; | 127 }; |
| 128 typedef base::Flags<Flag> Flags; | 128 typedef base::Flags<Flag> Flags; |
| 129 | 129 |
| 130 CallDescriptor(Kind kind, MachineType target_type, LinkageLocation target_loc, | 130 CallDescriptor(Kind kind, MachineType target_type, LinkageLocation target_loc, |
| 131 const MachineSignature* machine_sig, | 131 const MachineSignature* machine_sig, |
| 132 LocationSignature* location_sig, size_t stack_param_count, | 132 LocationSignature* location_sig, size_t stack_param_count, |
| 133 Operator::Properties properties, | 133 Operator::Properties properties, |
| 134 RegList callee_saved_registers, | 134 RegList callee_saved_registers, |
| 135 RegList callee_saved_fp_registers, Flags flags, | 135 RegList callee_saved_fp_registers, Flags flags, |
| (...skipping 15 matching lines...) Expand all Loading... |
| 151 | 151 |
| 152 // Returns the kind of this call. | 152 // Returns the kind of this call. |
| 153 Kind kind() const { return kind_; } | 153 Kind kind() const { return kind_; } |
| 154 | 154 |
| 155 // Returns {true} if this descriptor is a call to a C function. | 155 // Returns {true} if this descriptor is a call to a C function. |
| 156 bool IsCFunctionCall() const { return kind_ == kCallAddress; } | 156 bool IsCFunctionCall() const { return kind_ == kCallAddress; } |
| 157 | 157 |
| 158 // Returns {true} if this descriptor is a call to a JSFunction. | 158 // Returns {true} if this descriptor is a call to a JSFunction. |
| 159 bool IsJSFunctionCall() const { return kind_ == kCallJSFunction; } | 159 bool IsJSFunctionCall() const { return kind_ == kCallJSFunction; } |
| 160 | 160 |
| 161 bool IsInterpreterDispatch() const { return kind_ == kInterpreterDispatch; } | |
| 162 | |
| 163 // The number of return values from this call. | 161 // The number of return values from this call. |
| 164 size_t ReturnCount() const { return machine_sig_->return_count(); } | 162 size_t ReturnCount() const { return machine_sig_->return_count(); } |
| 165 | 163 |
| 166 // The number of C parameters to this call. | 164 // The number of C parameters to this call. |
| 167 size_t CParameterCount() const { return machine_sig_->parameter_count(); } | 165 size_t CParameterCount() const { return machine_sig_->parameter_count(); } |
| 168 | 166 |
| 169 // The number of stack parameters to the call. | 167 // The number of stack parameters to the call. |
| 170 size_t StackParameterCount() const { return stack_param_count_; } | 168 size_t StackParameterCount() const { return stack_param_count_; } |
| 171 | 169 |
| 172 // The number of parameters to the JS function call. | 170 // The number of parameters to the JS function call. |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 CallDescriptor* const incoming_; | 338 CallDescriptor* const incoming_; |
| 341 | 339 |
| 342 DISALLOW_COPY_AND_ASSIGN(Linkage); | 340 DISALLOW_COPY_AND_ASSIGN(Linkage); |
| 343 }; | 341 }; |
| 344 | 342 |
| 345 } // namespace compiler | 343 } // namespace compiler |
| 346 } // namespace internal | 344 } // namespace internal |
| 347 } // namespace v8 | 345 } // namespace v8 |
| 348 | 346 |
| 349 #endif // V8_COMPILER_LINKAGE_H_ | 347 #endif // V8_COMPILER_LINKAGE_H_ |
| OLD | NEW |