| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 76 kHasLocalCatchHandler = 1u << 4, | 76 kHasLocalCatchHandler = 1u << 4, |
| 77 kSupportsTailCalls = 1u << 5, | 77 kSupportsTailCalls = 1u << 5, |
| 78 kPatchableCallSiteWithNop = kPatchableCallSite | kNeedsNopAfterCall | 78 kPatchableCallSiteWithNop = kPatchableCallSite | kNeedsNopAfterCall |
| 79 }; | 79 }; |
| 80 typedef base::Flags<Flag> Flags; | 80 typedef base::Flags<Flag> Flags; |
| 81 | 81 |
| 82 CallDescriptor(Kind kind, MachineType target_type, LinkageLocation target_loc, | 82 CallDescriptor(Kind kind, MachineType target_type, LinkageLocation target_loc, |
| 83 const MachineSignature* machine_sig, | 83 const MachineSignature* machine_sig, |
| 84 LocationSignature* location_sig, size_t js_param_count, | 84 LocationSignature* location_sig, size_t js_param_count, |
| 85 Operator::Properties properties, | 85 Operator::Properties properties, |
| 86 RegList callee_saved_registers, Flags flags, | 86 RegList callee_saved_registers, |
| 87 RegList callee_saved_fpu_registers, Flags flags, |
| 87 const char* debug_name = "") | 88 const char* debug_name = "") |
| 88 : kind_(kind), | 89 : kind_(kind), |
| 89 target_type_(target_type), | 90 target_type_(target_type), |
| 90 target_loc_(target_loc), | 91 target_loc_(target_loc), |
| 91 machine_sig_(machine_sig), | 92 machine_sig_(machine_sig), |
| 92 location_sig_(location_sig), | 93 location_sig_(location_sig), |
| 93 js_param_count_(js_param_count), | 94 js_param_count_(js_param_count), |
| 94 properties_(properties), | 95 properties_(properties), |
| 95 callee_saved_registers_(callee_saved_registers), | 96 callee_saved_registers_(callee_saved_registers), |
| 97 callee_saved_fpu_registers_(callee_saved_fpu_registers), |
| 96 flags_(flags), | 98 flags_(flags), |
| 97 debug_name_(debug_name) { | 99 debug_name_(debug_name) { |
| 98 DCHECK(machine_sig->return_count() == location_sig->return_count()); | 100 DCHECK(machine_sig->return_count() == location_sig->return_count()); |
| 99 DCHECK(machine_sig->parameter_count() == location_sig->parameter_count()); | 101 DCHECK(machine_sig->parameter_count() == location_sig->parameter_count()); |
| 100 } | 102 } |
| 101 | 103 |
| 102 // Returns the kind of this call. | 104 // Returns the kind of this call. |
| 103 Kind kind() const { return kind_; } | 105 Kind kind() const { return kind_; } |
| 104 | 106 |
| 105 // Returns {true} if this descriptor is a call to a JSFunction. | 107 // Returns {true} if this descriptor is a call to a JSFunction. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 if (index == 0) return target_type_; | 145 if (index == 0) return target_type_; |
| 144 return machine_sig_->GetParam(index - 1); | 146 return machine_sig_->GetParam(index - 1); |
| 145 } | 147 } |
| 146 | 148 |
| 147 // Operator properties describe how this call can be optimized, if at all. | 149 // Operator properties describe how this call can be optimized, if at all. |
| 148 Operator::Properties properties() const { return properties_; } | 150 Operator::Properties properties() const { return properties_; } |
| 149 | 151 |
| 150 // Get the callee-saved registers, if any, across this call. | 152 // Get the callee-saved registers, if any, across this call. |
| 151 RegList CalleeSavedRegisters() const { return callee_saved_registers_; } | 153 RegList CalleeSavedRegisters() const { return callee_saved_registers_; } |
| 152 | 154 |
| 155 // Get the callee-saved FPU registers, if any, across this call. |
| 156 RegList CalleeSavedFPURegisters() const { |
| 157 return callee_saved_fpu_registers_; |
| 158 } |
| 159 |
| 153 const char* debug_name() const { return debug_name_; } | 160 const char* debug_name() const { return debug_name_; } |
| 154 | 161 |
| 155 bool UsesOnlyRegisters() const; | 162 bool UsesOnlyRegisters() const; |
| 156 | 163 |
| 157 bool HasSameReturnLocationsAs(const CallDescriptor* other) const; | 164 bool HasSameReturnLocationsAs(const CallDescriptor* other) const; |
| 158 | 165 |
| 159 private: | 166 private: |
| 160 friend class Linkage; | 167 friend class Linkage; |
| 161 | 168 |
| 162 const Kind kind_; | 169 const Kind kind_; |
| 163 const MachineType target_type_; | 170 const MachineType target_type_; |
| 164 const LinkageLocation target_loc_; | 171 const LinkageLocation target_loc_; |
| 165 const MachineSignature* const machine_sig_; | 172 const MachineSignature* const machine_sig_; |
| 166 const LocationSignature* const location_sig_; | 173 const LocationSignature* const location_sig_; |
| 167 const size_t js_param_count_; | 174 const size_t js_param_count_; |
| 168 const Operator::Properties properties_; | 175 const Operator::Properties properties_; |
| 169 const RegList callee_saved_registers_; | 176 const RegList callee_saved_registers_; |
| 177 const RegList callee_saved_fpu_registers_; |
| 170 const Flags flags_; | 178 const Flags flags_; |
| 171 const char* const debug_name_; | 179 const char* const debug_name_; |
| 172 | 180 |
| 173 DISALLOW_COPY_AND_ASSIGN(CallDescriptor); | 181 DISALLOW_COPY_AND_ASSIGN(CallDescriptor); |
| 174 }; | 182 }; |
| 175 | 183 |
| 176 DEFINE_OPERATORS_FOR_FLAGS(CallDescriptor::Flags) | 184 DEFINE_OPERATORS_FOR_FLAGS(CallDescriptor::Flags) |
| 177 | 185 |
| 178 std::ostream& operator<<(std::ostream& os, const CallDescriptor& d); | 186 std::ostream& operator<<(std::ostream& os, const CallDescriptor& d); |
| 179 std::ostream& operator<<(std::ostream& os, const CallDescriptor::Kind& k); | 187 std::ostream& operator<<(std::ostream& os, const CallDescriptor::Kind& k); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 CallDescriptor* const incoming_; | 265 CallDescriptor* const incoming_; |
| 258 | 266 |
| 259 DISALLOW_COPY_AND_ASSIGN(Linkage); | 267 DISALLOW_COPY_AND_ASSIGN(Linkage); |
| 260 }; | 268 }; |
| 261 | 269 |
| 262 } // namespace compiler | 270 } // namespace compiler |
| 263 } // namespace internal | 271 } // namespace internal |
| 264 } // namespace v8 | 272 } // namespace v8 |
| 265 | 273 |
| 266 #endif // V8_COMPILER_LINKAGE_H_ | 274 #endif // V8_COMPILER_LINKAGE_H_ |
| OLD | NEW |